-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add "access"
scope type
#1519
Add "access"
scope type
#1519
Conversation
( | ||
(member_expression | ||
object: (call_expression | ||
function: (_) @dummy |
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 call nodes like this where we're just using them to allow us to write a predicate that rejects the pattern. We should probably standardize on something that allows multiple per pattern, because in the future I'd like to be strict about allowable capture names to detect typos in capture names, which today just result in scopes silently not working
ab22d0d
to
fccb908
Compare
I don't think the dot should be part of the content range. I view this as a delimiter. I definitely understand what you mean about the test cases. On fixture for multiple languages might be reasonable. |
yeah I'm on the fence, because it is a bit like a delimiter, but not quite. Comparing it to "arg", in that case, an arg can exist without the To make it a delimiter, we'd need to:
Which are not unreasonable anyway imo |
I guess one argument to treat it as a delimiter is that the decision to use |
aligned on having it be delimiter, so need the extra things above |
Update from meet-up (see #1923 (comment) for more context):
|
fccb908
to
2862db6
Compare
Ok it's now a private scope type. You'll need to add a line like the following to your
@AndreasArvidsson it's worth giving this a whirl to make sure that:
NOTE to anyone stumbling across this PR: if you do not heed the warning above, and do paste the above lines in your CSV, please at least subscribe to notifications for this PR; we'll leave a message here when we deactivate this feature in the future 😊 |
Keep in mind that someone could still copy one of our settings csvs and get it that way, but hopefully the comment helps 🤷 |
Tested and works as expected This is also one of those scopes where I would like to have a text based fall back :D |
Yeah that would be nice. Could prob build something using the pair scopes once those are migrated |
@AndreasArvidsson I think this one is good to go when you get a minute |
There are a lot of unfinished tasks on this pr and, but you're still happy to merge? |
yeah I should prob check them, but I left them because this PR is really kind of unfinished but we want to merge it as a private feature to get some feedback from real use |
- Implements #707 for Typescript - Implements #707 for Python ## Questions - [ ] Unfortunately, both the queries and tests are almost identically duplicated between Typescript and Python 😕. - [ ] I wonder if we should support some kind of templating language, eg handlebars, along with a meta-updater-style approach where we keep the generated files in source control as well - [ ] For the test cases, we could maybe support a list of language ids in the recorded test yaml 🤷♂️ - [ ] Also, should the `.` be considered part of the content range, or just the removal range? - [ ] Should a function call on its own be considered `"access"`? eg `foo()`. What about an identifier on its own, eg `foo`? ## Checklist - [ ] Make it so eg `bar` or `foo()` on its own is an access? That might cover a lot of things 🤔. Eg what happens with something in parens? That could end up as part of access, eg `(a + b).c` - [ ] What does happen with `(a + b).c`? - [x] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [x] 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) - [x] I have not broken the cheatsheet
- Implements cursorless-dev#707 for Typescript - Implements cursorless-dev#707 for Python ## Questions - [ ] Unfortunately, both the queries and tests are almost identically duplicated between Typescript and Python 😕. - [ ] I wonder if we should support some kind of templating language, eg handlebars, along with a meta-updater-style approach where we keep the generated files in source control as well - [ ] For the test cases, we could maybe support a list of language ids in the recorded test yaml 🤷♂️ - [ ] Also, should the `.` be considered part of the content range, or just the removal range? - [ ] Should a function call on its own be considered `"access"`? eg `foo()`. What about an identifier on its own, eg `foo`? ## Checklist - [ ] Make it so eg `bar` or `foo()` on its own is an access? That might cover a lot of things 🤔. Eg what happens with something in parens? That could end up as part of access, eg `(a + b).c` - [ ] What does happen with `(a + b).c`? - [x] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [x] 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) - [x] I have not broken the cheatsheet
- Implements cursorless-dev#707 for Typescript - Implements cursorless-dev#707 for Python ## Questions - [ ] Unfortunately, both the queries and tests are almost identically duplicated between Typescript and Python 😕. - [ ] I wonder if we should support some kind of templating language, eg handlebars, along with a meta-updater-style approach where we keep the generated files in source control as well - [ ] For the test cases, we could maybe support a list of language ids in the recorded test yaml 🤷♂️ - [ ] Also, should the `.` be considered part of the content range, or just the removal range? - [ ] Should a function call on its own be considered `"access"`? eg `foo()`. What about an identifier on its own, eg `foo`? ## Checklist - [ ] Make it so eg `bar` or `foo()` on its own is an access? That might cover a lot of things 🤔. Eg what happens with something in parens? That could end up as part of access, eg `(a + b).c` - [ ] What does happen with `(a + b).c`? - [x] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [x] 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) - [x] I have not broken the cheatsheet
Questions
.
be considered part of the content range, or just the removal range?"access"
? egfoo()
. What about an identifier on its own, egfoo
?Checklist
bar
orfoo()
on its own is an access? That might cover a lot of things 🤔. Eg what happens with something in parens? That could end up as part of access, eg(a + b).c
(a + b).c
?