Class: Spoom::LSP::SignatureHelp
- Inherits:
-
T::Struct
- Object
- T::Struct
- Spoom::LSP::SignatureHelp
- Includes:
- PrintableSymbol
- Defined in:
- lib/spoom/sorbet/lsp/structures.rb
Class Method Summary collapse
-
.from_json(json) ⇒ Object
: (Hash[untyped, untyped] json) -> SignatureHelp.
Instance Method Summary collapse
-
#accept_printer(printer) ⇒ Object
: (SymbolPrinter printer) -> void.
-
#to_s ⇒ Object
: -> String.
Class Method Details
.from_json(json) ⇒ Object
: (Hash[untyped, untyped] json) -> SignatureHelp
144 145 146 147 148 149 150 |
# File 'lib/spoom/sorbet/lsp/structures.rb', line 144 def from_json(json) SignatureHelp.new( label: json["label"], doc: json["documentation"], params: json["parameters"], ) end |
Instance Method Details
#accept_printer(printer) ⇒ Object
: (SymbolPrinter printer) -> void
155 156 157 158 159 160 |
# File 'lib/spoom/sorbet/lsp/structures.rb', line 155 def accept_printer(printer) printer.print(label) printer.print("(") printer.print(params.map { |l| "#{l["label"]}: #{l["documentation"]}" }.join(", ")) printer.print(")") end |
#to_s ⇒ Object
: -> String
163 164 165 |
# File 'lib/spoom/sorbet/lsp/structures.rb', line 163 def to_s "#{label}(#{params})." end |