summaryrefslogtreecommitdiff
path: root/script-beta/core/diagnostics/undefined-doc-name.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-10-23 16:56:01 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-10-23 16:56:01 +0800
commit71a394c07bf51a2c479e43fd9421c276f7ec4450 (patch)
treef4cc650bbb48c26b35b9aca0a9ed6768a1adfba3 /script-beta/core/diagnostics/undefined-doc-name.lua
parent5619f5aec549eb931c1c7727702afc89e6672ad9 (diff)
downloadlua-language-server-71a394c07bf51a2c479e43fd9421c276f7ec4450.zip
class 只能扩展 class,单独诊断
Diffstat (limited to 'script-beta/core/diagnostics/undefined-doc-name.lua')
-rw-r--r--script-beta/core/diagnostics/undefined-doc-name.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/script-beta/core/diagnostics/undefined-doc-name.lua b/script-beta/core/diagnostics/undefined-doc-name.lua
index bf885f6f..ba5e0a69 100644
--- a/script-beta/core/diagnostics/undefined-doc-name.lua
+++ b/script-beta/core/diagnostics/undefined-doc-name.lua
@@ -16,7 +16,11 @@ return function (uri, callback)
local cache = {}
guide.eachSource(state.ast.docs, function (source)
- if source.type:sub(-5) ~= '.name' then
+ if source.type ~= 'doc.extends.name'
+ and source.type ~= 'doc.type.name' then
+ return
+ end
+ if source.parent.type == 'doc.class' then
return
end
local name = source[1]