-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Request] Bracket Pair Colorization: Allow bracket pairs to share open tokens or close tokens #132209
Comments
Thanks for reporting this! I did not think of this case. If someone wants to contribute a PR, please ping me! |
Hey @hediet, I've got a solution maybe 80% of the way there, once I add some tests and clean up, it'll be ready. One thing though, the line tokenizer always seems to split tokens at backslashes The issues in Verilog and LaTeX which were related to bracket sharing, I think I've got those squared away, and I'll get a PR up tonight or tomorrow. |
Implemented by #132504. |
I'm not sure but I don't think this is working. I have the following set: "editor.bracketPairColorization.enabled": true,
"editor.guides.bracketPairs": true,
"workbench.colorCustomizations": {
"[Default Light+]": {
"editorBracketMatch.background": "#ff0000"
}
} Which in a cpp file produces the following: But I don't get similar results in a latex file: Perhaps I need to install something else for it to work? |
It only shows scope lines for multi-line bracket pairs. Your LaTeX example does not have those. |
@hediet I thought these were multiline bracket pairs?
|
Marking as verified for now. I think for LaTeX, the idea is to identify Example: \begin{equation}
\left\{2+2+3\right\}
\end{equation} |
The editor now supports native bracket pair colorization, but the languages where multiple bracket pairs share the same open token or close token are not correctly supported. This is a legacy issue from Bracket Pair Colorization (ref issue #301). DragWx has submitted a solution, ref PR #310, but the author(CoenraadS) has not reviewed and merged the code for a long time.
Actually, when setting
"editor.bracketPairColorization.enabled": true
to enable Bracket pair colorization, there will be some languages that can not be properly supported. So hopefully the developers can support this feature (#310).It's also worth mentioning that the bracket matching of vscode works correctly, but the colorization is incorrect, as shown below:
PS: Here are some examples of languages that share open tokens or close tokens.
Verilog/SystemVerilog brackets examples:
AL Language brackets examples:
LaTeX brackets examples:
PPS: @CoenraadS, In Bracket Pair Colorization, there are already many related issues: #301, #170, #416, #328, #332, #371, #349 (some are duplicates).
The text was updated successfully, but these errors were encountered: