Skip to content

Commit

Permalink
#372 wrong submission
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Feb 2, 2021
1 parent c1401e4 commit c33747e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions script/core/hint.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c33747e

Please sign in to comment.