Class: LanguageServer::Protocol::Interface::NotebookDocumentSyncRegistrationOptions

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

Overview

Registration options specific to a notebook.

Since:

  • 3.17.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(notebook_selector:, save: nil, id: nil) ⇒ NotebookDocumentSyncRegistrationOptions

Returns a new instance of NotebookDocumentSyncRegistrationOptions.

Since:

  • 3.17.0



10
11
12
13
14
15
16
17
18
# File 'lib/language_server/protocol/interface/notebook_document_sync_registration_options.rb', line 10

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

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

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Since:

  • 3.17.0



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

def attributes
  @attributes
end

Instance Method Details

#idstring | nil

The id used to register the request. The id can be used to deregister the request again. See also Registration#id.

Returns:

  • (string | nil)

Since:

  • 3.17.0



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

def id
  attributes.fetch(:id)
end

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

The notebooks to be synced

Returns:

Since:

  • 3.17.0



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

def notebook_selector
  attributes.fetch(:notebookSelector)
end

#saveboolean | nil

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

Returns:

  • (boolean | nil)

Since:

  • 3.17.0



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

def save
  attributes.fetch(:save)
end

#to_hashObject

Since:

  • 3.17.0



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object

Since:

  • 3.17.0



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

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