summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2023-07-21 15:21:37 +0800
committer最萌小汐 <sumneko@hotmail.com>2023-07-21 15:21:37 +0800
commitf074686c59f033566b3fb44aa3f73d1a2ec0e7ed (patch)
treeb26280529d29ab54ee6eed8af3f79dbc2eb8407d /script/core
parent7c636357622b7b20e9729c902b5682a05995b911 (diff)
downloadlua-language-server-f074686c59f033566b3fb44aa3f73d1a2ec0e7ed.zip
fix `missing-fields`
Diffstat (limited to 'script/core')
-rw-r--r--script/core/diagnostics/missing-fields.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/script/core/diagnostics/missing-fields.lua b/script/core/diagnostics/missing-fields.lua
index 4b65172c..05b4f760 100644
--- a/script/core/diagnostics/missing-fields.lua
+++ b/script/core/diagnostics/missing-fields.lua
@@ -17,6 +17,7 @@ return function (uri, callback)
local defs = vm.getDefs(src)
local requiresKeys = {}
+ local isClass = false
for _, def in ipairs(defs) do
if def.type == 'doc.class' then
if not def.fields then
@@ -24,7 +25,8 @@ return function (uri, callback)
end
if def.bindSource then
if guide.isInRange(def.bindSource, src.start) then
- goto continue
+ isClass = true
+ break
end
end
for _, field in ipairs(def.fields) do
@@ -41,7 +43,7 @@ return function (uri, callback)
::continue::
end
- if #requiresKeys == 0 then
+ if #requiresKeys == 0 or isClass then
return
end