-
-
Notifications
You must be signed in to change notification settings - Fork 91
Migrate collection item and argument scopes #2081
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
1046522
4daa292
f90eedd
6ddfe3f
32e2277
aca116e
7420dec
4dbd9f5
bb0e6a6
b0e3331
6fd01d1
45f96b1
1126918
2878f44
685af60
1956c86
c85623e
17657f3
d484c2b
265aee8
11e4ebb
33fdd5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
import { SimpleScopeTypeType } from "@cursorless/common"; | ||
import { NodeMatcherAlternative } from "../typings/Types"; | ||
import { argumentMatcher, createPatternMatchers } from "../util/nodeMatchers"; | ||
import { createPatternMatchers } from "../util/nodeMatchers"; | ||
|
||
const nodeMatchers: Partial< | ||
Record<SimpleScopeTypeType, NodeMatcherAlternative> | ||
> = { | ||
collectionItem: "jsx_attribute", | ||
argumentOrParameter: argumentMatcher("formal_parameters", "arguments"), | ||
}; | ||
|
||
export const patternMatchers = createPatternMatchers(nodeMatchers); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,13 +73,17 @@ 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 | ||
scopes = this.getDefaultIterationRange( | ||
scopeHandler, | ||
this.scopeHandlerFactory, | ||
target, | ||
).flatMap((iterationRange) => | ||
getScopesOverlappingRange(scopeHandler, editor, iterationRange), | ||
); | ||
try { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True. Fixed now There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just commenting from the future to say that we removed this :D #2740 |
||
scopes = this.getDefaultIterationRange( | ||
scopeHandler, | ||
this.scopeHandlerFactory, | ||
target, | ||
).flatMap((iterationRange) => | ||
getScopesOverlappingRange(scopeHandler, editor, iterationRange), | ||
); | ||
} catch (error) { | ||
scopes = []; | ||
} | ||
} | ||
|
||
if (scopes.length === 0) { | ||
|
Uh oh!
There was an error while loading. Please reload this page.