summaryrefslogtreecommitdiff
path: root/script/core/diagnostics/undefined-field.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-08 14:35:56 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-08 14:35:56 +0800
commit67a341f3fa26e5a3140cde3420ef2269a84d478f (patch)
tree8c747faa574055b7dfe2a22ef3a8176100b90980 /script/core/diagnostics/undefined-field.lua
parent0b898555f495b80f278fec01d2f3e6ec83b4952c (diff)
downloadlua-language-server-67a341f3fa26e5a3140cde3420ef2269a84d478f.zip
cleanup
Diffstat (limited to 'script/core/diagnostics/undefined-field.lua')
-rw-r--r--script/core/diagnostics/undefined-field.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/script/core/diagnostics/undefined-field.lua b/script/core/diagnostics/undefined-field.lua
index fac9607d..025c217a 100644
--- a/script/core/diagnostics/undefined-field.lua
+++ b/script/core/diagnostics/undefined-field.lua
@@ -3,6 +3,7 @@ local vm = require 'vm'
local lang = require 'language'
local guide = require 'parser.guide'
local await = require 'await'
+local infer = require 'vm.infer'
local skipCheckClass = {
['unknown'] = true,
@@ -33,11 +34,9 @@ return function (uri, callback)
end
local node = src.node
if node then
- local defs = vm.getDefs(node)
local ok
- for _, def in ipairs(defs) do
- if def.type == 'doc.class'
- and not skipCheckClass[def.class[1]] then
+ for view in infer.getInfer(node):eachView() do
+ if not skipCheckClass[view] then
ok = true
break
end