Class: TypeProf::LSP::Message::TextDocument::TypeDefinition
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
::TypeProf::LSP::Message
|
|
Instance Chain:
self,
::TypeProf::LSP::Message
|
|
Inherits: |
TypeProf::LSP::Message
|
Defined in: | lib/typeprof/lsp/messages.rb |
Constant Summary
-
METHOD =
request
"textDocument/typeDefinition"
::TypeProf::LSP::Message
- Inherited
Class Method Summary
::TypeProf::LSP::Message
- Inherited
Instance Method Summary
Constructor Details
This class inherits a constructor from TypeProf::LSP::Message
Instance Method Details
#run
[ GitHub ]# File 'lib/typeprof/lsp/messages.rb', line 202
def run @params => { textDocument: { uri: }, position: pos, } text = @server.open_texts[uri] unless text respond(nil) return end defs = @server.core.type_definitions(text.path, TypeProf::CodePosition.from_lsp(pos)) if defs.empty? respond(nil) else respond(defs.map do |path, code_range| { uri: @server.path_to_uri(path), range: code_range.to_lsp, } end) end end