File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -658,11 +658,10 @@ namespace ts.refactor.extractSymbol {
658658 case SyntaxKind . Constructor :
659659 return "constructor" ;
660660 case SyntaxKind . FunctionExpression :
661- return scope . name
662- ? `function expression '${ scope . name . text } '`
663- : "anonymous function expression" ;
664661 case SyntaxKind . FunctionDeclaration :
665- return `function '${ scope . name . text } '` ;
662+ return scope . name
663+ ? `function '${ scope . name . text } '`
664+ : "anonymous function" ;
666665 case SyntaxKind . ArrowFunction :
667666 return "arrow function" ;
668667 case SyntaxKind . MethodDeclaration :
Original file line number Diff line number Diff line change 1+ /// <reference path='fourslash.ts' />
2+
3+ ////export default function() {
4+ //// /*start*/0/*end*/
5+ //// }
6+
7+ goTo . select ( 'start' , 'end' )
8+ edit . applyRefactor ( {
9+ refactorName : "Extract Symbol" ,
10+ actionName : "function_scope_0" ,
11+ actionDescription : "Extract to inner function in anonymous function" ,
12+ newContent :
13+ `export default function() {
14+ /*RENAME*/newFunction();
15+
16+ function newFunction() {
17+ 0;
18+ }
19+ }`
20+ } ) ;
You can’t perform that action at this time.
0 commit comments