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

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

Overview

Registration options for a DocumentSymbolRequest.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of DocumentSymbolRegistrationOptions.

Parameters:

  • document_selector: (Object)
  • label: (String) (defaults to: nil)
  • work_done_progress: (Boolean) (defaults to: nil)


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

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

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

  @attributes.freeze
end

Instance Attribute Details

#attributesHash[Symbol, untyped] (readonly)

Returns the value of attribute attributes.

Returns:

  • (Hash[Symbol, untyped])


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

def attributes
  @attributes
end

Instance Method Details

#document_selectorDocumentSelector | nil

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 | nil)


23
24
25
# File 'lib/language_server/protocol/interface/document_symbol_registration_options.rb', line 23

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)

Since:

  • 3.16.0



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

def label
  attributes.fetch(:label)
end

#to_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])


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

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)


49
50
51
# File 'lib/language_server/protocol/interface/document_symbol_registration_options.rb', line 49

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

#work_done_progressboolean

Returns:

  • (boolean)


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

def work_done_progress
  attributes.fetch(:workDoneProgress)
end