Reputation: 51
Visual Studio Code automatically highlights the outer parenthesizes as show as in this picture:
How can I change it to highlight the inner parenthesizes like this as seen in Notepad++:
Upvotes: 2
Views: 231
Reputation: 662
You may love to use [Deprecated] Bracket Pair Colorizer 2 extension.
Upvotes: 0
Reputation: 50805
What you are asking for was raised as a feature request: Inconsistent closing character cursor highlight behavior #50373 (also see its duplicate, Braces match on an unusual side #58751). It's closed as "out-of-scope" with the following message (which includes relevant, actionable info, so read carefully (emphasis added)):
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
If you do end up raising the feature-request again, please comment here with a link to your issue ticket, or edit the link into this answer post.
Though you may find bracket pair colourization (which is enabled by default in more recent VS Code versions) to be a satisfactory workaround.
Upvotes: 0
Reputation: 181794
Bracket pair colorization will be built-in to vscode 1.60.
Editor > Bracket Pair Colorization: Enabled
{
"workbench.colorCustomizations": {
"editorBracketHighlight.foreground1": "#ff00d4",
"editorBracketHighlight.foreground2": "#66ff00",
"editorBracketHighlight.foreground3": "#ffd000", // up to 6
"editorBracketHighlight.unexpectedBracket.foreground": "#ff0000"
}
}
That will highlight both of the bracket pairs you showed in your example. If you didn't want, for example, the outer pair colored just don't assign a color to that bracket pair. In your case, probably pair 2 if enclosed in some outer function.
The highlighting of the brackets you referred to is something else. If you click inside the inner pair then those brackets would be highlighted. Think of them as the focussed brackets. That color is controlled by:
{
"workbench.colorCustomizations": {
"editorBracketMatch.background": "#ff0000",
"editorBracketMatch.border": "#ff0000"
}
}
Upvotes: 0