summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-02-26 18:03:33 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-02-26 18:03:33 +0800
commit510c8d897837d33f24023f0b9384763be88b7e1e (patch)
treef44120ce6c7e0558d0bb937281b72e7791ce3dd1
parent6de46624564d9bdf3d9c0f7614e5e5e399816ca6 (diff)
downloadlua-language-server-510c8d897837d33f24023f0b9384763be88b7e1e.zip
因为现在会按照代码执行顺序跑代码,因此不再允许向下寻找定义
-rw-r--r--server/src/vm/value.lua20
-rw-r--r--server/test/definition/table.lua6
2 files changed, 4 insertions, 22 deletions
diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua
index 0b163c3f..0f2a8193 100644
--- a/server/src/vm/value.lua
+++ b/server/src/vm/value.lua
@@ -167,15 +167,9 @@ function mt:mergeValue(value)
self._child[k] = v
end
end
- if value._info then
- if not self._info then
- self._info = {}
- end
- for _, info in ipairs(value._info) do
- self._info[#self._info+1] = info
- end
+ for _, info in ipairs(value) do
+ self[#self+1] = info
end
- value._info = self._info
if value._meta then
self._meta = value._meta
end
@@ -191,20 +185,14 @@ function mt:addInfo(tp, source)
if source and not source.start then
error('Miss start: ' .. table.dump(source))
end
- if not self._info then
- self._info = {}
- end
- self._info[#self._info+1] = {
+ self[#self+1] = {
type = tp,
source = source or getDefaultSource(),
}
end
function mt:eachInfo(callback)
- if not self._info then
- return
- end
- for _, info in ipairs(self._info) do
+ for _, info in ipairs(self) do
local res = callback(info)
if res ~= nil then
return res
diff --git a/server/test/definition/table.lua b/server/test/definition/table.lua
index 23af390d..bafa755c 100644
--- a/server/test/definition/table.lua
+++ b/server/test/definition/table.lua
@@ -90,12 +90,6 @@ t {
]]
TEST[[
-local t
-t.<?after?>()
-t.<!after!> = a
-]]
-
-TEST[[
local t = {
<!insert!> = 1,
}