Skip to content

Commit c33747e

Browse files
committed
#372 wrong submission
1 parent c1401e4 commit c33747e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: script/core/hint.lua

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ local function typeHint(uri, edits, start, finish)
2020
if source[1] == '_' then
2121
return
2222
end
23-
-- 排除掉 xx = function 与 xx = {}
24-
if source.value and (source.value.type == 'function' or source.value.type == 'table') then
23+
if source.value and guide.isLiteral(source.value) then
2524
return
2625
end
2726
if source.parent.type == 'funcargs' then
@@ -34,6 +33,10 @@ local function typeHint(uri, edits, start, finish)
3433
end
3534
end
3635
local infer = vm.getInferType(source, 0)
36+
if infer == 'any'
37+
or infer == 'nil' then
38+
return
39+
end
3740
local src = source
3841
if source.type == 'tablefield' then
3942
src = source.field

0 commit comments

Comments
 (0)