diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-09-28 01:25:24 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-09-28 01:25:24 +0800 |
commit | 3252e1f4820bbbe6568c3be09fd6fa6dc436adde (patch) | |
tree | d738b45188f5e4562f3b5e0bd68f891d1ee7b851 /script-beta/core/hover/table.lua | |
parent | a1b4ef2fe432f5f52aa26c2687b068b012b163d3 (diff) | |
download | lua-language-server-3252e1f4820bbbe6568c3be09fd6fa6dc436adde.zip |
修正一些bug
Diffstat (limited to 'script-beta/core/hover/table.lua')
-rw-r--r-- | script-beta/core/hover/table.lua | 17 |
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') |