@@ -303,8 +303,8 @@ enum IndentScope {
303
303
/// A capture from the indent query which does not define an indent but extends
304
304
/// the range of a node. This is used before the indent is calculated.
305
305
enum ExtendCapture {
306
- ExtendIndented ,
307
- StopExtend ,
306
+ Extend ,
307
+ PreventOnce ,
308
308
}
309
309
310
310
/// The result of running a tree-sitter indent query. This stores for
@@ -394,18 +394,18 @@ fn query_indents(
394
394
let capture_type = match capture_name {
395
395
"indent" => IndentCaptureType :: Indent ,
396
396
"outdent" => IndentCaptureType :: Outdent ,
397
- "extend-indented " => {
397
+ "extend" => {
398
398
extend_captures
399
399
. entry ( capture. node . id ( ) )
400
400
. or_insert_with ( || Vec :: with_capacity ( 1 ) )
401
- . push ( ExtendCapture :: ExtendIndented ) ;
401
+ . push ( ExtendCapture :: Extend ) ;
402
402
continue ;
403
403
}
404
- "stop- extend" => {
404
+ "extend.prevent-once " => {
405
405
extend_captures
406
406
. entry ( capture. node . id ( ) )
407
407
. or_insert_with ( || Vec :: with_capacity ( 1 ) )
408
- . push ( ExtendCapture :: StopExtend ) ;
408
+ . push ( ExtendCapture :: PreventOnce ) ;
409
409
continue ;
410
410
}
411
411
_ => {
@@ -478,10 +478,10 @@ fn extend_nodes<'a>(
478
478
if let Some ( captures) = extend_captures. get ( & deepest_preceding. id ( ) ) {
479
479
for capture in captures {
480
480
match capture {
481
- ExtendCapture :: StopExtend => {
481
+ ExtendCapture :: PreventOnce => {
482
482
stop_extend = true ;
483
483
}
484
- ExtendCapture :: ExtendIndented => {
484
+ ExtendCapture :: Extend => {
485
485
node_captured = true ;
486
486
// We extend the node if
487
487
// - the cursor is on the same line as the end of the node OR
@@ -574,8 +574,8 @@ pub fn treesitter_indent_for_pos(
574
574
. descendant_for_byte_range ( byte_pos, byte_pos) ?;
575
575
let ( query_result, deepest_preceding) = {
576
576
// The query range should intersect with all nodes directly preceding
577
- // the cursor in case one of them is extended.
578
- let mut deepest_preceding = None ; // The deepest node preceding the cursor
577
+ // the position of the indent query in case one of them is extended.
578
+ let mut deepest_preceding = None ; // The deepest node preceding the indent query position
579
579
let mut tree_cursor = node. walk ( ) ;
580
580
for child in node. children ( & mut tree_cursor) {
581
581
if child. byte_range ( ) . end <= byte_pos {
0 commit comments