summaryrefslogtreecommitdiff
path: root/server/src
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2019-05-07 20:45:28 +0800
committersumneko <sumneko@hotmail.com>2019-05-07 20:45:28 +0800
commitd3d520cdb9aa4e30d70ae7bfdf4c939312fc2171 (patch)
treebadb6dc56b2ad013ede1d52ca54b4c486877199e /server/src
parent47147c5a8affbc0b9bb027da5fcb95c50d3b37bf (diff)
downloadlua-language-server-d3d520cdb9aa4e30d70ae7bfdf4c939312fc2171.zip
优化定义
Diffstat (limited to 'server/src')
-rw-r--r--server/src/core/definition.lua11
1 files changed, 10 insertions, 1 deletions
diff --git a/server/src/core/definition.lua b/server/src/core/definition.lua
index c2a29dae..c8b0d116 100644
--- a/server/src/core/definition.lua
+++ b/server/src/core/definition.lua
@@ -56,13 +56,22 @@ local function parseValueByValue(callback, vm, source, value)
for _ = 1, 5 do
value:eachInfo(function (info, src)
if Mode == 'definition' then
- if info.type == 'set' or info.type == 'local' then
+ if info.type == 'local' then
if vm.uri == src:getUri() then
if source.id >= src.id then
callback(src)
end
end
end
+ if info.type == 'set' then
+ if vm.uri == src:getUri() then
+ if source.id >= src.id then
+ callback(src)
+ end
+ else
+ callback(src)
+ end
+ end
if info.type == 'return' then
if (src.type ~= 'simple' or src[#src].type == 'call')
and src.type ~= 'name'