Skip to content

Commit cb3c14b

Browse files
Update regex
1 parent b630e1b commit cb3c14b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/cursorless-engine/src/languages/TreeSitterQuery/validateQueryCaptures.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ for (const captureName of captureNames) {
5959
}
6060

6161
// Not a comment. ie line is not starting with `;;`
62-
// Not a string. ie line does not contain `@"`
62+
// Not a string.
6363
// Capture starts with `@` and is followed by words and/or dots
64-
const capturePattern = new RegExp(`^(?!;;|.*@").*@([\\w.]*)`, "gm");
64+
const capturePattern = /^(?!;;).*(?<!"\w*)@([\w.]*)/gm;
6565

6666
export function validateQueryCaptures(file: string, rawQuery: string): void {
6767
const matches = rawQuery.matchAll(capturePattern);

0 commit comments

Comments
 (0)