diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-11-05 22:19:21 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-11-05 22:19:21 +0800 |
commit | 385235cd95b8a23356c8947912c9426cef37c61f (patch) | |
tree | 139a586389d29de8a8fdf7b4b35d3779609bfc21 /script/parser/luadoc.lua | |
parent | b870bc090ce17747de961a713fc6333d2e6d401f (diff) | |
download | lua-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.lua | 7 |
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) |