Class: LanguageServer::Protocol::Interface::CompletionItemLabelDetails
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::CompletionItemLabelDetails
- Defined in:
- lib/language_server/protocol/interface/completion_item_label_details.rb
Overview
Additional details for a completion item label.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#description ⇒ string
An optional string which is rendered less prominently after CompletionItemLabelDetails.detail.
-
#detail ⇒ string
An optional string which is rendered less prominently directly after CompletionItem.label label, without any spacing.
-
#initialize(detail: nil, description: nil) ⇒ CompletionItemLabelDetails
constructor
A new instance of CompletionItemLabelDetails.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(detail: nil, description: nil) ⇒ CompletionItemLabelDetails
Returns a new instance of CompletionItemLabelDetails.
8 9 10 11 12 13 14 15 |
# File 'lib/language_server/protocol/interface/completion_item_label_details.rb', line 8 def initialize(detail: nil, description: nil) @attributes = {} @attributes[:detail] = detail if detail @attributes[:description] = description if description @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
37 38 39 |
# File 'lib/language_server/protocol/interface/completion_item_label_details.rb', line 37 def attributes @attributes end |
Instance Method Details
#description ⇒ string
An optional string which is rendered less prominently after CompletionItemLabelDetails.detail. Should be used for fully qualified names or file path.
33 34 35 |
# File 'lib/language_server/protocol/interface/completion_item_label_details.rb', line 33 def description attributes.fetch(:description) end |
#detail ⇒ string
An optional string which is rendered less prominently directly after CompletionItem.label label, without any spacing. Should be used for function signatures or type annotations.
23 24 25 |
# File 'lib/language_server/protocol/interface/completion_item_label_details.rb', line 23 def detail attributes.fetch(:detail) end |
#to_hash ⇒ Object
39 40 41 |
# File 'lib/language_server/protocol/interface/completion_item_label_details.rb', line 39 def to_hash attributes end |
#to_json(*args) ⇒ Object
43 44 45 |
# File 'lib/language_server/protocol/interface/completion_item_label_details.rb', line 43 def to_json(*args) to_hash.to_json(*args) end |