summaryrefslogtreecommitdiff
path: root/server/src/emmy/alias.lua
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-05-06 20:03:02 +0800
committersumneko <sumneko@hotmail.com>2019-05-06 20:03:02 +0800
commitaa17d5ab935f3963b6a24edb77860dc4f622e31c (patch)
treedb5c8686f0b39501418b033f236322eaa831f040 /server/src/emmy/alias.lua
parentce0e466279ccd237ec8b3df5e7ed9275b166e1c7 (diff)
downloadlua-language-server-aa17d5ab935f3963b6a24edb77860dc4f622e31c.zip
alias支持字面量
Diffstat (limited to 'server/src/emmy/alias.lua')
-rw-r--r--server/src/emmy/alias.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/server/src/emmy/alias.lua b/server/src/emmy/alias.lua
index cec23b78..be47cb4f 100644
--- a/server/src/emmy/alias.lua
+++ b/server/src/emmy/alias.lua
@@ -21,11 +21,22 @@ function mt:bindType(type)
end
end
+function mt:addEnum(enum)
+ self._enum[#self._enum+1] = enum
+end
+
+function mt:eachEnum(callback)
+ for _, enum in ipairs(self._enum) do
+ callback(enum)
+ end
+end
+
return function (manager, source)
local self = setmetatable({
name = source[1][1],
source = source.id,
_manager = manager,
+ _enum = {},
}, mt)
return self
end