Class: LanguageServer::Protocol::Interface::NotebookDocumentSyncOptions
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::NotebookDocumentSyncOptions
- Defined in:
- lib/language_server/protocol/interface/notebook_document_sync_options.rb
Overview
Options specific to a notebook plus its cells to be synced to the server.
If a selector provides a notebook document filter but no cell selector all cells of a matching notebook document will be synced.
If a selector provides no notebook document filter but only a cell selector all notebook documents that contain at least one matching cell will be synced.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(notebook_selector:, save: nil) ⇒ NotebookDocumentSyncOptions
constructor
A new instance of NotebookDocumentSyncOptions.
-
#notebook_selector ⇒ ({ notebook: string | NotebookDocumentFilter; cells?: { language: string; }[]; } | { notebook?: string | NotebookDocumentFilter; cells: { ...; }[]; })[]
The notebooks to be synced.
-
#save ⇒ boolean
Whether save notification should be forwarded to the server.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(notebook_selector:, save: nil) ⇒ NotebookDocumentSyncOptions
Returns a new instance of NotebookDocumentSyncOptions.
18 19 20 21 22 23 24 25 |
# File 'lib/language_server/protocol/interface/notebook_document_sync_options.rb', line 18 def initialize(notebook_selector:, save: nil) @attributes = {} @attributes[:notebookSelector] = notebook_selector @attributes[:save] = save if save @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
44 45 46 |
# File 'lib/language_server/protocol/interface/notebook_document_sync_options.rb', line 44 def attributes @attributes end |
Instance Method Details
#notebook_selector ⇒ ({ notebook: string | NotebookDocumentFilter; cells?: { language: string; }[]; } | { notebook?: string | NotebookDocumentFilter; cells: { ...; }[]; })[]
The notebooks to be synced
31 32 33 |
# File 'lib/language_server/protocol/interface/notebook_document_sync_options.rb', line 31 def notebook_selector attributes.fetch(:notebookSelector) end |
#save ⇒ boolean
Whether save notification should be forwarded to the server. Will only be honored if mode === ‘notebook`.
40 41 42 |
# File 'lib/language_server/protocol/interface/notebook_document_sync_options.rb', line 40 def save attributes.fetch(:save) end |
#to_hash ⇒ Object
46 47 48 |
# File 'lib/language_server/protocol/interface/notebook_document_sync_options.rb', line 46 def to_hash attributes end |
#to_json(*args) ⇒ Object
50 51 52 |
# File 'lib/language_server/protocol/interface/notebook_document_sync_options.rb', line 50 def to_json(*args) to_hash.to_json(*args) end |