Skip to content

Omnibus: Known low-pri remaining bugs in Extract Method #17730

Closed
@RyanCavanaugh

Description

@RyanCavanaugh
  • Detect and disallow stranding of type parameters
  • Disallow extraction of LHS of assignmentlike exprs (e.g. do not allow extracting x in x += 3 or x = 10)
  • Need to sometimes insert whitespace before the substituted function call (e.g. when extracting [] from return[])
  • 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

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptDomain: Refactoringse.g. extract to constant or function, rename symbolMeta-IssueAn issue about the team, or the direction of TypeScript

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions