diff options
author | sumneko <sumneko@hotmail.com> | 2019-04-24 19:22:59 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-04-24 19:22:59 +0800 |
commit | db2de7238fb92269b7ad6aca8a35f82e01eaa126 (patch) | |
tree | 143dbf9e6b5f28db1c20585b36ba959fcaf890b0 /server/src/vm/emmy.lua | |
parent | aea74ee33de825921500c3210a65a10ef3c8a8e0 (diff) | |
download | lua-language-server-db2de7238fb92269b7ad6aca8a35f82e01eaa126.zip |
emmy.alias
Diffstat (limited to 'server/src/vm/emmy.lua')
-rw-r--r-- | server/src/vm/emmy.lua | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/server/src/vm/emmy.lua b/server/src/vm/emmy.lua index 1cd52a8a..a2a38553 100644 --- a/server/src/vm/emmy.lua +++ b/server/src/vm/emmy.lua @@ -11,6 +11,7 @@ function mt:doEmmy(action) elseif tp == 'emmyType' then self:doEmmyType(action) elseif tp == 'emmyAlias' then + self:doEmmyAlias(action) elseif tp == 'emmyParam' then elseif tp == 'emmyReturn' then elseif tp == 'emmyField' then @@ -65,6 +66,21 @@ function mt:doEmmyType(action) if self.lsp then self.lsp.global:markGet(self:getUri()) end + return type +end + +function mt:doEmmyAlias(action) + ---@type emmyMgr + local emmyMgr = self.emmyMgr + self:instantSource(action) + self:instantSource(action[1]) + local type = self:doEmmyType(action[2]) + local alias = emmyMgr:addAlias(action, type) + action:set('emmy.alias', alias) + action[1]:set('target class', alias:getName()) + if self.lsp then + self.lsp.global:markSet(self:getUri()) + end end function mt:doEmmyIncomplete(action) |