Class: LanguageServer::Protocol::Interface::NotebookDocumentSyncOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/language_server/protocol/interface/notebook_document_sync_options.rb,
sig/language_server/protocol/interface/notebook_document_sync_options.rbs

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 document that contain at least one matching cell will be synced.

Since:

  • 3.17.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(notebook_selector:, save: nil) ⇒ NotebookDocumentSyncOptions

Returns a new instance of NotebookDocumentSyncOptions.

Parameters:

  • notebook_selector: (Array[untyped])
  • save: (Boolean) (defaults to: nil)

Since:

  • 3.17.0



20
21
22
23
24
25
26
27
# File 'lib/language_server/protocol/interface/notebook_document_sync_options.rb', line 20

def initialize(notebook_selector:, save: nil)
  @attributes = {}

  @attributes[:notebookSelector] = notebook_selector
  @attributes[:save] = save if save

  @attributes.freeze
end

Instance Attribute Details

#attributesHash[Symbol, untyped] (readonly)

Returns:

  • (Hash[Symbol, untyped])

Since:

  • 3.17.0



46
47
48
# File 'lib/language_server/protocol/interface/notebook_document_sync_options.rb', line 46

def attributes
  @attributes
end

Instance Method Details

#notebook_selector{ notebook: string | NotebookDocumentFilter; cells?: { language: string; }[]; } | { notebook?: string | NotebookDocumentFilter; cells: { language: string; }[]; }[]

The notebooks to be synced

Returns:

Since:

  • 3.17.0



33
34
35
# File 'lib/language_server/protocol/interface/notebook_document_sync_options.rb', line 33

def notebook_selector
  attributes.fetch(:notebookSelector)
end

#saveboolean

Whether save notification should be forwarded to the server. Will only be honored if mode === notebook.

Returns:

  • (boolean)

Since:

  • 3.17.0



42
43
44
# File 'lib/language_server/protocol/interface/notebook_document_sync_options.rb', line 42

def save
  attributes.fetch(:save)
end

#to_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])

Since:

  • 3.17.0



48
49
50
# File 'lib/language_server/protocol/interface/notebook_document_sync_options.rb', line 48

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)

Since:

  • 3.17.0



52
53
54
# File 'lib/language_server/protocol/interface/notebook_document_sync_options.rb', line 52

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