summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-25 19:30:47 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-25 19:30:47 +0800
commit9c1b6cd37da1224e6202c0e2849f97b22426fadc (patch)
treef0de28a87189c968d6ca33503e4b84f68ee1d12b /server
parentacf3e53057a29a94361b8406a98572d32828e366 (diff)
downloadlua-language-server-9c1b6cd37da1224e6202c0e2849f97b22426fadc.zip
修正在函数定义处可能无法搜索到所有引用的bug
Diffstat (limited to 'server')
-rw-r--r--server/src/vm/vm.lua5
-rw-r--r--server/test/references/init.lua6
2 files changed, 11 insertions, 0 deletions
diff --git a/server/src/vm/vm.lua b/server/src/vm/vm.lua
index 0f0de9fe..b5ffa459 100644
--- a/server/src/vm/vm.lua
+++ b/server/src/vm/vm.lua
@@ -926,9 +926,11 @@ function mt:doFunction(action)
if source.type == 'index' then
local index = self:getIndex(source)
parent:setChild(index, value, source[1])
+ parent:addInfo('set child', source, index)
elseif source.type == 'name' then
local index = source[1]
parent:setChild(index, value, source)
+ parent:addInfo('set child', source, index)
end
source:bindValue(value, 'set')
@@ -948,12 +950,15 @@ function mt:doFunction(action)
local value = self:buildFunction(action)
local source = name[#name]
self:instantSource(source)
+ source:set('parent', parent)
if source.type == 'index' then
local index = self:getIndex(source)
parent:setChild(index, value, source[1])
+ parent:addInfo('set child', source, index)
elseif source.type == 'name' then
local index = source[1]
parent:setChild(index, value, source)
+ parent:addInfo('set child', source, index)
end
source:bindValue(value, 'set')
end
diff --git a/server/test/references/init.lua b/server/test/references/init.lua
index 6a8b42db..c512ca5d 100644
--- a/server/test/references/init.lua
+++ b/server/test/references/init.lua
@@ -94,3 +94,9 @@ end
local <!f2!> = f()
]]
+
+TEST [[
+table.<!dump!>()
+function table.<?dump?>()
+end
+]]