Cross references in Pretext-tools

26 views
Skip to first unread message

Valerio Monti

unread,
Feb 3, 2023, 4:43:15 AM2/3/23
to PreTeXt support
Hello everybody,

I am currently using Visual Studio Code with Pretext tools (thanks Oscar, for the great work) for editing Pretext files.

According to the changelog this new feature

Set default value for xml.references so that <xref ref="foo"/> is linked to @xml:id="foo".

has been introduced in version 0.90

The editor now yields an error message if you use an undefined reference

Undefined reference 'foo': nothing that matches the expression '@xml:id' defines 'foo'.

However, if your source is modular you get an error message like that even if the reference is defined but it is in a different file of the project. Is there a way to tell Pretext-tools for search in all the files of the project? Maybe I am missing some obvious option.

All the best,
Valerio

Oscar Levin

unread,
Feb 3, 2023, 9:24:33 AM2/3/23
to pretext...@googlegroups.com
Hi Valerio,

The reference checking is provided by the vscode-xml extension; pretext-tools just provides the setting that says what labels and references are called as attributes.  There is an issue open on their extension here: https://github.com/redhat-developer/vscode-xml/issues/835.  If you wanted to reinforce that issue, perhaps they will put that higher up in their queue.

In the meantime, if you edit your settings.json file, you can remove the stuff about xml:id and ref, which should remove all errors.  Or explore the "xml" settings and their might be a new one provided by vscode-xml that limits warnings.

Cheers,
Oscar.

--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pretext-support/2eee259e-689d-4f4f-9d3a-d3d17dec07b3n%40googlegroups.com.

Valerio Monti

unread,
Feb 3, 2023, 5:56:25 PM2/3/23
to PreTeXt support
Thank you Oscar, I will try to disable the warnings.

All the best

Reply all
Reply to author
Forward
0 new messages