Class: TypeProf::LSP::Message::TextDocument::Hover
- Inherits:
-
TypeProf::LSP::Message
- Object
- TypeProf::LSP::Message
- TypeProf::LSP::Message::TextDocument::Hover
- Defined in:
- lib/typeprof/lsp/messages.rb
Constant Summary collapse
- METHOD =
request
"textDocument/hover"
Constants inherited from TypeProf::LSP::Message
Classes, TypeProf::LSP::Message::Table
Instance Method Summary collapse
Methods inherited from TypeProf::LSP::Message
build_table, find, inherited, #initialize, #log, #notify, #respond, #respond_error
Constructor Details
This class inherits a constructor from TypeProf::LSP::Message
Instance Method Details
#run ⇒ Object
254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 |
# File 'lib/typeprof/lsp/messages.rb', line 254 def run @params => { textDocument: { uri: }, position: pos, } text = @server.open_texts[uri] unless text respond(nil) return end str = @server.core.hover(text.path, TypeProf::CodePosition.from_lsp(pos)) if str respond(contents: { language: "ruby", value: str }) else respond(nil) end end |