Class: LanguageServer::Protocol::Interface::DocumentSymbolOptions

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

Overview

Provider options for a DocumentSymbolRequest.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(label: nil, work_done_progress: nil) ⇒ DocumentSymbolOptions

Returns a new instance of DocumentSymbolOptions.

Parameters:

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


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

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

  @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])


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

def attributes
  @attributes
end

Instance Method Details

#labelstring

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

Returns:

  • (string)

Since:

  • 3.16.0



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

def label
  attributes.fetch(:label)
end

#to_hashHash[Symbol, untyped]

Returns:

  • (Hash[Symbol, untyped])


35
36
37
# File 'lib/language_server/protocol/interface/document_symbol_options.rb', line 35

def to_hash
  attributes
end

#to_json(*args) ⇒ String

Parameters:

  • (Object)

Returns:

  • (String)


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

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

#work_done_progressboolean

Returns:

  • (boolean)


29
30
31
# File 'lib/language_server/protocol/interface/document_symbol_options.rb', line 29

def work_done_progress
  attributes.fetch(:workDoneProgress)
end