summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server/src/core/definition.lua2
-rw-r--r--server/src/core/hover/hover.lua2
-rw-r--r--server/src/vm/value.lua4
3 files changed, 6 insertions, 2 deletions
diff --git a/server/src/core/definition.lua b/server/src/core/definition.lua
index 87bdc097..e240e614 100644
--- a/server/src/core/definition.lua
+++ b/server/src/core/definition.lua
@@ -95,7 +95,7 @@ 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 = {}
diff --git a/server/src/core/hover/hover.lua b/server/src/core/hover/hover.lua
index 7585e4ce..f09bfce4 100644
--- a/server/src/core/hover/hover.lua
+++ b/server/src/core/hover/hover.lua
@@ -71,7 +71,7 @@ local function unpackTable(value)
value:eachChild(function (key, child)
local kType = type(key)
if kType == 'table' then
- key = ('[*%s]'):format(child:getType())
+ key = ('[*%s]'):format(key:getType())
elseif math.type(key) == 'integer' then
key = ('[%03d]'):format(key)
elseif kType == 'string' then
diff --git a/server/src/vm/value.lua b/server/src/vm/value.lua
index 9fd1fdf1..c9e833d6 100644
--- a/server/src/vm/value.lua
+++ b/server/src/vm/value.lua
@@ -124,6 +124,10 @@ end
function mt:setChild(index, value, source)
self:setType('table', 0.5)
+ -- TODO 临时检测
+ if type(index) == 'table' and index.type ~= 'value' then
+ error('child index must be a value', table.dump(index))
+ end
self:rawSet(index, value, source)
return value
end