-
-
Notifications
You must be signed in to change notification settings - Fork 81
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
Support multiple targets per scope #1509
Conversation
84f562b
to
d88ec85
Compare
84aeab2
to
04cf9b8
Compare
d88ec85
to
809c4ed
Compare
04cf9b8
to
65a080a
Compare
809c4ed
to
de7311a
Compare
65a080a
to
538f8b7
Compare
de7311a
to
db10418
Compare
538f8b7
to
980ad18
Compare
if (targets1.length !== 1 || targets2.length !== 1) { | ||
throw Error("Scope range targets must be single-target"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasn't sure what to do in this case. seems like a corner case that will never happen. But basically it's if user says "take tags air past bat", which doesn't really make any sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the punchline. We merge tree-sitter scopes with the same domain. See #1507 for a change that requires developer to specifically tag these captures with #allow-multiple!
@@ -89,7 +89,7 @@ function processSurroundingPairCore( | |||
return findSurroundingPairTextBased( | |||
editor, | |||
range, | |||
containingScope.contentRange, | |||
containingScope[0].contentRange, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasn't sure what to do here, but I don't think it matters too much: it's for legacy surrounding pair modifier, and would be the situation where there are is a text fragment capture that has multiple targets, which I can't really see being a case we'll need to support. In #1507 we actually throw an error if they try to use #allow-multiple!
for a text fragment
23fcbff
to
7f02822
Compare
db10418
to
62d4370
Compare
7f02822
to
da0805c
Compare
da0805c
to
df5c834
Compare
df5c834
to
c6e6679
Compare
1843991
to
efaf773
Compare
c6e6679
to
1f71bf0
Compare
efaf773
to
98daf2c
Compare
fbc0e27
to
8734be6
Compare
a2159f7
to
3b1cfff
Compare
8734be6
to
726f7c2
Compare
3b1cfff
to
0edf161
Compare
726f7c2
to
ba21794
Compare
ba21794
to
c64f7b4
Compare
#1507) - Depends on #1509 - Fixes #1481 ## Checklist - [ ] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [ ] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [ ] I have not broken the cheatsheet
#child-range!
predicate #1506Checklist