Class: LanguageServer::Protocol::Interface::ParameterInformation
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::ParameterInformation
- Defined in:
- lib/language_server/protocol/interface/parameter_information.rb
Overview
Represents a parameter of a callable-signature. A parameter can have a label and a doc-comment.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#documentation ⇒ string | MarkupContent
The human-readable doc-comment of this parameter.
-
#initialize(label:, documentation: nil) ⇒ ParameterInformation
constructor
A new instance of ParameterInformation.
-
#label ⇒ string
The label of this parameter.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(label:, documentation: nil) ⇒ ParameterInformation
Returns a new instance of ParameterInformation.
9 10 11 12 13 14 15 16 |
# File 'lib/language_server/protocol/interface/parameter_information.rb', line 9 def initialize(label:, documentation: nil) @attributes = {} @attributes[:label] = label @attributes[:documentation] = documentation if documentation @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
36 37 38 |
# File 'lib/language_server/protocol/interface/parameter_information.rb', line 36 def attributes @attributes end |
Instance Method Details
#documentation ⇒ string | MarkupContent
The human-readable doc-comment of this parameter. Will be shown in the UI but can be omitted.
32 33 34 |
# File 'lib/language_server/protocol/interface/parameter_information.rb', line 32 def documentation attributes.fetch(:documentation) end |
#label ⇒ string
The label of this parameter. Will be shown in the UI.
23 24 25 |
# File 'lib/language_server/protocol/interface/parameter_information.rb', line 23 def label attributes.fetch(:label) end |
#to_hash ⇒ Object
38 39 40 |
# File 'lib/language_server/protocol/interface/parameter_information.rb', line 38 def to_hash attributes end |
#to_json(*args) ⇒ Object
42 43 44 |
# File 'lib/language_server/protocol/interface/parameter_information.rb', line 42 def to_json(*args) to_hash.to_json(*args) end |