summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfesily <fesil@foxmail.com>2024-02-23 15:08:21 +0800
committerfesily <fesil@foxmail.com>2024-02-23 15:08:21 +0800
commit37861881a9568f44143aeca6f08d7dd84c2344c6 (patch)
treea618492dccbbd73071c7b546b34db2a51bdbcd0b
parent27e0c1ec951bb3b980ce6cabb2d9b9a3b2dea609 (diff)
downloadlua-language-server-37861881a9568f44143aeca6f08d7dd84c2344c6.zip
fix warn
-rw-r--r--script/core/diagnostics/undefined-doc-name.lua13
-rw-r--r--script/parser/guide.lua2
2 files changed, 3 insertions, 12 deletions
diff --git a/script/core/diagnostics/undefined-doc-name.lua b/script/core/diagnostics/undefined-doc-name.lua
index 3c8ed469..1c55f3bf 100644
--- a/script/core/diagnostics/undefined-doc-name.lua
+++ b/script/core/diagnostics/undefined-doc-name.lua
@@ -13,16 +13,6 @@ return function (uri, callback)
return
end
- local function hasNameOfGeneric(name, source)
- if not source.typeGeneric then
- return false
- end
- if not source.typeGeneric[name] then
- return false
- end
- return true
- end
-
guide.eachSource(state.ast.docs, function (source)
if source.type ~= 'doc.extends.name'
and source.type ~= 'doc.type.name' then
@@ -35,8 +25,7 @@ return function (uri, callback)
if name == '...' or name == '_' or name == 'self' then
return
end
- if #vm.getDocSets(uri, name) > 0
- or hasNameOfGeneric(name, source) then
+ if #vm.getDocSets(uri, name) > 0 then
return
end
callback {
diff --git a/script/parser/guide.lua b/script/parser/guide.lua
index a2a0c232..ac7a5ce0 100644
--- a/script/parser/guide.lua
+++ b/script/parser/guide.lua
@@ -74,6 +74,8 @@ local type = type
---@field hasBreak? true
---@field hasExit? true
---@field [integer] parser.object|any
+---@field dot { type: string, start: integer, finish: integer }
+---@field colon { type: string, start: integer, finish: integer }
---@field package _root parser.object
---@field package _eachCache? parser.object[]
---@field package _isGlobal? boolean