Class: LanguageServer::Protocol::Interface::TypeHierarchyItem
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::TypeHierarchyItem
- Defined in:
- lib/language_server/protocol/interface/type_hierarchy_item.rb
Overview
Instance Attribute Summary collapse
- #attributes ⇒ Object readonly
Instance Method Summary collapse
-
#data ⇒ LSPAny | nil
A data entry field that is preserved between a type hierarchy prepare and supertypes or subtypes requests.
-
#detail ⇒ string | nil
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 ⇒ SymbolTag[] | nil
Tags for this item.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#uri ⇒ DocumentUri
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.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 8 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)
93 94 95 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 93 def attributes @attributes end |
Instance Method Details
#data ⇒ LSPAny | nil
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.
89 90 91 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 89 def data attributes.fetch(:data) end |
#detail ⇒ string | nil
More detail for this item, e.g. the signature of a function.
51 52 53 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 51 def detail attributes.fetch(:detail) end |
#kind ⇒ SymbolKind
The kind of this item.
35 36 37 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 35 def kind attributes.fetch(:kind) end |
#name ⇒ string
The name of this item.
27 28 29 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 27 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.
68 69 70 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 68 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).
78 79 80 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 78 def selection_range attributes.fetch(:selectionRange) end |
#tags ⇒ SymbolTag[] | nil
Tags for this item.
43 44 45 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 43 def attributes.fetch(:tags) end |
#to_hash ⇒ Object
95 96 97 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 95 def to_hash attributes end |
#to_json(*args) ⇒ Object
99 100 101 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 99 def to_json(*args) to_hash.to_json(*args) end |
#uri ⇒ DocumentUri
The resource identifier of this item.
59 60 61 |
# File 'lib/language_server/protocol/interface/type_hierarchy_item.rb', line 59 def uri attributes.fetch(:uri) end |