Class: LanguageServer::Protocol::Interface::NotebookDocument

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/notebook_document.rb

Overview

A notebook document.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri:, notebook_type:, version:, metadata: nil, cells:) ⇒ NotebookDocument

Returns a new instance of NotebookDocument.



8
9
10
11
12
13
14
15
16
17
18
# 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] =  if 
  @attributes[:cells] = cells

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



62
63
64
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 62

def attributes
  @attributes
end

Instance Method Details

#cellsNotebookCell[]

The cells of a notebook.

Returns:



58
59
60
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 58

def cells
  attributes.fetch(:cells)
end

#metadataLSPObject

Additional metadata stored with the notebook document.

Returns:

  • (LSPObject)


50
51
52
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 50

def 
  attributes.fetch(:metadata)
end

#notebook_typestring

The type of the notebook.

Returns:

  • (string)


32
33
34
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 32

def notebook_type
  attributes.fetch(:notebookType)
end

#to_hashObject



64
65
66
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 64

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



68
69
70
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 68

def to_json(*args)
  to_hash.to_json(*args)
end

#uristring

The notebook document’s URI.

Returns:

  • (string)


24
25
26
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 24

def uri
  attributes.fetch(:uri)
end

#versionnumber

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

Returns:

  • (number)


41
42
43
# File 'lib/language_server/protocol/interface/notebook_document.rb', line 41

def version
  attributes.fetch(:version)
end