diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-12-30 15:23:56 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-12-30 15:23:56 +0800 |
commit | 789cb1598a53c615164a5df7a1c4056f7d4130eb (patch) | |
tree | 34325579c5d4c9c7e2261b332fca2e4d8aa13381 | |
parent | 38a2f5ae4e7e5a5ba48289db6a2972e15d3d53cf (diff) | |
download | lua-language-server-789cb1598a53c615164a5df7a1c4056f7d4130eb.zip |
fix
-rw-r--r-- | script/core/searcher.lua | 12 | ||||
-rw-r--r-- | test/completion/init.lua | 2 | ||||
-rw-r--r-- | test/crossfile/completion.lua | 1 |
3 files changed, 7 insertions, 8 deletions
diff --git a/script/core/searcher.lua b/script/core/searcher.lua index 8e4873aa..68852062 100644 --- a/script/core/searcher.lua +++ b/script/core/searcher.lua @@ -820,7 +820,7 @@ function m.searchRefsByID(status, suri, expect, mode) or mode == 'alldef' or field or hasCall(field) then - for _, guri in ceach(uri, 'def:' .. id) do + for _, guri in ceach(suri, 'def:' .. id) do if uri == guri then goto CONTINUE end @@ -829,14 +829,14 @@ function m.searchRefsByID(status, suri, expect, mode) end elseif mode == 'field' or mode == 'allfield' then - for _, guri in ceach(uri, 'def:' .. id) do + for _, guri in ceach(suri, 'def:' .. id) do if uri == guri then goto CONTINUE end searchID(guri, id, field, uri) ::CONTINUE:: end - for _, guri in ceach(uri, 'field:' .. id) do + for _, guri in ceach(suri, 'field:' .. id) do if uri == guri then goto CONTINUE end @@ -844,7 +844,7 @@ function m.searchRefsByID(status, suri, expect, mode) ::CONTINUE:: end else - for _, guri in ceach(uri, id) do + for _, guri in ceach(suri, id) do if crossed[guri] then goto CONTINUE end @@ -872,7 +872,7 @@ function m.searchRefsByID(status, suri, expect, mode) or ignoredIDs[id] or id == 'dn:string' or hasCall(field) then - for _, guri in ceach(uri, 'def:' .. id) do + for _, guri in ceach(suri, 'def:' .. id) do if uri == guri then goto CONTINUE end @@ -880,7 +880,7 @@ function m.searchRefsByID(status, suri, expect, mode) ::CONTINUE:: end else - for _, guri in ceach(uri, id) do + for _, guri in ceach(suri, id) do if crossed[guri] then goto CONTINUE end diff --git a/test/completion/init.lua b/test/completion/init.lua index 1c485f63..89325883 100644 --- a/test/completion/init.lua +++ b/test/completion/init.lua @@ -76,7 +76,6 @@ function TEST(script) local triggerCharacter = script:sub(inputPos, inputPos) local result = core.completion('', inputPos, triggerCharacter) - files.remove('') if not expect then assert(result == nil) return @@ -116,6 +115,7 @@ function TEST(script) else assert(eq(expect, result)) end + files.remove('') end end diff --git a/test/crossfile/completion.lua b/test/crossfile/completion.lua index d286a24d..9926e342 100644 --- a/test/crossfile/completion.lua +++ b/test/crossfile/completion.lua @@ -103,7 +103,6 @@ function TEST(data) end local expect = data.completion - core.clearCache() local result = core.completion(mainUri, pos, '') if not expect then assert(result == nil) |