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
Instance Method Summary collapse
-
#description ⇒ string | nil
An optional string which is rendered less prominently after CompletionItem.detail.
-
#detail ⇒ string | nil
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.
10 11 12 13 14 15 16 17 |
# File 'lib/language_server/protocol/interface/completion_item_label_details.rb', line 10 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)
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 | nil
An optional string which is rendered less prominently after CompletionItem.detail. Should be used for fully qualified names and file paths.
33 34 35 |
# File 'lib/language_server/protocol/interface/completion_item_label_details.rb', line 33 def description attributes.fetch(:description) end |
#detail ⇒ string | nil
An optional string which is rendered less prominently directly after CompletionItem.label label, without any spacing. Should be used for function signatures and type annotations.
24 25 26 |
# File 'lib/language_server/protocol/interface/completion_item_label_details.rb', line 24 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 |