summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-02-01 16:00:15 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-02-01 16:00:15 +0800
commit72f18d0fb52ff5878549bf8e1d2be9c4ebf93340 (patch)
treeed880848c80e2e563a7f8d09265a038036b6ba27 /script
parent988266b411f82a5cd2c5534e9f8a68fe0867291b (diff)
downloadlua-language-server-72f18d0fb52ff5878549bf8e1d2be9c4ebf93340.zip
clean up code
Diffstat (limited to 'script')
-rw-r--r--script/core/hint.lua6
1 files changed, 1 insertions, 5 deletions
diff --git a/script/core/hint.lua b/script/core/hint.lua
index f1aea66c..f592bd77 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
@@ -33,9 +32,6 @@ local function typeHint(uri, edits, start, finish)
return
end
end
- if source.value and guide.isLiteral(source.value) then
- return
- end
local infer = vm.getInferType(source, 0)
if infer == 'any'
or infer == 'nil' then