diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-06-29 15:27:38 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-06-29 15:27:38 +0800 |
commit | f0bfb047bfb81b6f11400939ad736b7267e08938 (patch) | |
tree | 2b4d706f82485164363987bc9740d0ebd92787f8 /server/src/emmy | |
parent | 4586d62c06751d99199044375393dc1595375491 (diff) | |
download | lua-language-server-f0bfb047bfb81b6f11400939ad736b7267e08938.zip |
emmyfunction 支持多返回值
Diffstat (limited to 'server/src/emmy')
-rw-r--r-- | server/src/emmy/funcType.lua | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/server/src/emmy/funcType.lua b/server/src/emmy/funcType.lua index f467f763..2c073fe2 100644 --- a/server/src/emmy/funcType.lua +++ b/server/src/emmy/funcType.lua @@ -30,7 +30,7 @@ function mt:addParam(name, type) end function mt:addReturn(type) - self._return = type + self._returns[#self._returns+1] = type end function mt:eachParam(callback) @@ -39,8 +39,10 @@ function mt:eachParam(callback) end end -function mt:getReturn() - return self._return +function mt:eachReturn(callback) + for _, rtn in ipairs(self._returns) do + callback(rtn) + end end function mt:bindFunction(func) @@ -55,6 +57,7 @@ return function (manager, source) local self = setmetatable({ source = source.id, _params = {}, + _returns = {}, _manager = manager, }, mt) return self |