diff options
author | sumneko <sumneko@hotmail.com> | 2019-04-22 20:26:25 +0800 |
---|---|---|
committer | sumneko <sumneko@hotmail.com> | 2019-04-22 20:26:25 +0800 |
commit | c5795bf0220f0da45c7962862675edfc28ebb0f4 (patch) | |
tree | 706554dafc6d908747e313fe1b0f879d98ea1409 /server/src/core | |
parent | 747c94b9304b962ab58bc051e456cb8474374fdb (diff) | |
download | lua-language-server-c5795bf0220f0da45c7962862675edfc28ebb0f4.zip |
实在找不到结果时,退化为符号匹配
Diffstat (limited to 'server/src/core')
-rw-r--r-- | server/src/core/definition.lua | 18 |
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 |