summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/hint.lua7
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