Class: LanguageServer::Protocol::Interface::SymbolInformation
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::SymbolInformation
- Defined in:
- lib/language_server/protocol/interface/symbol_information.rb
Overview
Represents information about programming constructs like variables, classes, interfaces etc.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#container_name ⇒ string
The name of the symbol containing this symbol.
-
#deprecated ⇒ boolean
Indicates if this symbol is deprecated.
-
#initialize(name:, kind:, deprecated: nil, location:, container_name: nil) ⇒ SymbolInformation
constructor
A new instance of SymbolInformation.
-
#kind ⇒ number
The kind of this symbol.
-
#location ⇒ Location
The location of this symbol.
-
#name ⇒ string
The name of this symbol.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(name:, kind:, deprecated: nil, location:, container_name: nil) ⇒ SymbolInformation
Returns a new instance of SymbolInformation.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 9 def initialize(name:, kind:, deprecated: nil, location:, container_name: nil) @attributes = {} @attributes[:name] = name @attributes[:kind] = kind @attributes[:deprecated] = deprecated if deprecated @attributes[:location] = location @attributes[:containerName] = container_name if container_name @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
72 73 74 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 72 def attributes @attributes end |
Instance Method Details
#container_name ⇒ string
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.
68 69 70 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 68 def container_name attributes.fetch(:containerName) end |
#deprecated ⇒ boolean
Indicates if this symbol is deprecated.
41 42 43 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 41 def deprecated attributes.fetch(:deprecated) end |
#kind ⇒ number
The kind of this symbol.
33 34 35 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 33 def kind attributes.fetch(:kind) end |
#location ⇒ Location
The location of this symbol. The location’s range is used by a tool to reveal the location in the editor. If the symbol is selected in the tool the range’s start information is used to position the cursor. So the range usually spans more then the actual symbol’s name and does normally include things like visibility modifiers.
The range doesn’t have to denote a node range in the sense of a abstract syntax tree. It can therefore not be used to re-construct a hierarchy of the symbols.
57 58 59 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 57 def location attributes.fetch(:location) end |
#name ⇒ string
The name of this symbol.
25 26 27 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 25 def name attributes.fetch(:name) end |
#to_hash ⇒ Object
74 75 76 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 74 def to_hash attributes end |
#to_json(*args) ⇒ Object
78 79 80 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 78 def to_json(*args) to_hash.to_json(*args) end |