且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在 Visual Studio Code 中突出显示封闭括号

更新时间:2022-10-17 15:05:38

是的,现在默认有一个方法,

我们还调整了我们的 Go to BracketSelect to Bracket 操作以使用封闭括号.

Is there a way to highlight brackets when the cursor is anywhere within the enclosing brackets? Default settings highlight it only when I place the cursor near the brackets.

Yes, there is now a way by default, in VSCode 1.40 (October 2019):

Improvements to bracket matching

Previously, VS Code would only highlight matching brackets when the cursor was next to a bracket character.
Now VS Code will always highlight enclosing brackets if they exist.

We have also adjusted our Go to Bracket and Select to Bracket actions to use enclosing brackets.

It is improved and supported natively with VSCode 1.60 (Aug. 2021):

Bracket pair colorization can be enabled by setting "editor.bracketPairColorization.enabled": true.
All colors are themeable and up to six colors can be configured.