James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.76k stars 535 forks source link

\ref link highlighting breaks at some valid characters #4446

Closed v4hn closed 1 month ago

v4hn commented 1 month ago

Pre-checks*

Environment*

Please write exact version numbers instead of descriptors such as latest.

  • Operating System: Debian Trixie
  • Visual Studio Code Version: 1.94.2
  • LaTeX Workshop Version: 10.5.5
  • TeX Distribution Version: texlive 2024

The Issue*

The link highlighting for references that include : or - (and possibly other valid characters) ends at these characters, but still links to the correct label. Screenshots to illustrate the issue: screenshot241024-155558 [Holding <Ctrl> and hovering over a part of the ref argument] screenshot241024-155632

Reproduction Steps

  1. create a latex file with a label like \label{a:b-c} and a reference to it \ref{a:b-c}
  2. build the file
  3. hold <Ctrl> and hover over any of the letters of the argument to \ref
  4. only part of the argument turns into a link

Expected Behavior

jlelong commented 1 month ago

Related to #3312 See in particular this specific https://github.com/James-Yu/LaTeX-Workshop/issues/3312#issuecomment-1139740611