Class: LanguageServer::Protocol::Interface::TypeHierarchyItem
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::TypeHierarchyItem
- Defined in:
- lib/language_server/protocol/interface/type_hierarchy_item.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#data ⇒ LSPAny
A data entry field that is preserved between a type hierarchy prepare and supertypes or subtypes requests.
-
#detail ⇒ string
More detail for this item, e.g.
-
#initialize(name:, kind:, tags: nil, detail: nil, uri:, range:, selection_range:, data: nil) ⇒ TypeHierarchyItem
constructor
A new instance of TypeHierarchyItem.
-
#kind ⇒ SymbolKind
The kind of this item.
-
#name ⇒ string
The name of this item.
-
#range ⇒ Range
The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g.
-
#selection_range ⇒ Range
The range that should be selected and revealed when this symbol is being picked, e.g.
-
#tags ⇒ 1[]
Tags for this item.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#uri ⇒ string
The resource identifier of this item.
Constructor Details
#initialize(name:, kind:, tags: nil, detail: nil, uri:, range:, selection_range:, data: nil) ⇒ TypeHierarchyItem
Returns a new instance of TypeHierarchyItem.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 5 def initialize(name:, kind:, tags: nil, detail: nil, uri:, range:, selection_range:, data: nil) @attributes = {} @attributes[:name] = name @attributes[:kind] = kind @attributes[:tags] = if @attributes[:detail] = detail if detail @attributes[:uri] = uri @attributes[:range] = range @attributes[:selectionRange] = selection_range @attributes[:data] = data if data @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
90 91 92 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 90 def attributes @attributes end |
Instance Method Details
#data ⇒ LSPAny
A data entry field that is preserved between a type hierarchy prepare and supertypes or subtypes requests. It could also be used to identify the type hierarchy in the server, helping improve the performance on resolving supertypes and subtypes.
86 87 88 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 86 def data attributes.fetch(:data) end |
#detail ⇒ string
More detail for this item, e.g. the signature of a function.
48 49 50 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 48 def detail attributes.fetch(:detail) end |
#kind ⇒ SymbolKind
The kind of this item.
32 33 34 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 32 def kind attributes.fetch(:kind) end |
#name ⇒ string
The name of this item.
24 25 26 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 24 def name attributes.fetch(:name) end |
#range ⇒ Range
The range enclosing this symbol not including leading/trailing whitespace but everything else, e.g. comments and code.
65 66 67 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 65 def range attributes.fetch(:range) end |
#selection_range ⇒ Range
The range that should be selected and revealed when this symbol is being picked, e.g. the name of a function. Must be contained by the [‘range`](#TypeHierarchyItem.range).
75 76 77 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 75 def selection_range attributes.fetch(:selectionRange) end |
#tags ⇒ 1[]
Tags for this item.
40 41 42 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 40 def attributes.fetch(:tags) end |
#to_hash ⇒ Object
92 93 94 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 92 def to_hash attributes end |
#to_json(*args) ⇒ Object
96 97 98 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 96 def to_json(*args) to_hash.to_json(*args) end |
#uri ⇒ string
The resource identifier of this item.
56 57 58 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 56 def uri attributes.fetch(:uri) end |