diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-02-02 21:56:55 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-02-02 21:56:55 +0800 |
commit | c33747ecdb348a77294e717a88a8b75d0a06ba33 (patch) | |
tree | 8aac85666a952fd829c5e098625fb13b1030bd2f /script/core | |
parent | c1401e4b32a7cf2e9d8e902f562369d255814998 (diff) | |
download | lua-language-server-c33747ecdb348a77294e717a88a8b75d0a06ba33.zip |
#372 wrong submission
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/hint.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/script/core/hint.lua b/script/core/hint.lua index 85aac77d..df191b9c 100644 --- a/script/core/hint.lua +++ b/script/core/hint.lua @@ -20,8 +20,7 @@ local function typeHint(uri, edits, start, finish) if source[1] == '_' then return end - -- 排除掉 xx = function 与 xx = {} - if source.value and (source.value.type == 'function' or source.value.type == 'table') then + if source.value and guide.isLiteral(source.value) then return end if source.parent.type == 'funcargs' then @@ -34,6 +33,10 @@ local function typeHint(uri, edits, start, finish) end end local infer = vm.getInferType(source, 0) + if infer == 'any' + or infer == 'nil' then + return + end local src = source if source.type == 'tablefield' then src = source.field |