Class: LanguageServer::Protocol::Interface::DocumentSymbolRegistrationOptions

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document_selector:, work_done_progress: nil, label: nil) ⇒ DocumentSymbolRegistrationOptions

Returns a new instance of DocumentSymbolRegistrationOptions.



5
6
7
8
9
10
11
12
13
# File 'lib/language_server/protocol/interface/document_symbol_registration_options.rb', line 5

def initialize(document_selector:, work_done_progress: nil, label: nil)
  @attributes = {}

  @attributes[:documentSelector] = document_selector
  @attributes[:workDoneProgress] = work_done_progress if work_done_progress
  @attributes[:label] = label if label

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



38
39
40
# File 'lib/language_server/protocol/interface/document_symbol_registration_options.rb', line 38

def attributes
  @attributes
end

Instance Method Details

#document_selectorDocumentSelector

A document selector to identify the scope of the registration. If set to null the document selector provided on the client side will be used.

Returns:

  • (DocumentSelector)


20
21
22
# File 'lib/language_server/protocol/interface/document_symbol_registration_options.rb', line 20

def document_selector
  attributes.fetch(:documentSelector)
end

#labelstring

A human-readable string that is shown when multiple outlines trees are shown for the same document.

Returns:

  • (string)


34
35
36
# File 'lib/language_server/protocol/interface/document_symbol_registration_options.rb', line 34

def label
  attributes.fetch(:label)
end

#to_hashObject



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

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



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

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

#work_done_progressboolean

Returns:

  • (boolean)


25
26
27
# File 'lib/language_server/protocol/interface/document_symbol_registration_options.rb', line 25

def work_done_progress
  attributes.fetch(:workDoneProgress)
end