cursorless icon indicating copy to clipboard operation
cursorless copied to clipboard

Create scope type for link in a chain of field accesses

Open pokey opened this issue 3 years ago • 5 comments

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 https://github.com/cursorless-dev/cursorless/pull/954#issuecomment-1243636384. The scope type in that PR is equivalent to https://github.com/cursorless-dev/cursorless/issues/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 avatar May 30 '22 20:05 pokey

Do you mean that this would result in multiple selections?

AndreasArvidsson avatar Sep 09 '22 14:09 AndreasArvidsson

no

pokey avatar Sep 09 '22 14:09 pokey

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

pokey avatar Sep 09 '22 14:09 pokey

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 avatar Dec 12 '23 21:12 pokey

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

pokey avatar Feb 06 '24 11:02 pokey