summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.vscode/launch.json2
-rw-r--r--changelog.md3
-rw-r--r--script/core/searcher.lua4
-rw-r--r--test/crossfile/completion.lua17
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,
+}