Class: LanguageServer::Protocol::Interface::CallHierarchyItem
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::CallHierarchyItem
- Defined in:
- lib/language_server/protocol/interface/call_hierarchy_item.rb
Overview
Represents programming constructs like functions or constructors in the context of call hierarchy.
Instance Attribute Summary collapse
- #attributes ⇒ Object readonly
Instance Method Summary collapse
-
#data ⇒ LSPAny | nil
A data entry field that is preserved between a call hierarchy prepare and incoming calls or outgoing calls requests.
-
#detail ⇒ string | nil
More detail for this item, e.g.
-
#initialize(name:, kind:, tags: nil, detail: nil, uri:, range:, selection_range:, data: nil) ⇒ CallHierarchyItem
constructor
A new instance of CallHierarchyItem.
-
#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) ⇒ CallHierarchyItem
Returns a new instance of CallHierarchyItem.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 11 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)
92 93 94 |
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 92 def attributes @attributes end |
Instance Method Details
#data ⇒ LSPAny | nil
A data entry field that is preserved between a call hierarchy prepare and incoming calls or outgoing calls requests.
88 89 90 |
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 88 def data attributes.fetch(:data) end |
#detail ⇒ string | nil
More detail for this item, e.g. the signature of a function.
54 55 56 |
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 54 def detail attributes.fetch(:detail) end |
#kind ⇒ SymbolKind
The kind of this item.
38 39 40 |
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 38 def kind attributes.fetch(:kind) end |
#name ⇒ string
The name of this item.
30 31 32 |
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 30 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.
70 71 72 |
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 70 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](#CallHierarchyItem.range).
79 80 81 |
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 79 def selection_range attributes.fetch(:selectionRange) end |
#tags ⇒ SymbolTag[] | nil
Tags for this item.
46 47 48 |
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 46 def attributes.fetch(:tags) end |
#to_hash ⇒ Object
94 95 96 |
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 94 def to_hash attributes end |
#to_json(*args) ⇒ Object
98 99 100 |
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 98 def to_json(*args) to_hash.to_json(*args) end |
#uri ⇒ DocumentUri
The resource identifier of this item.
62 63 64 |
# File 'lib/language_server/protocol/interface/call_hierarchy_item.rb', line 62 def uri attributes.fetch(:uri) end |