Class: LanguageServer::Protocol::Interface::NotebookCell
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::NotebookCell
- Defined in:
- lib/language_server/protocol/interface/notebook_cell.rb
Overview
A notebook cell.
A cell’s document URI must be unique across ALL notebook cells and can therefore be used to uniquely identify a notebook cell or the cell’s text document.
Instance Attribute Summary collapse
- #attributes ⇒ Object readonly
Instance Method Summary collapse
-
#document ⇒ DocumentUri
The URI of the cell’s text document content.
-
#execution_summary ⇒ ExecutionSummary | nil
Additional execution summary information if supported by the client.
-
#initialize(kind:, document:, metadata: nil, execution_summary: nil) ⇒ NotebookCell
constructor
A new instance of NotebookCell.
-
#kind ⇒ NotebookCellKind
The cell’s kind.
-
#metadata ⇒ LSPObject | nil
Additional metadata stored with the cell.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(kind:, document:, metadata: nil, execution_summary: nil) ⇒ NotebookCell
Returns a new instance of NotebookCell.
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/language_server/protocol/interface/notebook_cell.rb', line 14 def initialize(kind:, document:, metadata: nil, execution_summary: nil) @attributes = {} @attributes[:kind] = kind @attributes[:document] = document @attributes[:metadata] = if @attributes[:executionSummary] = execution_summary if execution_summary @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
61 62 63 |
# File 'lib/language_server/protocol/interface/notebook_cell.rb', line 61 def attributes @attributes end |
Instance Method Details
#document ⇒ DocumentUri
The URI of the cell’s text document content.
38 39 40 |
# File 'lib/language_server/protocol/interface/notebook_cell.rb', line 38 def document attributes.fetch(:document) end |
#execution_summary ⇒ ExecutionSummary | nil
Additional execution summary information if supported by the client.
57 58 59 |
# File 'lib/language_server/protocol/interface/notebook_cell.rb', line 57 def execution_summary attributes.fetch(:executionSummary) end |
#kind ⇒ NotebookCellKind
The cell’s kind
29 30 31 |
# File 'lib/language_server/protocol/interface/notebook_cell.rb', line 29 def kind attributes.fetch(:kind) end |
#metadata ⇒ LSPObject | nil
Additional metadata stored with the cell.
Note: should always be an object literal (e.g. LSPObject)
48 49 50 |
# File 'lib/language_server/protocol/interface/notebook_cell.rb', line 48 def attributes.fetch(:metadata) end |
#to_hash ⇒ Object
63 64 65 |
# File 'lib/language_server/protocol/interface/notebook_cell.rb', line 63 def to_hash attributes end |
#to_json(*args) ⇒ Object
67 68 69 |
# File 'lib/language_server/protocol/interface/notebook_cell.rb', line 67 def to_json(*args) to_hash.to_json(*args) end |