Class: LanguageServer::Protocol::Interface::InlayHintLabelPart
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::InlayHintLabelPart
- Defined in:
- lib/language_server/protocol/interface/inlay_hint_label_part.rb
Overview
An inlay hint label part allows for interactive and composite labels of inlay hints.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#command ⇒ Command
An optional command for this label part.
-
#initialize(value:, tooltip: nil, location: nil, command: nil) ⇒ InlayHintLabelPart
constructor
A new instance of InlayHintLabelPart.
-
#location ⇒ Location
An optional source code location that represents this label part.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
-
#tooltip ⇒ string | MarkupContent
The tooltip text when you hover over this label part.
-
#value ⇒ string
The value of this label part.
Constructor Details
#initialize(value:, tooltip: nil, location: nil, command: nil) ⇒ InlayHintLabelPart
Returns a new instance of InlayHintLabelPart.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/language_server/protocol/interface/inlay_hint_label_part.rb', line 9 def initialize(value:, tooltip: nil, location: nil, command: nil) @attributes = {} @attributes[:value] = value @attributes[:tooltip] = tooltip if tooltip @attributes[:location] = location if location @attributes[:command] = command if command @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
67 68 69 |
# File 'lib/language_server/protocol/interface/inlay_hint_label_part.rb', line 67 def attributes @attributes end |
Instance Method Details
#command ⇒ Command
An optional command for this label part.
Depending on the client capability ‘inlayHint.resolveSupport` clients might resolve this property late using the resolve request.
63 64 65 |
# File 'lib/language_server/protocol/interface/inlay_hint_label_part.rb', line 63 def command attributes.fetch(:command) end |
#location ⇒ Location
An optional source code location that represents this label part.
The editor will use this location for the hover and for code navigation features: This part will become a clickable link that resolves to the definition of the symbol at the given location (not necessarily the location itself), it shows the hover that shows at the given location, and it shows a context menu with further code navigation commands.
Depending on the client capability ‘inlayHint.resolveSupport` clients might resolve this property late using the resolve request.
52 53 54 |
# File 'lib/language_server/protocol/interface/inlay_hint_label_part.rb', line 52 def location attributes.fetch(:location) end |
#to_hash ⇒ Object
69 70 71 |
# File 'lib/language_server/protocol/interface/inlay_hint_label_part.rb', line 69 def to_hash attributes end |
#to_json(*args) ⇒ Object
73 74 75 |
# File 'lib/language_server/protocol/interface/inlay_hint_label_part.rb', line 73 def to_json(*args) to_hash.to_json(*args) end |
#tooltip ⇒ string | MarkupContent
The tooltip text when you hover over this label part. Depending on the client capability ‘inlayHint.resolveSupport` clients might resolve this property late using the resolve request.
34 35 36 |
# File 'lib/language_server/protocol/interface/inlay_hint_label_part.rb', line 34 def tooltip attributes.fetch(:tooltip) end |
#value ⇒ string
The value of this label part.
24 25 26 |
# File 'lib/language_server/protocol/interface/inlay_hint_label_part.rb', line 24 def value attributes.fetch(:value) end |