Class: LanguageServer::Protocol::Interface::BaseSymbolInformation
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::BaseSymbolInformation
- Defined in:
- lib/language_server/protocol/interface/base_symbol_information.rb
Overview
A base for all symbol information.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#container_name ⇒ string | nil
The name of the symbol containing this symbol.
-
#initialize(name:, kind:, tags: nil, container_name: nil) ⇒ BaseSymbolInformation
constructor
A new instance of BaseSymbolInformation.
-
#kind ⇒ SymbolKind
The kind of this symbol.
-
#name ⇒ string
The name of this symbol.
-
#tags ⇒ SymbolTag[] | nil
Tags for this symbol.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(name:, kind:, tags: nil, container_name: nil) ⇒ BaseSymbolInformation
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/language_server/protocol/interface/base_symbol_information.rb', line 8 def initialize(name:, kind:, tags: nil, container_name: nil) @attributes = {} @attributes[:name] = name @attributes[:kind] = kind @attributes[:tags] = if @attributes[:containerName] = container_name if container_name @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
56 57 58 |
# File 'lib/language_server/protocol/interface/base_symbol_information.rb', line 56 def attributes @attributes end |
Instance Method Details
#container_name ⇒ string | nil
The name of the symbol containing this symbol. This information is for user interface purposes (e.g. to render a qualifier in the user interface if necessary). It can’t be used to re-infer a hierarchy for the document symbols.
52 53 54 |
# File 'lib/language_server/protocol/interface/base_symbol_information.rb', line 52 def container_name attributes.fetch(:containerName) end |
#kind ⇒ SymbolKind
The kind of this symbol.
31 32 33 |
# File 'lib/language_server/protocol/interface/base_symbol_information.rb', line 31 def kind attributes.fetch(:kind) end |
#name ⇒ string
The name of this symbol.
23 24 25 |
# File 'lib/language_server/protocol/interface/base_symbol_information.rb', line 23 def name attributes.fetch(:name) end |
#tags ⇒ SymbolTag[] | nil
Tags for this symbol.
41 42 43 |
# File 'lib/language_server/protocol/interface/base_symbol_information.rb', line 41 def attributes.fetch(:tags) end |
#to_hash ⇒ Object
58 59 60 |
# File 'lib/language_server/protocol/interface/base_symbol_information.rb', line 58 def to_hash attributes end |
#to_json(*args) ⇒ Object
62 63 64 |
# File 'lib/language_server/protocol/interface/base_symbol_information.rb', line 62 def to_json(*args) to_hash.to_json(*args) end |