fix: honor the Antora prompt setting and keep the content catalog alive - #1167
Merged
ggrossetie merged 1 commit intoJul 15, 2026
Merged
Conversation
Follow-ups to a 4.0 pre-release user report about the "enable Antora
support?" prompt and Antora resource id completion.
Prompt:
- The `asciidoc.antora.showEnableAntoraPrompt` setting was declared and
documented but never read, so it had no effect. It is now honoured and
the prompt becomes opt-in: the check runs before anything else, so with
the prompt disabled (the default) opening documents no longer triggers
the antora.yml file system lookup at all, and the setting can be
flipped mid-session without reloading the window.
- The prompt listened to document-open events registered during
activation, but the very document whose opening activates the extension
fires that event before the listener exists, so a session where a
single Antora page was opened never showed the prompt. The already-open
documents are now scanned at activation.
- The "Enable Antora support in this workspace" command now registers the
Antora-gated features (the `{` attributes completion) immediately
instead of after a window reload; registration is idempotent and the
"Disable" command tears the features down symmetrically.
Content catalog:
- Two antora.yml files declaring the same component name and version
(a clone and a copy, or overlapping multi-root folders) made the
classifier throw `Duplicate version detected`, and an unquoted
`version: 2.0` (a YAML number) made it throw as well; either failure
took the whole catalog down and silently disabled every Antora feature.
Duplicated antora.yml URIs are now deduplicated, entries sharing a
component name and version are merged before classification (mirroring
Antora's own aggregator), and a non-string version is coerced.
- Read the antora.yml bytes explicitly as UTF-8 when building the
catalog: `yaml.load` was handed the raw Uint8Array and only worked
because the desktop host returns a Buffer whose toString decodes UTF-8;
on any other host the implicit String() coercion produces garbage.
Docs: the "remote content sources" limitation refers to content sources
an Antora playbook would fetch from remote git repositories, not to
remote development setups such as VS Code Remote - SSH.
Co-Authored-By: Claude Fable 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.
asciidoc.antora.showEnableAntoraPromptwas declared and documented but never read, so it had no effect. It is now honoured and the prompt becomes opt-in: the check runs before anything else, so with the prompt disabled (the default) opening documents no longer triggers theantora.ymlfile system lookup at all, and the setting can be flipped mid-session without reloading the window.{attributes completion) instead of after a window reload; registration is idempotent (prompt + command cannot stack duplicate providers) and "Disable Antora support in this workspace" tears them down symmetrically.antora.ymlfiles declaring the same component name and version (a clone and a copy of the same component, or overlapping folders in a multi-root workspace) made the classifier throwDuplicate version detected, and an unquotedversion: 2.0(a YAML number) made it throw as well; either failure silently disabled every Antora feature (resource id completion, go to definition, preview resolution) for all components. Duplicatedantora.ymlURIs are now deduplicated, entries sharing a component name and version are merged before classification — first descriptor wins, files deduplicated by their path within the component, mirroring Antora's own aggregator — and a non-string version is coerced to a string.antora.ymlbytes explicitly as UTF-8 when building the catalog:yaml.loadwas handed the rawUint8Array(the pre-existing TS error inbuildAntoraConfigs) and only worked because the desktop host returns aBufferwhosetoStringdecodes UTF-8; on any other host the implicitString()coercion produces a comma-separated byte string.asciidoc.antora.showEnableAntoraPrompt.