summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
Diffstat (limited to 'script/core')
-rw-r--r--script/core/noder.lua15
-rw-r--r--script/core/searcher.lua25
2 files changed, 29 insertions, 11 deletions
diff --git a/script/core/noder.lua b/script/core/noder.lua
index 102245d9..c2f2061a 100644
--- a/script/core/noder.lua
+++ b/script/core/noder.lua
@@ -1606,14 +1606,13 @@ function m.compileGlobalNodes(root)
m.compilePartNodes(noders, env)
local docs = root.docs
- for i = 1, #docs do
- local doc = docs[i]
- if doc.type == 'doc.class' then
- m.compileNode(noders, doc.class)
- elseif doc.type == 'doc.alias' then
- m.compileNode(noders, doc.alias)
- end
- end
+ guide.eachSourceTypes(docs, {
+ 'doc.class.name',
+ 'doc.alias.name',
+ 'doc.type.name',
+ }, function (doc)
+ m.compileNode(noders, doc)
+ end)
end
files.watch(function (ev, uri)
diff --git a/script/core/searcher.lua b/script/core/searcher.lua
index 0e8ce04c..89bb35d3 100644
--- a/script/core/searcher.lua
+++ b/script/core/searcher.lua
@@ -759,7 +759,7 @@ function m.searchRefsByID(status, suri, expect, mode)
if ssub(id, 1, 2) ~= 'g:' then
return
end
- footprint(status, 'checkGlobal:', id, field)
+ footprint(status, 'searchGlobal:', id, field)
local crossed = {}
if mode == 'def'
or mode == 'alldef'
@@ -792,9 +792,28 @@ function m.searchRefsByID(status, suri, expect, mode)
if ssub(id, 1, 3) ~= 'dn:' then
return
end
- for _, guri in ceach('def:' .. id) do
- if uri ~= guri then
+ footprint(status, 'searchClass:', id, field)
+ local crossed = {}
+ if mode == 'def'
+ or mode == 'alldef'
+ or ignoredIDs[id] then
+ for _, guri in ceach('def:' .. id) do
+ if uri == guri then
+ goto CONTINUE
+ end
searchID(guri, id, field, uri)
+ ::CONTINUE::
+ end
+ else
+ for _, guri in ceach(id) do
+ if crossed[guri] then
+ goto CONTINUE
+ end
+ if uri == guri then
+ goto CONTINUE
+ end
+ searchID(guri, id, field, uri)
+ ::CONTINUE::
end
end
end