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/vm/sign.lua | |
parent | b870bc090ce17747de961a713fc6333d2e6d401f (diff) | |
download | lua-language-server-385235cd95b8a23356c8947912c9426cef37c61f.zip |
check parameter types of generic extends
resolve #1663
Diffstat (limited to 'script/vm/sign.lua')
-rw-r--r-- | script/vm/sign.lua | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/script/vm/sign.lua b/script/vm/sign.lua index 3791ca4f..3fc9f981 100644 --- a/script/vm/sign.lua +++ b/script/vm/sign.lua @@ -3,8 +3,9 @@ local guide = require 'parser.guide' local vm = require 'vm.vm' ---@class vm.sign ----@field parent parser.object ----@field signList vm.node[] +---@field parent parser.object +---@field signList vm.node[] +---@field docGenric parser.object[] local mt = {} mt.__index = mt mt.type = 'sign' @@ -14,11 +15,15 @@ function mt:addSign(node) self.signList[#self.signList+1] = node end +---@param doc parser.object +function mt:addDocGeneric(doc) + self.docGenric[#self.docGenric+1] = doc +end + ---@param uri uri ---@param args parser.object ----@param removeGeneric true? ---@return table<string, vm.node>? -function mt:resolve(uri, args, removeGeneric) +function mt:resolve(uri, args) if not args then return nil end @@ -256,7 +261,8 @@ end ---@return vm.sign function vm.createSign() local genericMgr = setmetatable({ - signList = {}, + signList = {}, + docGenric = {}, }, mt) return genericMgr end @@ -285,8 +291,8 @@ function vm.getSign(source) if doc.type == 'doc.generic' then if not source._sign then source._sign = vm.createSign() - break end + source._sign:addDocGeneric(doc) end end if not source._sign then |