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.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of NotebookDocumentSyncRegistrationOptions.



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

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)

Returns the value of attribute attributes.



44
45
46
# File 'lib/language_server/protocol/interface/notebook_document_sync_registration_options.rb', line 44

def attributes
  @attributes
end

Instance Method Details

#idstring

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

Returns:

  • (string)


40
41
42
# File 'lib/language_server/protocol/interface/notebook_document_sync_registration_options.rb', line 40

def id
  attributes.fetch(:id)
end

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

The notebooks to be synced

Returns:



22
23
24
# File 'lib/language_server/protocol/interface/notebook_document_sync_registration_options.rb', line 22

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)


31
32
33
# File 'lib/language_server/protocol/interface/notebook_document_sync_registration_options.rb', line 31

def save
  attributes.fetch(:save)
end

#to_hashObject



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



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

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