diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/src/matcher/hover.lua | 10 | ||||
-rw-r--r-- | server/src/method/textDocument/hover.lua | 2 |
2 files changed, 4 insertions, 8 deletions
diff --git a/server/src/matcher/hover.lua b/server/src/matcher/hover.lua index 9faa426b..12d599b3 100644 --- a/server/src/matcher/hover.lua +++ b/server/src/matcher/hover.lua @@ -160,17 +160,13 @@ local function buildTableHover(lib, fullKey) ]]):format(title, tip, field) end -return function (results, pos) - local result = findResult(results, pos) +return function (vm, pos) + local result = findResult(vm.results, pos) if not result then return nil end - if result.type ~= 'var' then - return nil - end - local var = result.var - local lib, fullKey, oo = findLib(var) + local lib, fullKey, oo = findLib(result.object) if not lib then return nil end diff --git a/server/src/method/textDocument/hover.lua b/server/src/method/textDocument/hover.lua index 3233b34a..ea15a32a 100644 --- a/server/src/method/textDocument/hover.lua +++ b/server/src/method/textDocument/hover.lua @@ -8,7 +8,7 @@ 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.results, position) + local text = matcher.hover(vm, position) if not text then return nil end |