From 2c5cfd138ace486e36960a018e39d1b9c52cabc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Wed, 19 Dec 2018 14:57:38 +0800 Subject: =?UTF-8?q?hover=E7=9A=84result=E5=9C=A8=E5=A4=96=E9=9D=A2?= =?UTF-8?q?=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/method/textDocument/hover.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'server/src/method/textDocument/hover.lua') 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 -- cgit v1.2.3