Class: Spoom::LSP::SignatureHelp
- Inherits:
-
T::Struct
- Object
- T::Struct
- Spoom::LSP::SignatureHelp
- Extended by:
- T::Sig
- Includes:
- PrintableSymbol
- Defined in:
- lib/spoom/sorbet/lsp/structures.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.from_json(json) ⇒ Object
126 127 128 129 130 131 132 |
# File 'lib/spoom/sorbet/lsp/structures.rb', line 126 def self.from_json(json) SignatureHelp.new( label: json['label'], doc: json['documentation'], params: json['parameters'], ) end |
Instance Method Details
#accept_printer(printer) ⇒ Object
135 136 137 138 139 140 |
# File 'lib/spoom/sorbet/lsp/structures.rb', line 135 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
142 143 144 |
# File 'lib/spoom/sorbet/lsp/structures.rb', line 142 def to_s "#{label}(#{params})." end |