summaryrefslogtreecommitdiff
path: root/script-beta/core/hover/table.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-09-28 01:25:24 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-09-28 01:25:24 +0800
commit3252e1f4820bbbe6568c3be09fd6fa6dc436adde (patch)
treed738b45188f5e4562f3b5e0bd68f891d1ee7b851 /script-beta/core/hover/table.lua
parenta1b4ef2fe432f5f52aa26c2687b068b012b163d3 (diff)
downloadlua-language-server-3252e1f4820bbbe6568c3be09fd6fa6dc436adde.zip
修正一些bug
Diffstat (limited to 'script-beta/core/hover/table.lua')
-rw-r--r--script-beta/core/hover/table.lua17
1 files changed, 12 insertions, 5 deletions
diff --git a/script-beta/core/hover/table.lua b/script-beta/core/hover/table.lua
index 7b53979a..812a69be 100644
--- a/script-beta/core/hover/table.lua
+++ b/script-beta/core/hover/table.lua
@@ -3,6 +3,11 @@ local util = require 'utility'
local guide = require 'parser.guide'
local function getKey(src)
+ if src.type == 'library' then
+ if src.name:sub(1, 1) == '@' then
+ return
+ end
+ end
local key = vm.getKeyName(src)
if not key or #key <= 2 then
if not src.index then
@@ -35,11 +40,13 @@ local function getField(src)
or src.type == 'function' then
return nil
end
- if src.parent.type == 'tableindex'
- or src.parent.type == 'setindex'
- or src.parent.type == 'getindex' then
- if src.parent.index == src then
- src = src.parent
+ if src.parent then
+ if src.parent.type == 'tableindex'
+ or src.parent.type == 'setindex'
+ or src.parent.type == 'getindex' then
+ if src.parent.index == src then
+ src = src.parent
+ end
end
end
local tp = vm.getInferType(src, 'simple')