diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-08-09 17:47:56 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-08-09 17:47:56 +0800 |
commit | acd37caafa2b4e9fa673327e54c5f010fa37641f (patch) | |
tree | 7e0ac2eaf7fc9bc5460e9ce1342639f5ace60bd6 | |
parent | 2ecc421ba6ed49b4e2a640c424eb7581ccbc6ecf (diff) | |
download | lua-language-server-acd37caafa2b4e9fa673327e54c5f010fa37641f.zip |
`FIX` completion: can not find global fields
-rw-r--r-- | .vscode/launch.json | 2 | ||||
-rw-r--r-- | changelog.md | 3 | ||||
-rw-r--r-- | script/core/searcher.lua | 4 | ||||
-rw-r--r-- | test/crossfile/completion.lua | 17 |
4 files changed, 21 insertions, 5 deletions
diff --git a/.vscode/launch.json b/.vscode/launch.json index 513489bc..2655115d 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -24,7 +24,7 @@ "type": "lua", "request": "attach", "stopOnEntry": true, - "address": "127.0.0.1:11427", + "address": "127.0.0.1:11556", "outputCapture": [ ], "sourceMaps": [ diff --git a/changelog.md b/changelog.md index a2c8f5b1..e1f64cd5 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # changelog +## 2.3.6 +* `FIX` completion: can not find global fields + ## 2.3.5 `2021-8-9` * `CHG` improve memory usage diff --git a/script/core/searcher.lua b/script/core/searcher.lua index 9acc4e8e..0e8ce04c 100644 --- a/script/core/searcher.lua +++ b/script/core/searcher.lua @@ -763,7 +763,6 @@ function m.searchRefsByID(status, suri, expect, mode) local crossed = {} if mode == 'def' or mode == 'alldef' - or mode == 'field' or field then for _, guri in ceach('def:' .. id) do if uri == guri then @@ -777,9 +776,6 @@ function m.searchRefsByID(status, suri, expect, mode) if crossed[guri] then goto CONTINUE end - if mode == 'def' or mode == 'alldef' or mode == 'field' then - goto CONTINUE - end if uri == guri then goto CONTINUE end diff --git a/test/crossfile/completion.lua b/test/crossfile/completion.lua index 3abc1de4..84d31544 100644 --- a/test/crossfile/completion.lua +++ b/test/crossfile/completion.lua @@ -767,3 +767,20 @@ function (a: any, b: any) Cared['detail'] = nil Cared['additionalTextEdits'] = nil end + +TEST { + { + path = 'a.lua', + content = [[ + A.B = 1 + ]] + }, + { + path = 'main.lua', + main = true, + content = [[ + A.$ + ]], + }, + completion = EXISTS, +} |