diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-03-29 21:21:36 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-03-29 21:21:36 +0800 |
commit | 9b1f4fa3821250837206fca7f1a19751d53e9898 (patch) | |
tree | 3a4890b6db277fd9358dc1f98126db430d136dd2 /server/src/core/definition.lua | |
parent | 875e12a867b25f2f1cd0587c3f26d81378ac1310 (diff) | |
download | lua-language-server-9b1f4fa3821250837206fca7f1a19751d53e9898.zip |
如果无法跨文件搜索local的值定义,则退化为搜索本文件的变量定义
Diffstat (limited to 'server/src/core/definition.lua')
-rw-r--r-- | server/src/core/definition.lua | 7 |
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, |