Skip to content
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

Limit the new bracket pair colorization to certain types #132336

Closed
runxel opened this issue Sep 4, 2021 · 7 comments
Closed

Limit the new bracket pair colorization to certain types #132336

runxel opened this issue Sep 4, 2021 · 7 comments
Assignees

Comments

@runxel
Copy link

runxel commented Sep 4, 2021

The native bracket pair color highlighting is great, but I miss an option to exclude certain types of brackets.
I'm coding in a (somewhat niche) language that uses square brackets [] for arrays. Arrays in this language can't be nested, so there is just no need to have them colorized. In fact, it's rather adding visual clutter.

So maybe there could be a new setting where you can toggle for each bracket type if it should be highlighted or not.

@oaahmad
Copy link

oaahmad commented Sep 4, 2021

@runxel You say you don't want "[ ]" to be colored because those types of brackets are never nested. There is another way to achieve what you want. See #131027 and my comments there. If that feature is implemented and you set the first bracket pair color to black (white if you use a dark theme) then all top-level brackets of each type would not be colored. Only nested brackets of the same type would be colored. The result is a little different because it applies to all bracket types. You may like that less, or you may like that more. It's just a different way to achieve what you want.

@runxel
Copy link
Author

runxel commented Sep 4, 2021

@oaahmad To have only the nested brackets of the same type to have color would be nice choice, too!
This would also solve my case, I guess.
Most times the outermost bracket also doesn't need to be in a different color than it would be normally anyway.

@gjsjohnmurray
Copy link
Contributor

/assign @hediet

@ghost
Copy link

ghost commented Sep 5, 2021

Personally, I like to have brackets colored even though they are not nested.
So I think that there is some settings about this feature that are missing.

  • The possibility to set new colors so you can set the color of your choice (white if it's what you want) as the first one used
  • Force iteration (this issue requests this last setting)
  • Set brackets that will be affected by the colorization

@hediet
Copy link
Member

hediet commented Sep 5, 2021

Each language can configure supported bracket pairs.
Please reopen/ping me if that does not solve your problem.

@runxel
Copy link
Author

runxel commented Sep 6, 2021

@hediet
This should not necessarily live in the extension alone!
I think the user should have the power to overwrite this in his personal settings.

runxel added a commit to runxel/vscode-gdl that referenced this issue Sep 6, 2021
VSCode v1.60.0 has brought native support for bracket colorization.
When enabled nested bracket pairs will be highlighted differently.
Per this comment it has to be set up as language rule (microsoft/vscode#132336 (comment)).
@hediet
Copy link
Member

hediet commented Sep 6, 2021

I think you might be looking for #131412.
However, it would be nice if it usually works out of the box and only power-users need to fine tune the bracket pairs to colorize.

@github-actions github-actions bot locked and limited conversation to collaborators Oct 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants