summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--script/core/searcher.lua6
-rw-r--r--test/crossfile/definition.lua24
2 files changed, 28 insertions, 2 deletions
diff --git a/script/core/searcher.lua b/script/core/searcher.lua
index 89bb35d3..feb42223 100644
--- a/script/core/searcher.lua
+++ b/script/core/searcher.lua
@@ -698,7 +698,8 @@ function m.searchRefsByID(status, suri, expect, mode)
end
local function checkBackward(uri, id, field)
- if ignoredIDs[id] then
+ if ignoredIDs[id]
+ or id == 'dn:string' then
return
end
if mode ~= 'ref' and mode ~= 'field' and mode ~= 'allref' and not field then
@@ -796,7 +797,8 @@ function m.searchRefsByID(status, suri, expect, mode)
local crossed = {}
if mode == 'def'
or mode == 'alldef'
- or ignoredIDs[id] then
+ or ignoredIDs[id]
+ or id == 'dn:string' then
for _, guri in ceach('def:' .. id) do
if uri == guri then
goto CONTINUE
diff --git a/test/crossfile/definition.lua b/test/crossfile/definition.lua
index d492761e..308c754f 100644
--- a/test/crossfile/definition.lua
+++ b/test/crossfile/definition.lua
@@ -805,3 +805,27 @@ print(b.<?test?>)
]]
}
}
+
+TEST {
+ {
+ path = 'a.lua',
+ content = [[
+---@class A
+local t
+
+t.<!a!> = 1
+ ]]
+ },
+ {
+ path = 'b.lua',
+ content = [[
+---@class B
+local t
+
+---@type A
+t.x = nil
+
+print(t.x.<?a?>)
+ ]]
+ }
+}