File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -658,11 +658,10 @@ namespace ts.refactor.extractSymbol {
658
658
case SyntaxKind . Constructor :
659
659
return "constructor" ;
660
660
case SyntaxKind . FunctionExpression :
661
- return scope . name
662
- ? `function expression '${ scope . name . text } '`
663
- : "anonymous function expression" ;
664
661
case SyntaxKind . FunctionDeclaration :
665
- return `function '${ scope . name . text } '` ;
662
+ return scope . name
663
+ ? `function '${ scope . name . text } '`
664
+ : "anonymous function" ;
666
665
case SyntaxKind . ArrowFunction :
667
666
return "arrow function" ;
668
667
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