summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
Diffstat (limited to 'server/src')
-rw-r--r--server/src/core/definition.lua5
-rw-r--r--server/src/vm/value.lua30
2 files changed, 11 insertions, 24 deletions
diff --git a/server/src/core/definition.lua b/server/src/core/definition.lua
index 27c6f8eb..abf0b3f6 100644
--- a/server/src/core/definition.lua
+++ b/server/src/core/definition.lua
@@ -95,13 +95,14 @@ end
local function parseLocal(vm, source, lsp)
local loc = source:bindLocal()
local value = source:bindValue()
- if value.uri ~= vm.uri then
+ if value.uri ~= '' and value.uri ~= vm.uri then
return parseValueCrossFile(vm, source, lsp)
end
local positions = {}
positions[#positions+1] = {
loc:getSource().start,
loc:getSource().finish,
+ loc:getSource():getUri(),
}
if #positions == 0 then
return nil
@@ -111,7 +112,7 @@ end
local function parseValue(vm, source, lsp)
local value = source:bindValue()
- if value.uri ~= vm.uri then
+ if value.uri ~= '' and value.uri ~= vm.uri then
return parseValueCrossFile(vm, source, lsp)
end
local positions = {}
diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua
index 06a7ba30..c4336ad4 100644
--- a/server/src/vm/value.lua
+++ b/server/src/vm/value.lua
@@ -97,13 +97,13 @@ function mt:rawSet(index, value, source)
end
if self._child[index] then
self._child[index]:mergeValue(value)
- self._child[index] = value
+ --self._child[index] = value
else
self._child[index] = value
end
- self:addInfo('set child', source, index, value)
+ self:addInfo('set child', source, index, self._child[index])
if self._global then
- value:markGlobal()
+ self._child[index]:markGlobal()
end
end
@@ -266,26 +266,12 @@ function mt:mergeValue(value)
--end
--value._child = self._child
- if self._infoCount > value._infoCount then
- for srcId, info in pairs(value._info) do
- local src = sourceMgr.list[srcId]
- if src and not self._info[srcId] then
- self._infoCount = self._infoCount + 1
- self._info[srcId] = info
- end
- end
- value._info = self._info
- value._infoCount = self._infoCount
- else
- for srcId, info in pairs(self._info) do
- local src = sourceMgr.list[srcId]
- if src and not value._info[srcId] then
- value._infoCount = value._infoCount + 1
- value._info[srcId] = info
- end
+ for srcId, info in pairs(value._info) do
+ local src = sourceMgr.list[srcId]
+ if src and not self._info[srcId] then
+ self._infoCount = self._infoCount + 1
+ self._info[srcId] = info
end
- self._info = value._info
- self._infoCount = value._infoCount
end
if value._meta then