question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bracket pair colorization: op-in-flag to only colorize on focus

See original GitHub issue

There should be a flag where any brackets remain at their original colour (let’s say a 33% white on black), unless the bracket is in focus.

Reasoning: Brackets can be noise in code that make it hard to see what is going on, but at other times understanding which brackets pair up is crucial.

Bracket pair colorization should because of this have an opt-in feature where, once bracket pair colorization is enabled, given that new flag is toggled on, only render for the current context.

A context here means a logical block of code wrapped by brackets.

{foo} // 2 contexts, `:root` and within `:root > {`
{(true)} // 3 contexts, `:root`, `:root > {` and `:root > { > (`
"editor.bracketPairColorization.enableOnlyOnFocusOf": "brackets"

^ Colorizes brackets of this context and any children of that context if the cursor is before or after a given bracket:

"editor.bracketPairColorization.enableOnlyOnFocusOf": "context"

^ Colorizes brackets of this context and any children of that context if the cursor is within a given context:

Essentially for both flags any code outside of a context in focus (cursor) would not colorize. The code inside would colorize based on if there is a focus (cursor) on/around a backet or, for the 2nd flag value, context.


"editor.bracketPairColorization.enableOnlyOnFocusOfTriggeredByHover": true

^ Would enable pair colouring while hovering with the mouse so you don’t need to click to see how things pair up.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:56
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
inoascommented, Jul 28, 2022

yes, that would be the case.

1reaction
inoascommented, May 31, 2022

It is similar but this suggestion here includes more options like coloring on hover if opted into instead of just the cursor. And colouring if on brackets or just in a context (colour direct parent brackets and any children brackets)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bracket pair colorization 10000x faster - Visual Studio Code
To make this easier, in 2016, a user named CoenraadS developed the awesome Bracket Pair Colorizer extension to colorize matching brackets and ...
Read more >
VSCode: Bracket Pair Colorization Now Native - Justin James
With the VSCode August 2021 (ver 1.60.0) update, this feature is now built into VSCode. You just need to turn it on. Bracket...
Read more >
VS Code tips — Built-in bracket pair colorization - YouTube
The built-in bracket pair colorization feature of VS Code uses colors to visually show matching pairs of brackets, braces, and parens.
Read more >
Adding color to bracket pairs - Visual Studio Blog
Calling it “Colored Braces” would've not only made more sense, but also been more intuitive to users as well, particularly when navigating menus ......
Read more >
Native Bracket Pair Colourization in VS Code
VSCode now has bracket pair colorization natively baked in! Aims to be faster than the popular Bracket Pair Colorizer extension.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found