skip to Main Content

Some of my angle brackets, left and right, in VSCode, Windows 11, React and Node JS project are red. Dunno why? It just happened. Any fixes?

enter image description here

2

Answers


  1. A commit was just merged hopefully fixing this issue, see commit. It looks like it is just removing the angle brackets from html brackets. It was marked as a recovery candidate so it may be v1.76.1 soon.


    If on v1.76. you could downgrade and see if the issue is still there.

    Seems awfully similar to this issue: Right caret color becoming red incorrectly. (not sure why they said "caret", it is a right angle bracket) That issue was closed as solved but I would expect to quickly see more similar issues. (e.g., probably related: https://github.com/microsoft/vscode/issues/175797). A bug in the bracket colorization functionality.

    There are a couple of workarounds suggested in that first issue until the issue gets fixed, including disabling this setting:

    "editor.bracketPairColorization.enabled": false
    

    which just disables all bracket matching or as explained in the recent answer by @HenningDieterichs

    "editor.language.brackets": [
       ["(", ")"],
       ["{", "}"],
       ["[", "]"],
    ]
    
    Login or Signup to reply.
  2. VS Code engineer here.

    This issue is caused by a change in the bracket matching logic of VS Code (see changelog) in combination with some extensions.

    As of now, both brackets configured in editor.language.brackets and editor.language.colorizedBracketPairs are used for matching. However, only brackets set it colorizedBracketPairs are colorized, except unmatched brackets. Before, if editor.language.colorizedBracketPairs was set, brackets configured in editor.language.brackets had no effect.

    Long term, languages contributed by extensions should only configure brackets that always match (i.e. <> should not be marked as a bracket pair or both brackets should have the same language id).

    Short term, you can set editor.language.brackets to

    "editor.language.brackets": [
       ["(", ")"],
       ["{", "}"],
       ["[", "]"],
    ],
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search