class LanguageServer::Protocol::Interface::NotebookDocument

A notebook document.

Attributes

attributes[R]

Public Class Methods

new(uri:, notebook_type:, version:, metadata: nil, cells:) click to toggle source
# File lib/language_server/protocol/interface/notebook_document.rb, line 8
def initialize(uri:, notebook_type:, version:, metadata: nil, cells:)
  @attributes = {}

  @attributes[:uri] = uri
  @attributes[:notebookType] = notebook_type
  @attributes[:version] = version
  @attributes[:metadata] = metadata if metadata
  @attributes[:cells] = cells

  @attributes.freeze
end

Public Instance Methods

cells() click to toggle source

The cells of a notebook.

@return [NotebookCell

# File lib/language_server/protocol/interface/notebook_document.rb, line 58
def cells
  attributes.fetch(:cells)
end
metadata() click to toggle source

Additional metadata stored with the notebook document.

@return [LSPObject]

# File lib/language_server/protocol/interface/notebook_document.rb, line 50
def metadata
  attributes.fetch(:metadata)
end
notebook_type() click to toggle source

The type of the notebook.

@return [string]

# File lib/language_server/protocol/interface/notebook_document.rb, line 32
def notebook_type
  attributes.fetch(:notebookType)
end
to_hash() click to toggle source
# File lib/language_server/protocol/interface/notebook_document.rb, line 64
def to_hash
  attributes
end
to_json(*args) click to toggle source
# File lib/language_server/protocol/interface/notebook_document.rb, line 68
def to_json(*args)
  to_hash.to_json(*args)
end
uri() click to toggle source

The notebook document’s URI.

@return [string]

# File lib/language_server/protocol/interface/notebook_document.rb, line 24
def uri
  attributes.fetch(:uri)
end
version() click to toggle source

The version number of this document (it will increase after each change, including undo/redo).

@return [number]

# File lib/language_server/protocol/interface/notebook_document.rb, line 41
def version
  attributes.fetch(:version)
end