Skip to content
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

Create scope type for link in a chain of field accesses #707

Open
6 tasks
pokey opened this issue May 30, 2022 · 5 comments
Open
6 tasks

Create scope type for link in a chain of field accesses #707

pokey opened this issue May 30, 2022 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@pokey
Copy link
Member

pokey commented May 30, 2022

In the following code:

foo.bar.baz(whatever).bongo;

This scope type would capture each of foo, bar, baz, baz(whatever), and bongo, and include the . in the removal range.

This scope type could work in many languages

See also #954 (comment). The scope type in that PR is equivalent to #473 applied to this scope type, so some of the questions there may be good test cases for this scope type

Languages

  • Python
  • C / C++
  • Java
  • C#
  • Typescript
  • PHP
@pokey pokey added the enhancement New feature or request label May 30, 2022
@pokey pokey added the good first issue Good for newcomers label Jun 10, 2022
@pokey pokey added this to To do in Expand the vocabulary via automation Jun 10, 2022
@pokey pokey mentioned this issue Jun 14, 2022
10 tasks
@AndreasArvidsson
Copy link
Member

Do you mean that this would result in multiple selections?

@pokey
Copy link
Member Author

pokey commented Sep 9, 2022

no

@pokey
Copy link
Member Author

pokey commented Sep 9, 2022

but the "every" version of this would result in multiple selections

@pokey pokey mentioned this issue Jun 8, 2023
10 tasks
github-merge-queue bot pushed a commit that referenced this issue Oct 19, 2023
- 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
cursorless-bot pushed a commit that referenced this issue Oct 19, 2023
- 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
fidgetingbits pushed a commit to fidgetingbits/cursorless that referenced this issue Nov 3, 2023
- 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
@pokey
Copy link
Member Author

pokey commented Dec 12, 2023

Had a use case yesterday where I wanted to bring an access after a function call. Eg

aaa.bbb()
ccc()

I wanted to do "bring access bat after cap", but had to settle for "bring access bat after call cap"

@pokey
Copy link
Member Author

pokey commented Feb 6, 2024

I just found myself having code aaa.bbb() and wanting to say "chuck access" to result in bbb()

thetomcraig-aya pushed a commit to thetomcraig/cursorless that referenced this issue Mar 27, 2024
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Development

No branches or pull requests

2 participants