Skip to content

fix: log Antora resolution decisions to help diagnose empty content catalogs - #1174

Merged
ggrossetie merged 2 commits into
asciidoctor:mainfrom
ggrossetie:fix/antora-resolution-logging
Jul 20, 2026
Merged

fix: log Antora resolution decisions to help diagnose empty content catalogs#1174
ggrossetie merged 2 commits into
asciidoctor:mainfrom
ggrossetie:fix/antora-resolution-logging

Conversation

@ggrossetie

Copy link
Copy Markdown
Member

Several places in the Antora resolution path were dropping information
silently:

  • mergeDuplicateComponentVersions (the classifier throws Duplicate version detected otherwise) merges two entries sharing the same name+version without saying which two files collided — this is the most likely culprit for the report above.
  • getAntoraConfigUris() deduplicated antora.yml URIs surfaced by overlapping workspace folders without saying which ones.
  • buildContentCatalog() dropped configs missing name/version.
  • buildAntoraConfigs() skipped configs whose parent directory is a symlink.
  • antoraConfigFileExists() swallowed read errors in an empty catch.
  • AntoraContext.getResource() returned undefined for a missing name or a getByPath miss — the two most common reasons a given document never gets xref/attribute completion.
  • resolveIncludeFile() returned undefined for an unresolved include target without saying which one.

All of these now log to the "Asciidoctor" output channel (info/warn for conditions worth surfacing, debug/trace for 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 (untyped Cursor replaced with a narrow local type, a stray @memberof asciidoc-loader left over from the Antora source this was ported from removed, deprecated String#substr replaced with #slice).

ggrossetie and others added 2 commits July 20, 2026 13:04
…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>
@ggrossetie
ggrossetie merged commit fa93135 into asciidoctor:main Jul 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant