summaryrefslogtreecommitdiff
path: root/server/src/emmy
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-07-10 21:59:11 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-07-10 21:59:11 +0800
commita9335f9a6477d267928c62776f61fabcaa7bcc66 (patch)
treed7e25e273b5ec2d259f65843734175e330d44e4b /server/src/emmy
parentb6a99fe50a46812696848f0ad68bd4ef343dc9b3 (diff)
downloadlua-language-server-a9335f9a6477d267928c62776f61fabcaa7bcc66.zip
更新arrayType语法
Diffstat (limited to 'server/src/emmy')
-rw-r--r--server/src/emmy/arrayType.lua7
-rw-r--r--server/src/emmy/manager.lua10
2 files changed, 7 insertions, 10 deletions
diff --git a/server/src/emmy/arrayType.lua b/server/src/emmy/arrayType.lua
index 3c6a7b7b..c5d73500 100644
--- a/server/src/emmy/arrayType.lua
+++ b/server/src/emmy/arrayType.lua
@@ -19,17 +19,18 @@ end
function mt:setValue(value)
self.value = value
- self:getSource():get('emmy.typeUnit'):setValue(value)
+ self._child:setValue(value)
end
function mt:getValue()
return self.value
end
-return function (manager, source)
+return function (manager, source, child)
local self = setmetatable({
- name = source[1],
+ name = child:getName(),
source = source.id,
+ _child = child,
_manager = manager,
}, mt)
return self
diff --git a/server/src/emmy/manager.lua b/server/src/emmy/manager.lua
index 9b6978b9..fc7180bd 100644
--- a/server/src/emmy/manager.lua
+++ b/server/src/emmy/manager.lua
@@ -110,13 +110,9 @@ function mt:addType(source)
end
function mt:addArrayType(source)
- local typeObj = newArrayType(self, source)
- local typeUnit = newTypeUnit(self, source)
- local list = self:getClass(source[1])
- typeUnit:setParent(typeObj)
- list[source.id] = typeUnit
- source:set('emmy.typeUnit', typeUnit)
- return typeObj
+ local typeObj = self:addType(source)
+ local arrayTypeObj = newArrayType(self, source, typeObj)
+ return arrayTypeObj
end
function mt:addTableType(source, keyType, valueType)