Skip to content

update inside / outside #254

Open
Open
@pokey

Description

@pokey
  • "inside" / "outside" / "pair" can be applied to anything that has an interior and scope starters / enders, eg an if statement, surrounding pairs, functions, strings, etc. We should handle the syntactic ones as part of Change scopeType matchers to rely on tree-sitter style scheme queries #616
    • Clojure scopes, to be able to say eg "take core list" and "round repack list"
    • If statements: with an else it 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.csv in 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 Switch targets to object-oriented #210

This will be implemented in phases:

  1. Initial work during Change surrounding delimiter api #225
  2. Do more in Switch targets to object-oriented #210

See also #713

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions