Open jens-auer opened 2 years ago
Are you talking specifically about Antora xref or AsciiDoc xref?
Agreed! This would be a nice feature :)))
The IDs that can be referenced are these ones? https://docs.asciidoctor.org/asciidoc/latest/attributes/id/
@Mogztter Do we already have an utility parsing .adoc files to retrieve all IDs of a document?
I think that we can split this task with:
#
id=
<<id>>
?xref:my.adoc#
Do we already have an utility parsing .adoc files to retrieve all IDs of a document?
I guess you can load
the document and retrieve anchors using the catalog:
The processor always cataloged the following assets, regardless of this setting: block or inline anchors (key: :refs) (...) https://docs.asciidoctor.org/asciidoctor/latest/api/catalog-assets/#what-assets-are-cataloged
Provide completion for other document in the workspace when typing xref: (should we restrict to .adoc document?)
Yes I think we should restrict to .adoc
. This file extension will most likely be used in the mime-type registration.
After I discovered that some part was already implemented and based on first feedback on my 2 initial pull requests, Here is a new proposal to the split of tasks:
<<id>>
?xref:
Existing behavior was to insert only the id --> https://github.com/asciidoctor/asciidoctor-vscode/pull/667#issuecomment-1320857335xref:my.adoc#
[quote.movie#roads,Dr. Emmett Brown]
(surely will be time to use load
and catalog assets https://github.com/asciidoctor/asciidoctor-vscode/issues/648#issuecomment-1304542296
Similar to autocompletion for image and include files (#377), I would like to use autocompletion for internal and external references.
Details:
Background: We import requirements from a requirement management tool and reference them in the text. Autocomplete would reduce errors and provide better efficiency.