Class: LanguageServer::Protocol::Interface::SignatureInformation
- Inherits:
-
Object
- Object
- LanguageServer::Protocol::Interface::SignatureInformation
- Defined in:
- lib/language_server/protocol/interface/signature_information.rb
Overview
Represents the signature of something callable. A signature can have a label, like a function-name, a doc-comment, and a set of parameters.
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 signature.
-
#initialize(label:, documentation: nil, parameters: nil) ⇒ SignatureInformation
constructor
A new instance of SignatureInformation.
-
#label ⇒ string
The label of this signature.
-
#parameters ⇒ ParameterInformation[]
The parameters of this signature.
- #to_hash ⇒ Object
- #to_json(*args) ⇒ Object
Constructor Details
#initialize(label:, documentation: nil, parameters: nil) ⇒ SignatureInformation
Returns a new instance of SignatureInformation.
10 11 12 13 14 15 16 17 18 |
# File 'lib/language_server/protocol/interface/signature_information.rb', line 10 def initialize(label:, documentation: nil, parameters: nil) @attributes = {} @attributes[:label] = label @attributes[:documentation] = documentation if documentation @attributes[:parameters] = parameters if parameters @attributes.freeze end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
46 47 48 |
# File 'lib/language_server/protocol/interface/signature_information.rb', line 46 def attributes @attributes end |
Instance Method Details
#documentation ⇒ string | MarkupContent
The human-readable doc-comment of this signature. Will be shown in the UI but can be omitted.
34 35 36 |
# File 'lib/language_server/protocol/interface/signature_information.rb', line 34 def documentation attributes.fetch(:documentation) end |
#label ⇒ string
The label of this signature. Will be shown in the UI.
25 26 27 |
# File 'lib/language_server/protocol/interface/signature_information.rb', line 25 def label attributes.fetch(:label) end |
#parameters ⇒ ParameterInformation[]
The parameters of this signature.
42 43 44 |
# File 'lib/language_server/protocol/interface/signature_information.rb', line 42 def parameters attributes.fetch(:parameters) end |
#to_hash ⇒ Object
48 49 50 |
# File 'lib/language_server/protocol/interface/signature_information.rb', line 48 def to_hash attributes end |
#to_json(*args) ⇒ Object
52 53 54 |
# File 'lib/language_server/protocol/interface/signature_information.rb', line 52 def to_json(*args) to_hash.to_json(*args) end |