Lisp Bracket Matcher is a Visual Studio Code extension for Lisp-family languages that fixes bracket matching in cases where the default matcher is not precise enough.
It is designed specifically to handle character literals like #\( and #\), while still correctly recognizing real Lisp forms like (, #(, and #vu8(. This makes editing Scheme, Racket, and Lisp code more reliable when your source contains vectors, bytevectors, or character literals.
In Lisp code, not every parenthesis-like sequence should participate in structural matching.
Examples:
#(is a real vector opener and should be matched.#vu8(is a real bytevector opener and should be matched.#\(is a character literal and should be ignored.#\)is a character literal and should also be ignored.
Default bracket matching can treat these cases too simplistically. This extension adds Lisp-aware matching behavior so the editor highlights the correct pair and avoids false positives caused by character literals.
- Correctly matches standard list parentheses:
(...) - Supports vector forms:
#( - Supports bytevector forms:
#vu8( - Ignores character literals such as
#\(and#\) - Highlights matching brackets in supported files
- Provides optional diagnostics for unmatched parentheses and vector openers
- Works with
scheme,racket, andlisplanguage modes
- Open Visual Studio Code.
- Go to the Extensions view.
- Search for
Lisp Bracket Matcher. - Click
Install.
- Open the Extensions view in VS Code.
- Select
...in the top-right corner. - Choose
Install from VSIX.... - Select the extension package file.
Open a Scheme, Racket, or Lisp file and place the cursor on a bracket token. The extension will highlight the matching bracket using Lisp-aware rules.
(define (square x)
(* x x))Placing the cursor on either ( or ) highlights the correct matching pair.
(define vec #(1 2 3))
(define bytes #vu8(65 66 67))The extension treats #( and #vu8( as valid opening bracket tokens and matches them against their closing ).
(define left-paren #\()
(define right-paren #\))The character literals #\( and #\) are ignored by the matcher, so they do not interfere with structural navigation or bracket highlighting.
This extension contributes the following settings:
- Type:
boolean - Default:
true
Enables diagnostics for unmatched opening and closing parentheses in supported documents.
- Type:
number - Default:
120
Controls the delay, in milliseconds, before the document is rescanned after edits. Increase this value if you want fewer rescans during rapid typing.
{
"lispBracketMatcher.enableDiagnostics": true,
"lispBracketMatcher.debounceMs": 120
}Lisp Bracket Matcher and rainbow bracket plugins solve different problems and can be used together.
- Use
Lisp Bracket Matcherfor correct structural matching of(,#(, and#vu8(, while ignoring character literals like#\(. - Use a rainbow bracket extension for visual depth coloring of nested parentheses.
Recommended setup:
- Keep this extension enabled for accurate Lisp-aware matching that understands character literals.
- Use your preferred rainbow bracket extension for nested color visualization.
- Let this extension handle bracket matching behavior in supported Lisp files.
This project is licensed under the Apache License 2.0.
See the LICENSE file if it is included with the project distribution, or refer to the Apache 2.0 license text at: