summaryrefslogtreecommitdiff
path: root/server/src/core/definition.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-03-29 21:21:36 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-03-29 21:21:36 +0800
commit9b1f4fa3821250837206fca7f1a19751d53e9898 (patch)
tree3a4890b6db277fd9358dc1f98126db430d136dd2 /server/src/core/definition.lua
parent875e12a867b25f2f1cd0587c3f26d81378ac1310 (diff)
downloadlua-language-server-9b1f4fa3821250837206fca7f1a19751d53e9898.zip
如果无法跨文件搜索local的值定义,则退化为搜索本文件的变量定义
Diffstat (limited to 'server/src/core/definition.lua')
-rw-r--r--server/src/core/definition.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/src/core/definition.lua b/server/src/core/definition.lua
index 534d86db..fe8db860 100644
--- a/server/src/core/definition.lua
+++ b/server/src/core/definition.lua
@@ -89,7 +89,7 @@ local function parseValueCrossFile(vm, source, lsp)
return positions
end
- return positions
+ return nil
end
local function parseLocal(vm, source, lsp)
@@ -106,7 +106,10 @@ local function parseLocal(vm, source, lsp)
end
local value = source:bindValue()
if value and value.uri ~= '' and value.uri ~= vm.uri then
- return parseValueCrossFile(vm, source, lsp)
+ local positions = parseValueCrossFile(vm, source, lsp)
+ if #positions > 0 then
+ return positions
+ end
end
positions[#positions+1] = {
locSource.start,