File tree Expand file tree Collapse file tree 2 files changed +3
-17
lines changed
packages/cursorless-engine/src/languages/TreeSitterQuery Expand file tree Collapse file tree 2 files changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -49,17 +49,6 @@ export interface QueryCapture {
4949 hasError ( ) : boolean ;
5050}
5151
52- /**
53- * A capture of a query pattern against a syntax tree that can be modified.
54- */
55- export interface ModifiableQueryCapture {
56- readonly name : string ;
57- range : Range ;
58- allowMultiple : boolean ;
59- insertionDelimiter : string | undefined ;
60- hasError ( ) : boolean ;
61- }
62-
6352/**
6453 * A match of a query pattern against a syntax tree.
6554 */
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import type { Query } from "web-tree-sitter";
55import { ide } from "../../singletons/ide.singleton" ;
66import { getNodeRange } from "../../util/nodeSelectors" ;
77import type {
8- ModifiableQueryCapture ,
98 MutableQueryCapture ,
109 MutableQueryMatch ,
1110 QueryMatch ,
@@ -150,10 +149,10 @@ function createQueryMatch(
150149 match : MutableQueryMatch ,
151150 isTesting : boolean ,
152151) : QueryMatch {
153- const result : ModifiableQueryCapture [ ] = [ ] ;
152+ const result : MutableQueryCapture [ ] = [ ] ;
154153 const resultMap = new Map <
155154 string ,
156- { acc : ModifiableQueryCapture ; captures : MutableQueryCapture [ ] }
155+ { acc : MutableQueryCapture ; captures : MutableQueryCapture [ ] }
157156 > ( ) ;
158157
159158 // Merge the ranges of all captures with the same name into a single
@@ -168,11 +167,9 @@ function createQueryMatch(
168167
169168 if ( existing == null ) {
170169 const accumulator = {
170+ ...capture ,
171171 name,
172172 range,
173- allowMultiple : capture . allowMultiple ,
174- insertionDelimiter : capture . insertionDelimiter ,
175- hasError : ( ) => capture . hasError ( ) ,
176173 } ;
177174 result . push ( accumulator ) ;
178175 resultMap . set ( name , {
You can’t perform that action at this time.
0 commit comments