Class: LanguageServer::Protocol::Interface::DocumentFilter
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::DocumentFilter
- Defined in:
- lib/language_server/protocol/interface/document_filter.rb
Overview
A document filter describes a top level text document or a notebook cell document.
Instance Attribute Summary collapse
- #attributes ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(language:, scheme: nil, pattern: nil, notebook:) ⇒ DocumentFilter
constructor
A new instance of DocumentFilter.
-
#language ⇒ string
A language id, like
typescript. -
#notebook ⇒ string | NotebookDocumentFilter
A filter that matches against the notebook containing the notebook cell.
-
#pattern ⇒ string | nil
A glob pattern, like ‘*.ts,js`.
-
#scheme ⇒ string | nil
A Uri [scheme](#Uri.scheme), like
fileoruntitled. - #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(language:, scheme: nil, pattern: nil, notebook:) ⇒ DocumentFilter
Returns a new instance of DocumentFilter.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/language_server/protocol/interface/document_filter.rb', line 11 def initialize(language:, scheme: nil, pattern: nil, notebook:) @attributes = {} @attributes[:language] = language @attributes[:scheme] = scheme if scheme @attributes[:pattern] = pattern if pattern @attributes[:notebook] = notebook @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
57 58 59 |
# File 'lib/language_server/protocol/interface/document_filter.rb', line 57 def attributes @attributes end |
Instance Method Details
#language ⇒ string
A language id, like typescript. */
26 27 28 |
# File 'lib/language_server/protocol/interface/document_filter.rb', line 26 def language attributes.fetch(:language) end |
#notebook ⇒ string | NotebookDocumentFilter
A filter that matches against the notebook containing the notebook cell. If a string value is provided it matches against the notebook type. ‘*’ matches every notebook.
53 54 55 |
# File 'lib/language_server/protocol/interface/document_filter.rb', line 53 def notebook attributes.fetch(:notebook) end |
#pattern ⇒ string | nil
A glob pattern, like ‘*.ts,js`. */
42 43 44 |
# File 'lib/language_server/protocol/interface/document_filter.rb', line 42 def pattern attributes.fetch(:pattern) end |
#scheme ⇒ string | nil
A Uri [scheme](#Uri.scheme), like file or untitled. */
34 35 36 |
# File 'lib/language_server/protocol/interface/document_filter.rb', line 34 def scheme attributes.fetch(:scheme) end |
#to_hash ⇒ Object
59 60 61 |
# File 'lib/language_server/protocol/interface/document_filter.rb', line 59 def to_hash attributes end |
#to_json(*args) ⇒ Object
63 64 65 |
# File 'lib/language_server/protocol/interface/document_filter.rb', line 63 def to_json(*args) to_hash.to_json(*args) end |