summaryrefslogtreecommitdiff
path: root/script/parser/luadoc.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-11-05 22:19:21 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-11-05 22:19:21 +0800
commit385235cd95b8a23356c8947912c9426cef37c61f (patch)
tree139a586389d29de8a8fdf7b4b35d3779609bfc21 /script/parser/luadoc.lua
parentb870bc090ce17747de961a713fc6333d2e6d401f (diff)
downloadlua-language-server-385235cd95b8a23356c8947912c9426cef37c61f.zip
check parameter types of generic extends
resolve #1663
Diffstat (limited to 'script/parser/luadoc.lua')
-rw-r--r--script/parser/luadoc.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/script/parser/luadoc.lua b/script/parser/luadoc.lua
index 42564621..264c2535 100644
--- a/script/parser/luadoc.lua
+++ b/script/parser/luadoc.lua
@@ -152,6 +152,8 @@ Symbol <- ({} {
---@field visible? parser.visibleType
---@field operators? parser.object[]
---@field calls? parser.object[]
+---@field generics? parser.object[]
+---@field generic? parser.object
local function parseTokens(text, offset)
Ci = 0
@@ -1646,7 +1648,7 @@ local function bindGeneric(binded)
if doc.type == 'doc.generic' then
for _, obj in ipairs(doc.generics) do
local name = obj.generic[1]
- generics[name] = true
+ generics[name] = obj
end
end
if doc.type == 'doc.class'
@@ -1654,7 +1656,7 @@ local function bindGeneric(binded)
if doc.signs then
for _, sign in ipairs(doc.signs) do
local name = sign[1]
- generics[name] = true
+ generics[name] = sign
end
end
end
@@ -1668,6 +1670,7 @@ local function bindGeneric(binded)
local name = src[1]
if generics[name] then
src.type = 'doc.generic.name'
+ src.generic = generics[name]
end
end)
guide.eachSourceType(doc, 'doc.type.code', function (src)