-
Notifications
You must be signed in to change notification settings - Fork 3.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
Rainbow brackets #5259
Comments
Might as well include the rainbow indent too: |
I think it's necessary for this to be configurable. Personally I don't enjoy bracket colorization, so I'll look for a way to disable them. |
This sounds like it should be an extension (when zed supports extensions). |
As I remember, this feature is built-in to VSCODE, am I wrong? |
This would be awesome to have. |
Are their any plans for this to be add, it is a big legibility improvement? If not would it be possible to make an extension for this functionality. |
I think this is a good thing for the core. The specific langs LSPs could/should expose what counts as brackets like do/end for/end fn/end {} () [] #() and whatnot. If they don't just do regular braces ({}, {}, ()) |
Hey, I’d like to start on this issue if no one’s already working on this. |
It's been two years so you should be good to work on it. I would be willing to help test. |
Hey, would it be ok if me and @bcmeireles worked on it as well? We've been analyzing it for a while and would like to pick up this feature if possible. |
Hello @Dageus @bcmeireles I don't mind collaborating with you both on this. |
@kiran-4444 this would be a good draft pull request. |
Hey @kiran-4444 sorry for the delay in the response |
@Dageus It may not be as simple as y'all hope! I suggest y'all both continue and open draft PRs so we can check on them :) |
@Dageus @bcmeireles No problem, you can continue on this and I'll work on some other issue. Good luck with your project! |
@kiran-4444 Thank you for this. We will be working on it and keeping everyone updated throughout the process. |
We've been looking through it and found some interesting things, mainly in We're thinking about doing an approach like the highlight_matching_bracket.rs file does for the highlight but for coloring but unsure if it's the best approach. We've also looked into the Thanks! |
After reading a little bit more, I think the Thanks! |
We figured out that the |
…es#5259 - Added rainbow brackets to highlight method - Added new setting called use_rainbow_brackets - Started developing the AST based on VSCode's implementation Co-authored-by: João Nogueira <[email protected]>
…es#5259 - Added rainbow brackets to highlight method, in the gpui's style file - Added new setting called use_rainbow_brackets to allow users to decide if they want to use the rainbow brackets or not - Started developing the AST based on VSCode's implementation Co-authored-by: João Miguel Nogueira <[email protected]>
…es#5259 - Added rainbow brackets to highlight method, in the gpui's style file - Added new setting called use_rainbow_brackets allowing users to decide if they want to use the rainbow brackets or not - Started developing the AST based on VSCode's implementation Co-authored-by: João Miguel Nogueira <[email protected]>
…es#5259 - Added rainbow brackets to highlight method, in the gpui's style file - Added new setting called use_rainbow_brackets allowing users to decide if they want to use the rainbow brackets or not - Started developing the AST based on VSCode's implementation Co-authored-by: João Nogueira <[email protected]>
Is everyone ok with the approach being taken and/or does anyone have any suggestions regarding how to continue? |
As long as current themes still work and can add colors with little effort it should be good. |
Yes, we plan to not break any themes, we've added the option to customize the colors but that's built upon the current theme implementation. |
Is there a reason for building a custom AST rather than using the tree-sitter ASTs? If using tree-sitter, I'm not sure if you'd use the per-language ones or maybe some generic one just for pair parsing? |
Different languages could have different behaviours for brackets and the logic could be used for more than rainbow brackets, at least that was our thought process. Do you have a different idea for the approach? |
It'd probably be useful for the tree-sitter-involved Zed developers to chime in. As far as I'm aware, tree-sitter already incrementally parses full parse trees from buffers for each language, and is used for syntax highlighting, autoindent, and other syntax-aware features. From my uninformed outsider perspective, the tree-sitter framework sounds like it may be appropriate for rainbow brackets as well? Probably worth checking since it seems like a pretty core part of this editor. |
We're also unaware of that implementation for tree-sitter, where is that and how does it work? If any tree-sitter-involved Zed developer could let us know about it if it even is something that we could use for it we'd like to know and colaborate to get the rainbow brackets implemented that way |
Imho it would be great for other nesting in languages such as Elixir or Ruby. |
It looks like Zed already supports rainbow (or theme-colored) indent guides in its default settings. For example, on my editor, changing the background coloring to "indent_aware" on One Light theme yields: Changing just the color yields: I realize this isn't braces, but a few people mentioned indents |
I like these much more anyway, vscode has them too (background indent rainbows) |
Rainbow bracket is a built-in feature of VSCode now (no longer a plugin). I highly recommend to integrate this into Zed. |
For me, it's decision making change. Till we have rainbow brackets, i "have" to stay in VS Code, and i would really really like to switch from it. Zed is superior editor for me in most ways already, but i am faster in reading code with rainbow brackets ... it makes a all the difference in longer HTML, JS, CSS for me, and till then i am still subconsciously switching back to VSCode ... :( ... once you get used to it, it's hard to switch from it. Can we plan this to some milestone? |
It would be ideal to add a functionality similar to "editor.guides.bracketPairs": true, from vscode and also another similar to the indentRainbow extension: indentRainbow.includedLanguages": ["nim", "nims", "python"], |
Check for existing issues
Is your feature request related to a problem?
Having bracket pairs colours helps quickly look at code and understand where brackets/blocks/parens start & end
Describe the solution you'd like
Rainbow brackets similar to VSCode
If applicable, add mockups / screenshots to help present your vision of the feature
https://code.visualstudio.com/blogs/2021/09/29/bracket-pair-colorization
The text was updated successfully, but these errors were encountered: