summaryrefslogtreecommitdiff
path: root/server/src/core
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-04-22 20:26:25 +0800
committersumneko <sumneko@hotmail.com>2019-04-22 20:26:25 +0800
commitc5795bf0220f0da45c7962862675edfc28ebb0f4 (patch)
tree706554dafc6d908747e313fe1b0f879d98ea1409 /server/src/core
parent747c94b9304b962ab58bc051e456cb8474374fdb (diff)
downloadlua-language-server-c5795bf0220f0da45c7962862675edfc28ebb0f4.zip
实在找不到结果时,退化为符号匹配
Diffstat (limited to 'server/src/core')
-rw-r--r--server/src/core/definition.lua18
1 files changed, 14 insertions, 4 deletions
diff --git a/server/src/core/definition.lua b/server/src/core/definition.lua
index f6440e81..f096fb99 100644
--- a/server/src/core/definition.lua
+++ b/server/src/core/definition.lua
@@ -13,10 +13,17 @@ local function parseValueSimily(callback, vm, source)
if other[1] == key
and not other:bindLocal()
and other:bindValue()
- and other:action() == 'set'
and source:bindValue() ~= other:bindValue()
then
- callback(other)
+ if Mode == 'definition' then
+ if other:action() == 'set' then
+ callback(other)
+ end
+ elseif Mode == 'reference' then
+ if other:action() == 'set' or other:action() == 'get' then
+ callback(other)
+ end
+ end
end
:: CONTINUE ::
end)
@@ -191,7 +198,6 @@ return function (vm, pos, mode)
end
if source:bindValue() then
isGlobal = parseValue(callback, vm, source)
- --parseValueSimily(callback, vm, source)
end
if source:bindLabel() then
parseLabel(callback, vm, source:bindLabel())
@@ -204,10 +210,14 @@ return function (vm, pos, mode)
end
if source:get 'in index' then
isGlobal = parseValue(callback, vm, source)
- --parseValueSimily(callback, vm, source)
end
if source:get 'target class' then
parseClass(callback, vm, source)
end
+
+ if #list == 0 then
+ parseValueSimily(callback, vm, source)
+ end
+
return list, isGlobal
end