Class: LanguageServer::Protocol::Interface::DidChangeNotebookDocumentParams
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::DidChangeNotebookDocumentParams
- Defined in:
- lib/language_server/protocol/interface/did_change_notebook_document_params.rb
Overview
The params sent in a change notebook document notification.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#change ⇒ NotebookDocumentChangeEvent
The actual changes to the notebook document.
-
#initialize(notebook_document:, change:) ⇒ DidChangeNotebookDocumentParams
constructor
A new instance of DidChangeNotebookDocumentParams.
-
#notebook_document ⇒ VersionedNotebookDocumentIdentifier
The notebook document that did change.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(notebook_document:, change:) ⇒ DidChangeNotebookDocumentParams
Returns a new instance of DidChangeNotebookDocumentParams.
8 9 10 11 12 13 14 15 |
# File 'lib/language_server/protocol/interface/did_change_notebook_document_params.rb', line 8 def initialize(notebook_document:, change:) @attributes = {} @attributes[:notebookDocument] = notebook_document @attributes[:change] = change @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
44 45 46 |
# File 'lib/language_server/protocol/interface/did_change_notebook_document_params.rb', line 44 def attributes @attributes end |
Instance Method Details
#change ⇒ NotebookDocumentChangeEvent
The actual changes to the notebook document.
The change describes single state change to the notebook document. So it moves a notebook document, its cells and its cell text document contents from state S to S’.
To mirror the content of a notebook using change events use the following approach:
-
start with the same initial content
-
apply the ‘notebookDocument/didChange’ notifications in the order
you receive them.
40 41 42 |
# File 'lib/language_server/protocol/interface/did_change_notebook_document_params.rb', line 40 def change attributes.fetch(:change) end |
#notebook_document ⇒ VersionedNotebookDocumentIdentifier
The notebook document that did change. The version number points to the version after all provided changes have been applied.
22 23 24 |
# File 'lib/language_server/protocol/interface/did_change_notebook_document_params.rb', line 22 def notebook_document attributes.fetch(:notebookDocument) end |
#to_hash ⇒ Object
46 47 48 |
# File 'lib/language_server/protocol/interface/did_change_notebook_document_params.rb', line 46 def to_hash attributes end |
#to_json(*args) ⇒ Object
50 51 52 |
# File 'lib/language_server/protocol/interface/did_change_notebook_document_params.rb', line 50 def to_json(*args) to_hash.to_json(*args) end |