File tree Expand file tree Collapse file tree 2 files changed +12
-34
lines changed
packages/cursorless-engine/src/languages/TreeSitterQuery Expand file tree Collapse file tree 2 files changed +12
-34
lines changed Original file line number Diff line number Diff line change @@ -19,17 +19,6 @@ class NotType extends QueryPredicateOperator<NotType> {
1919 }
2020}
2121
22- /**
23- * A predicate operator that returns true if the nodes range is not empty.
24- */
25- class NotEmpty extends QueryPredicateOperator < NotEmpty > {
26- name = "not-empty?" as const ;
27- schema = z . tuple ( [ q . node ] ) ;
28- run ( { range } : MutableQueryCapture ) {
29- return ! range . isEmpty ;
30- }
31- }
32-
3322/**
3423 * A predicate operator that returns true if the node's parent is not of the
3524 * given type. For example, `(not-parent-type? @foo string)` will reject the
@@ -208,7 +197,6 @@ class InsertionDelimiter extends QueryPredicateOperator<InsertionDelimiter> {
208197export const queryPredicateOperators = [
209198 new Log ( ) ,
210199 new NotType ( ) ,
211- new NotEmpty ( ) ,
212200 new NotParentType ( ) ,
213201 new IsNthChild ( ) ,
214202 new ChildRange ( ) ,
Original file line number Diff line number Diff line change 2525 (parrot_declaration)
2626] @statement
2727
28- (
29- [
30- (matches)
31- (declarations)
32- (block)
33- ] @statement.iteration
34-
35- ;; The Talon Tree sitter can contain an empty matches node if there is no
36- ;; header. When this happens and the user has an empty cursor at the start of
37- ;; the document we get an empty range for the iteration scope for
38- ;; key/value/name/statement.
39- (#not-empty? @statement.iteration )
40- )
28+ [
29+ (matches)
30+ (declarations)
31+ (block)
32+ ] @statement.iteration
4133
4234;; !! not mode: command
4335;; ! ----^^^^---------
10799;; ! -------------
108100;; !! foo: key(a)
109101;; ! -----------]
110- (
111- (source_file
112- (matches) @condition @_.trailing
113- ) @_.domain
114- (#not-empty? @condition )
115- (#not-empty? @_.trailing )
116- (#shrink-to-match! @condition "^(?<keep>.*)(\s|\n|\r)+-$")
117- (#shrink-to-match! @_.trailing "^.*(?<keep>(\s|\n|\r)+-)$")
118- )
102+ (source_file
103+ (matches
104+ (_) @condition.end.endOf
105+ .
106+ "-" @_.trailing
107+ ) @condition.start.startOf
108+ ) @_.domain
119109
120110;; !! slap: key(enter)
121111;; ! ^^^^^^^^^^^^^^^^
You can’t perform that action at this time.
0 commit comments