summaryrefslogtreecommitdiff
path: root/server/src/vm/emmy.lua
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-29 20:22:14 +0800
committersumneko <sumneko@hotmail.com>2019-04-29 20:22:14 +0800
commiteec1da3f170a0fc90844860f0c877e38765466b1 (patch)
tree35821229794dd6923c4803db64775154b3e9c714 /server/src/vm/emmy.lua
parent9a1b32c07764bfa441d184d97ae90d271bfb9012 (diff)
downloadlua-language-server-eec1da3f170a0fc90844860f0c877e38765466b1.zip
emmy.vararg
Diffstat (limited to 'server/src/vm/emmy.lua')
-rw-r--r--server/src/vm/emmy.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/server/src/vm/emmy.lua b/server/src/vm/emmy.lua
index 500c4711..1dd67d7d 100644
--- a/server/src/vm/emmy.lua
+++ b/server/src/vm/emmy.lua
@@ -24,6 +24,7 @@ function mt:doEmmy(action)
elseif tp == 'emmyGeneric' then
self:doEmmyGeneric(action)
elseif tp == 'emmyVararg' then
+ self:doEmmyVararg(action)
elseif tp == 'emmyLanguage' then
elseif tp == 'emmyArrayType' then
elseif tp == 'emmyTableType' then
@@ -209,6 +210,19 @@ function mt:doEmmyGeneric(action)
self._emmyGeneric = generic
end
+function mt:doEmmyVararg(action)
+ ---@type emmyMgr
+ local emmyMgr = self.emmyMgr
+ self:instantSource(action)
+ local type = self:getGenericByType(action[1]) or self:buildEmmyType(action[1])
+ local param = emmyMgr:addParam(action, type)
+ action:set('emmy.param', param)
+ self:addEmmyParam(param)
+ if self.lsp then
+ self.lsp.global:markGet(self:getUri())
+ end
+end
+
function mt:doEmmyIncomplete(action)
self:instantSource(action)
end