Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: mark textmate grammar tokens as unbalanced (vscode 1.67+) #347

Open
sambacha opened this issue May 18, 2022 · 1 comment
Open

Comments

@sambacha
Copy link

To make bracket pair matching and colorization more robust, TextMate grammar contributions can now express that brackets in certain tokens should not be matched. In the contributes section of an extensions package.json, provided grammars can use the propertiesbalancedBracketScopes(defaults to ["*"]) and unbalancedBracketScopes (defaults to []) to include or exclude scopes for bracket matching.

https://code.visualstudio.com/updates/v1_67#_textmate-grammars-can-mark-tokens-as-unbalanced

An example of a config (not a suggestion for implementation )

"grammars": [
    {
      "language": "solidity",
      "scopeName": "source.solidity",
      "path": "./syntaxes/solidity.tmLanguage.json",
      "balancedBracketScopes": [ "*" ],
      "unbalancedBracketScopes": [ "meta.scope.case-pattern.solidity" ],
      "injectTo": [
        "source.solidity"
      ]
    }
@sambacha
Copy link
Author

this could solve for example #339

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants