fix: log Antora resolution decisions to help diagnose empty content catalogs - #1174
Merged
ggrossetie merged 2 commits intoJul 20, 2026
Merged
Conversation
…atalogs Duplicate/merged component versions, antora.yml files dropped for missing name/version or a symlinked parent, and documents that fail to resolve to a content catalog entry (or an include target that doesn't) all happened silently, leaving users with no way to tell why xref/attribute completion stayed empty short of reading the source. These conditions now log to the "Asciidoctor" output channel, naming the file path(s) involved. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replace the untyped @asciidoctor/core Cursor (file/dir declared as any) with a narrow, hand-written IncludeCursor describing only what this module reads, and give the function a proper ResolvedInclude | undefined return type using the hand-written ContentCatalogFile type instead of implicit any. The JSDoc carried a stray @memberof asciidoc-loader referencing a namespace that doesn't exist in this file (a leftover from the Antora source this logic was ported from) and redundant {Type} tags now that TS provides them; both are dropped in favour of a short provenance note in the description. Also replaces the deprecated String#substr with #slice. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Several places in the Antora resolution path were dropping information
silently:
mergeDuplicateComponentVersions(the classifier throwsDuplicate version detectedotherwise) merges two entries sharing the samename+versionwithout saying which two files collided — this is the most likely culprit for the report above.getAntoraConfigUris()deduplicatedantora.ymlURIs surfaced by overlapping workspace folders without saying which ones.buildContentCatalog()dropped configs missingname/version.buildAntoraConfigs()skipped configs whose parent directory is a symlink.antoraConfigFileExists()swallowed read errors in an emptycatch.AntoraContext.getResource()returnedundefinedfor a missingnameor agetByPathmiss — the two most common reasons a given document never gets xref/attribute completion.resolveIncludeFile()returnedundefinedfor an unresolved include target without saying which one.All of these now log to the "Asciidoctor" output channel (
info/warnfor conditions worth surfacing,debug/tracefor the rest, visible after raising the channel's log level via "Developer: Set Log Level…"), each message naming the file path(s) involved.Also included: a follow-up cleanup of
resolveIncludeFile.ts's types and JSDoc (untypedCursorreplaced with a narrow local type, a stray@memberof asciidoc-loaderleft over from the Antora source this was ported from removed, deprecatedString#substrreplaced with#slice).