Skip to content

Commit

Permalink
Show error about missing iteration scope
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasArvidsson committed Jan 21, 2025
1 parent 876694f commit 8dc8844
Showing 1 changed file with 7 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,20 +73,13 @@ export class EveryScopeStage implements ModifierStage {
if (scopes == null) {
// If target had no explicit range, or was contained by a single target
// instance, expand to iteration scope before overlapping
try {
scopes = this.getDefaultIterationRange(
scopeHandler,
this.scopeHandlerFactory,
target,
).flatMap((iterationRange) =>
getScopesOverlappingRange(scopeHandler, editor, iterationRange),
);
} catch (error) {
if (!(error instanceof NoContainingScopeError)) {
throw error;
}
scopes = [];
}
scopes = this.getDefaultIterationRange(
scopeHandler,
this.scopeHandlerFactory,
target,
).flatMap((iterationRange) =>
getScopesOverlappingRange(scopeHandler, editor, iterationRange),
);
}

if (scopes.length === 0) {
Expand Down

0 comments on commit 8dc8844

Please sign in to comment.