Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ const testCases: { name: string; isOk: boolean; content: string }[] = [
isOk: true,
content: ";; (if_statement) @unknown",
},
{
name: "@ ending string",
isOk: true,
content: '"return@"',
},
{
name: "Unknown capture",
isOk: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ for (const captureName of captureNames) {
}

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

export function validateQueryCaptures(file: string, rawQuery: string): void {
const matches = rawQuery.matchAll(capturePattern);
Expand Down
15 changes: 7 additions & 8 deletions queries/kotlin.scm
Original file line number Diff line number Diff line change
Expand Up @@ -437,14 +437,13 @@
(_) @value
) @_.domain

;; Disabled due to Cursorless error ("invalid capture") caused by "return@"
;; (jump_expression
;; "return@"
;; .
;; (label)
;; .
;; (_) @value
;; ) @_.domain
(jump_expression
"return@"
.
(label)
.
(_) @value
) @_.domain

(_
(function_body
Expand Down
Loading