summaryrefslogtreecommitdiff
path: root/server/src/emmy
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-06-26 20:52:59 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-06-26 20:52:59 +0800
commiteb4cc1e5915a2ac0fceaa4f6b08f7f0f762d3fb6 (patch)
tree82ef5a990f3b43b51d03785558398a97ba3aa46f /server/src/emmy
parentf92a71db462b2769eea194143f15ab090b665862 (diff)
downloadlua-language-server-eb4cc1e5915a2ac0fceaa4f6b08f7f0f762d3fb6.zip
用option来实现一些私有功能
Diffstat (limited to 'server/src/emmy')
-rw-r--r--server/src/emmy/manager.lua1
-rw-r--r--server/src/emmy/param.lua8
2 files changed, 9 insertions, 0 deletions
diff --git a/server/src/emmy/manager.lua b/server/src/emmy/manager.lua
index 11aa899c..1be0be94 100644
--- a/server/src/emmy/manager.lua
+++ b/server/src/emmy/manager.lua
@@ -158,6 +158,7 @@ function mt:addParam(source, bind)
for i = 3, #source do
paramObj:addEnum(source[i][1])
end
+ paramObj:setOption(source.option)
return paramObj
end
diff --git a/server/src/emmy/param.lua b/server/src/emmy/param.lua
index 290ab6e4..6fd41d5a 100644
--- a/server/src/emmy/param.lua
+++ b/server/src/emmy/param.lua
@@ -47,6 +47,14 @@ function mt:eachEnum(callback)
end
end
+function mt:setOption(option)
+ self._option = option
+end
+
+function mt:getOption()
+ return self._option
+end
+
return function (manager, source)
local self = setmetatable({
source = source.id,