Class: LanguageServer::Protocol::Interface::DocumentSymbolClientCapabilities

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(dynamic_registration: nil, symbol_kind: nil, hierarchical_document_symbol_support: nil, tag_support: nil, label_support: nil) ⇒ DocumentSymbolClientCapabilities

Returns a new instance of DocumentSymbolClientCapabilities.



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

def initialize(dynamic_registration: nil, symbol_kind: nil, hierarchical_document_symbol_support: nil, tag_support: nil, label_support: nil)
  @attributes = {}

  @attributes[:dynamicRegistration] = dynamic_registration if dynamic_registration
  @attributes[:symbolKind] = symbol_kind if symbol_kind
  @attributes[:hierarchicalDocumentSymbolSupport] = hierarchical_document_symbol_support if hierarchical_document_symbol_support
  @attributes[:tagSupport] = tag_support if tag_support
  @attributes[:labelSupport] = label_support if label_support

  @attributes.freeze
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



61
62
63
# File 'lib/language_server/protocol/interface/document_symbol_client_capabilities.rb', line 61

def attributes
  @attributes
end

Instance Method Details

#dynamic_registrationboolean

Whether document symbol supports dynamic registration.

Returns:

  • (boolean)


21
22
23
# File 'lib/language_server/protocol/interface/document_symbol_client_capabilities.rb', line 21

def dynamic_registration
  attributes.fetch(:dynamicRegistration)
end

#hierarchical_document_symbol_supportboolean

The client supports hierarchical document symbols.

Returns:

  • (boolean)


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

def hierarchical_document_symbol_support
  attributes.fetch(:hierarchicalDocumentSymbolSupport)
end

#label_supportboolean

The client supports an additional label presented in the UI when registering a document symbol provider.

Returns:

  • (boolean)


57
58
59
# File 'lib/language_server/protocol/interface/document_symbol_client_capabilities.rb', line 57

def label_support
  attributes.fetch(:labelSupport)
end

#symbol_kind{ valueSet?: SymbolKind[]; }

Specific capabilities for the ‘SymbolKind` in the `textDocument/documentSymbol` request.

Returns:

  • ({ valueSet?: SymbolKind[]; })


30
31
32
# File 'lib/language_server/protocol/interface/document_symbol_client_capabilities.rb', line 30

def symbol_kind
  attributes.fetch(:symbolKind)
end

#tag_support{ valueSet: 1[]; }

The client supports tags on ‘SymbolInformation`. Tags are supported on `DocumentSymbol` if `hierarchicalDocumentSymbolSupport` is set to true. Clients supporting tags have to handle unknown tags gracefully.

Returns:

  • ({ valueSet: 1[]; })


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

def tag_support
  attributes.fetch(:tagSupport)
end

#to_hashObject



63
64
65
# File 'lib/language_server/protocol/interface/document_symbol_client_capabilities.rb', line 63

def to_hash
  attributes
end

#to_json(*args) ⇒ Object



67
68
69
# File 'lib/language_server/protocol/interface/document_symbol_client_capabilities.rb', line 67

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