File tree Expand file tree Collapse file tree 4 files changed +7
-9
lines changed
packages/cursorless-engine/src/processTargets/modifiers/scopeHandlers
CollectionItemScopeHandler Expand file tree Collapse file tree 4 files changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ import type {
1919 ScopeIteratorRequirements ,
2020} from "./scopeHandler.types" ;
2121import type { ScopeHandlerFactory } from "./ScopeHandlerFactory" ;
22- import { isHintsEveryScope } from "./util/isHintsEveryScope" ;
22+ import { isEveryScope } from "./util/isHintsEveryScope" ;
2323
2424abstract class BoundedBaseScopeHandler extends BaseScopeHandler {
2525 protected readonly isHierarchical = true ;
@@ -93,9 +93,7 @@ abstract class BoundedBaseScopeHandler extends BaseScopeHandler {
9393 {
9494 ...hints ,
9595 // For every (skipAncestorScopes=true) we don't want to go outside of the surrounding pair
96- containment : isHintsEveryScope ( hints )
97- ? "required"
98- : hints . containment ,
96+ containment : isEveryScope ( hints ) ? "required" : hints . containment ,
9997 } ,
10098 ) ,
10199 ) ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import type {
1414 ScopeIteratorRequirements ,
1515} from "../scopeHandler.types" ;
1616import type { ScopeHandlerFactory } from "../ScopeHandlerFactory" ;
17- import { isHintsEveryScope } from "../util/isHintsEveryScope" ;
17+ import { isEveryScope } from "../util/isHintsEveryScope" ;
1818import { OneWayNestedRangeFinder } from "../util/OneWayNestedRangeFinder" ;
1919import { OneWayRangeFinder } from "../util/OneWayRangeFinder" ;
2020import { collectionItemTextualIterationScopeHandler } from "./collectionItemTextualIterationScopeHandler" ;
@@ -43,7 +43,7 @@ export class CollectionItemTextualScopeHandler extends BaseScopeHandler {
4343 direction : Direction ,
4444 hints : ScopeIteratorRequirements ,
4545 ) : Iterable < TargetScope > {
46- const isEveryScope = isHintsEveryScope ( hints ) ;
46+ const isEveryScope = isEveryScope ( hints ) ;
4747 const separatorRanges = getSeparatorOccurrences ( editor . document ) ;
4848 const interiorRanges = getInteriorRanges (
4949 this . scopeHandlerFactory ,
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ import { BaseScopeHandler } from "../BaseScopeHandler";
88import { compareTargetScopes } from "../compareTargetScopes" ;
99import type { TargetScope } from "../scope.types" ;
1010import type { ScopeIteratorRequirements } from "../scopeHandler.types" ;
11- import { isHintsEveryScope } from "../util/isHintsEveryScope" ;
11+ import { isEveryScope } from "../util/isHintsEveryScope" ;
1212import { getQuerySearchRange } from "./getQuerySearchRange" ;
1313import { mergeAdjacentBy } from "./mergeAdjacentBy" ;
1414
@@ -25,7 +25,7 @@ export abstract class BaseTreeSitterScopeHandler extends BaseScopeHandler {
2525 hints : ScopeIteratorRequirements ,
2626 ) : Iterable < TargetScope > {
2727 const { document } = editor ;
28- const isEveryScope = isHintsEveryScope ( hints ) ;
28+ const isEveryScope = isEveryScope ( hints ) ;
2929
3030 /** Narrow the range within which tree-sitter searches, for performance */
3131 const { start, end } = getQuerySearchRange (
Original file line number Diff line number Diff line change @@ -3,6 +3,6 @@ import type { ScopeIteratorRequirements } from "../scopeHandler.types";
33/**
44 * Returns true if the hints belong to the every scope modifier.
55 */
6- export function isHintsEveryScope ( hints : ScopeIteratorRequirements ) : boolean {
6+ export function isEveryScope ( hints : ScopeIteratorRequirements ) : boolean {
77 return hints . containment == null && hints . skipAncestorScopes ;
88}
You can’t perform that action at this time.
0 commit comments