diff options
Diffstat (limited to 'server/src/method/textDocument/hover.lua')
-rw-r--r-- | server/src/method/textDocument/hover.lua | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/src/method/textDocument/hover.lua b/server/src/method/textDocument/hover.lua index ea15a32a..327f91f2 100644 --- a/server/src/method/textDocument/hover.lua +++ b/server/src/method/textDocument/hover.lua @@ -8,7 +8,13 @@ return function (lsp, params) end -- lua是从1开始的,因此都要+1 local position = lines:position(params.position.line + 1, params.position.character + 1) - local text = matcher.hover(vm, position) + + local result, source = matcher.findResult(vm, position) + if not result then + return nil + end + + local text = matcher.hover(vm, result, source) if not text then return nil end |