Same color if/else/for/while/switch statement's parentheses and its first curly brackets
See original GitHub issueYou should Star
this repo before you create a issue, thanks for your support 😁
Done!
Expected Behavior
- The first curly brackets should have the same color as the parentheses:
(screenshot from VS Code)
Current Behavior
- The first curly brackets have a different color from the parentheses:
(screenshot from WebStorm)
Possible Solution
The plugin could keep count of the block-level and use the same color for each level. In the example the yellow block-level started with (
and was closed with )
so the next set of braces are at the same block-level, thus can reuse the yellow color.
Or perhaps it’s easier to just hardcode this rule for these type of statements.
Code snippet for reproduce (for bugs)
if (foo === "bar") {
// curly braces get the same color as the parentheses
}
Your Environment
- Plugin version: 5.0-RC3
- IDEA version: WebStorm 2018.1 EAP, WS-181.4096.25, built on March 8, 2018
- Operating System and version: macOS 10.13.x
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
When should I use curly braces { } and parenthesis ( ) in React?
Curly braces { } are special syntax in JSX. It is used to evaluate a JavaScript expression during compilation. A JavaScript expression can...
Read more >Assignment of several statements enclosed in parentheses ...
Behind the magic is a GCC C extension, which causes a code block to return a value if enclosed within brackets and parentheses....
Read more >26/30, no curly brackets after "if" and "else" ? | Codecademy
Yes it is not necessary to use curly braces after conditions and loops (functions always need them) IF and only if there is...
Read more >Noob: don't understand usage of curly brackets in if-statement
I think there's a misunderstanding: if (true) { x } { y } is exactly the same as if (true, { x },...
Read more >Adding color to bracket pairs - Visual Studio Blog
We call it Rainbow Braces and the first iteration adds basic colorization to curly brackets, square brackets, and parentheses (see image ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I mean that with this change to determine what should be the color of the bracket just knowledge about the color of the closest bracket of the same type would not be enough - it would require also to take the color of different brackets in to account as well. Now consider that brackets of the same type should have the same color
I’m going to close this issue, feel free to re-open it or raise a new one if you have any issue.