Skip to content

Commit 00d5f9a

Browse files
Rename predicate
1 parent ff0e3ba commit 00d5f9a

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ import { q } from "./operatorArgumentSchemaTypes";
88

99
/**
1010
* A predicate operator that returns true if the node is of the given type.
11-
* For example, `(#is-type? @foo string)` will accept the match if the `@foo`
11+
* For example, `(#type? @foo string)` will accept the match if the `@foo`
1212
* capture is a `string` node. It is acceptable to pass in multiple types, e.g.
13-
* `(#is-type? @foo string comment)`.
13+
* `(#type? @foo string comment)`.
1414
*/
15-
class IsType extends QueryPredicateOperator<IsType> {
16-
name = "is-type?" as const;
15+
class Type extends QueryPredicateOperator<Type> {
16+
name = "type?" as const;
1717
schema = z.tuple([q.node, q.string]).rest(q.string);
1818
run({ node }: MutableQueryCapture, ...types: string[]) {
1919
return types.includes(node.type);
@@ -388,7 +388,7 @@ class EmptySingleMultiDelimiter extends QueryPredicateOperator<EmptySingleMultiD
388388

389389
export const queryPredicateOperators = [
390390
new Log(),
391-
new IsType(),
391+
new Type(),
392392
new NotType(),
393393
new TrimEnd(),
394394
new DocumentRange(),

queries/ruby.scm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
(yield)
8080
] @statement
8181
) @_dummy
82-
(#is-type?
82+
(#type?
8383
@_dummy
8484
begin_block
8585
begin

0 commit comments

Comments
 (0)