cursorless
cursorless copied to clipboard
update inside / outside
- [ ] "inside" / "outside" / "pair" can be applied to anything that has an interior and scope starters / enders, eg an
ifstatement, surrounding pairs, functions, strings, etc. We should handle the syntactic ones as part of #616- [ ] Clojure scopes, to be able to say eg "take core list" and "round repack list"
- [ ] If statements: with an
elseit would yield two targets (or more for else-ifs) - [ ] Switch statements
- [ ] Function / class / anything with a code block
- [ ] HTML elements
- [ ] HTML tags
- [ ] Question: do we want the above to apply to items in delimited sequences, such as args, tokens, lines, etc? Eg "chuck inside line" could be useful for removing contents of a line but leaving an empty line there
- [ ] separately, we have "leading" / "trailing" that refer to the delimiters before or after items in delimited sequences, eg the commas in an arg list, or whitespace for tokens
- [ ] We want "inside" without any scope type to automatically refer to the nearest applicable scope, not including the "space" surrounding pari type
- [ ] The above modifiers will just go into a
modifiers.csvin cursorless-settings - [ ] If you say "chuck inside list" it will remove everything inside list including whitespace padding
- [ ] If you say "clear inside list" it will not remove whitespace padding inside
- [ ] If you say "chuck leading inside list" it will remove leading padding in the list
- [ ] If you say "chuck trailing string" it will remove whitespace after the string
- [ ] If you say "chuck list" it will remove list and trailing whitespace
- [ ] "chuck trailing line" will remove trailing newline
- [ ] Note that part of this change is that we remove target preferences for inside / outside and instead let them use removal ranges per #210
This will be implemented in phases:
- Initial work during #225
- Do more in #210
See also #713
I'm gonna take a crack at inside element because that one is so useful
Yeah that's fair. Was hoping to wait until #629, but this one is too useful to hold off I think
Prob easiest to just add an interiorRange attribute to the legacy SelectionContext?
Once we have #629 we can add weak expansion support that will stop if it hits a scope type that supports inside, so that we can just say "take inside air" for anything inside an element.
Exactly the plan
Started work in #851