Closed sleepymalc closed 11 months ago
Actually, I do not think the new rendering of hyperref
is a bug. Let's have a closer look.
First, disabling editor.bracketPairColorization.enabled
removes what you call the weird colouring
Second, why did not we have this weird colouring before version 1.5.3
of the LaTeX grammar? This is because \(...\)
inside the first bracket pair was considered as delimiters of a math block before #59. This was actually wrong. It seems to me that the new grammar is better and uses more relevant scopes.
Btw, \hyperref
expects a label as its optional argument. Isn't it a bit weird to find \(
inside a label? I would even have thought this these are not accepted as part of a label.
I understand the expected behavior for the first optional argument, i.e., \hyperlink[\(\)]{some text...}
, is probably not correct and should not be used in the first place.
However, a more concerning problem is for the second argument, i.e., \hyperlink[some label]{\(\)}
: this is what I use on a daily basis. However, now it's not rendered in the usual way. I think a potential reason is the following:
As you can see, the scope inside \(\)
is not even math.
This causes me other problems when using other extensions (which is irrelevant to this one, though).
I'm not sure whether this is a VSCode bug or something else.
You are right the second argument in \hyperlink[some label]{some text}
is not matched against the LaTeX syntax, hence math is not highlighted. I will investigate if it can be fixed.
A clear and concise description of what the bug is.
The syntax highlight of
\( \)
behaves weird in, e.g.,\hyperref[]{}
The previous version (e.g., version 9.7.0) is the expected highlight behavior
A minimal example to reproduce the issue
\hyperref[\(\)]{\(\)}