Skip to content

Show token locations on highlighting errors#14509

Open
westurner wants to merge 1 commit into
sphinx-doc:masterfrom
westurner:show_token_locations_on_error
Open

Show token locations on highlighting errors#14509
westurner wants to merge 1 commit into
sphinx-doc:masterfrom
westurner:show_token_locations_on_error

Conversation

@westurner

@westurner westurner commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Purpose

Show token locations on highlighting errors, in order to make it easy to Ctrl-Click path:lineno references
(in order to find obscure issues with unbalanced appostrophes in comments in bash syntax-highligted docs)

This adds to the one line error message regex.

I've tried to update the translation files too. As noted on that commit, I've attempted to auto-updated the translation files with the model. Please do correct as necessary.

References

AI Disclosure

  • AI tools used:
    • GitHub Copilot (in vscode with a devcontainer)
      • Claude Haiku 4.5 (0.33x but)
      • Gemini 3.1 Pro (6x for translations)
@westurner westurner force-pushed the show_token_locations_on_error branch 2 times, most recently from 971fdd7 to 9cc1786 Compare June 30, 2026 15:01
@westurner

Copy link
Copy Markdown
Contributor Author

A json/csv/yaml log of (path, line, char, error) would probably also help with tools that update docs and currently have to use these regexes in test_build_warnings.py (and not yet sure where else) to parse the log output; https://github.com/westurner/sphinx/blob/9cc1786b8929a3fe32df9d374ce7f57e31b62899/tests/test_builders/test_build_warnings.py

@westurner westurner force-pushed the show_token_locations_on_error branch from 9cc1786 to 69bbc08 Compare June 30, 2026 15:08
@westurner

Copy link
Copy Markdown
Contributor Author
@picnixz

picnixz commented Jun 30, 2026

Copy link
Copy Markdown
Member

I don't think you need to regen the messages? I think it's done automatically (or maybe not anymore?)

@jdillard

Copy link
Copy Markdown
Member

The translation files are handled in a separate process (semi-automatic, as it requires a manual merge).

This is what the contributing guide says:

Translated strings from the platform are pulled into the Sphinx repository by a maintainer before a new release.

We do not accept pull requests altering the translation files directly. Instead, please contribute translations via the Transifex platform.

@westurner westurner force-pushed the show_token_locations_on_error branch from 69bbc08 to 40ab948 Compare June 30, 2026 22:32
…lder

because the LaTeX builder tracks the source line number of the error

Co-authored-by: Copilot <copilot@github.com>
@westurner westurner force-pushed the show_token_locations_on_error branch from 40ab948 to f609722 Compare June 30, 2026 22:35
@westurner

Copy link
Copy Markdown
Contributor Author

My mistake. I've rebased and removed the commit that attempted to add the translations.

Attached:
sphinx_highlighting_error_patch_translations.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants