summaryrefslogtreecommitdiff
path: root/server-beta/src/files.lua
diff options
context:
space:
mode:
Diffstat (limited to 'server-beta/src/files.lua')
-rw-r--r--server-beta/src/files.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/server-beta/src/files.lua b/server-beta/src/files.lua
index a3cf3e8e..076c491b 100644
--- a/server-beta/src/files.lua
+++ b/server-beta/src/files.lua
@@ -224,15 +224,19 @@ function m.findLinkTo(uri)
local result = {}
for _, file in pairs(m.fileMap) do
if file.links == nil then
- local ast = m.getAst(uri)
+ local ast = m.getAst(file.uri)
if ast then
file.links = searcher.getLinks(ast.ast)
else
file.links = false
end
end
- if file.links and file.links[uri] then
- result[#result+1] = file.uri
+ if file.links then
+ for linkUri in pairs(file.links) do
+ if m.eq(uri, linkUri) then
+ result[#result+1] = file.uri
+ end
+ end
end
end
return result