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 | [number, number]
The label of this parameter information.
- #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.
42 43 44 |
# File 'lib/language_server/protocol/interface/parameter_information.rb', line 42 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.
38 39 40 |
# File 'lib/language_server/protocol/interface/parameter_information.rb', line 38 def documentation attributes.fetch(:documentation) end |
#label ⇒ string | [number, number]
The label of this parameter information.
Either a string or an inclusive start and exclusive end offsets within its containing signature label. (see SignatureInformation.label). The offsets are based on a UTF-16 string representation as ‘Position` and `Range` does.
Note: a label of type string should be a substring of its containing signature label. Its intended use case is to highlight the parameter label part in the ‘SignatureInformation.label`.
29 30 31 |
# File 'lib/language_server/protocol/interface/parameter_information.rb', line 29 def label attributes.fetch(:label) end |
#to_hash ⇒ Object
44 45 46 |
# File 'lib/language_server/protocol/interface/parameter_information.rb', line 44 def to_hash attributes end |
#to_json(*args) ⇒ Object
48 49 50 |
# File 'lib/language_server/protocol/interface/parameter_information.rb', line 48 def to_json(*args) to_hash.to_json(*args) end |