These are common operations performed on code. These are expected to form a vocabulary for code editing. Each example represents one action one wants to perform on the code (in the terms we think of code, not how we currently edit text).
Verbs are different for different programming languages!
- move to function (by name search)
- go to definition under cursor
- search references
- add statement / delete statement
- move statement up/down
variable should be extracted to the closest possible scope (to reduce possibility of side effects)
inline variable (reverse of extract variable)
- should we inline all variable occurrences?
- should we preserve the original variable?
- is it natural? why would I do that with structural editing?
- into function call
- into JSX element (or fragment)
- into control structures (if, for, while)
- into function definition
- unwrapping (basically same as wrappipng)
- convert arrow function body to expression/block
convert JSXElement to JSXSelfClosingElement and back
- do reverse automatically if I move into self-closing element?
- extract function (or component) / inline function
move to another module
- move definition
- export it
- import dependencies
- re-import in the original module
- remove unused dependencies from original module
attach debug information
- to react component
- comment out code (temporary disable code)
- change JSX element name
- duplicate function + change name (to modify it later)
- change expression (while keeping old value visible for reference)
- add comment (explaining, not comment out code)
- rename variable or function (with all usages)
- REPL for test
- interact with running program