Closed
Description
- Detect and disallow stranding of type parameters
- Disallow extraction of LHS of assignmentlike exprs (e.g. do not allow extracting
x
inx += 3
orx = 10
) - Need to sometimes insert whitespace before the substituted function call (e.g. when extracting
[]
fromreturn[]
) - Disallow extracting the empty statement
- Figure out what to do with decorators 😞
- Allow extraction of code in class methods into local functions if that code doesn't reference
this
- Disallow extracting into a class scope if
this
doesn't bind to an instance of the class at the call site -
getEditsForAction
can, and probably should, return the location of a Rename session to kick off - Trailing trivia on an expression is duplicated, appearing both in the new function and at the call site
- If the leading trivia on an expression contains a newline, it will be inserted after
return
in the extracted method, implicitly creating an empty return statement followed by an unreachable expression statement
All credit @amcasey