๐Code editing verbs
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!
navigation
move to function (by name search)
go to definition under cursor
search references
edit
add statement / delete statement
move statement up/down
extract variable
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?
wrapping
into parentheses
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
steps:
move definition
export it
import dependencies
re-import in the original module
remove unused dependencies from original module
attach debug information
console.log
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)
actions
REPL for test
google
interact with running program
Backlinks
- ๐ I do not think of code as text
- ๐ Editor
- ๐ Projectional Editor