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 | nil
The name of the symbol containing this symbol.
-
#deprecated ⇒ boolean | nil
deprecated
Deprecated.
Use tags instead
-
#initialize(deprecated: nil, location:, name:, kind:, tags: nil, container_name: nil) ⇒ SymbolInformation
constructor
A new instance of SymbolInformation.
-
#kind ⇒ SymbolKind
The kind of this symbol.
-
#location ⇒ Location
The location 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(deprecated: nil, location:, name:, kind:, tags: nil, container_name: nil) ⇒ SymbolInformation
Returns a new instance of SymbolInformation.
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 9 def initialize(deprecated: nil, location:, name:, kind:, tags: nil, container_name: nil) @attributes = {} @attributes[:deprecated] = deprecated if deprecated @attributes[:location] = location @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.
85 86 87 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 85 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.
81 82 83 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 81 def container_name attributes.fetch(:containerName) end |
#deprecated ⇒ boolean | nil
Use tags instead
Indicates if this symbol is deprecated.
28 29 30 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 28 def deprecated attributes.fetch(:deprecated) end |
#kind ⇒ SymbolKind
The kind of this symbol.
60 61 62 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 60 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 than 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 an abstract syntax tree. It can therefore not be used to re-construct a hierarchy of the symbols.
44 45 46 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 44 def location attributes.fetch(:location) end |
#name ⇒ string
The name of this symbol.
52 53 54 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 52 def name attributes.fetch(:name) end |
#tags ⇒ SymbolTag[] | nil
Tags for this symbol.
70 71 72 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 70 def attributes.fetch(:tags) end |
#to_hash ⇒ Object
87 88 89 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 87 def to_hash attributes end |
#to_json(*args) ⇒ Object
91 92 93 |
# File 'lib/language_server/protocol/interface/symbol_information.rb', line 91 def to_json(*args) to_hash.to_json(*args) end |