2017-08-05 01:10:33 +02:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
// New function names should be totally new to the file
|
|
|
|
|
|
|
|
//// function fn() {
|
|
|
|
//// /*a*/console.log("hi");/*b*/
|
|
|
|
//// }
|
2017-08-25 18:53:28 +02:00
|
|
|
////
|
2017-08-05 01:10:33 +02:00
|
|
|
//// function newFunction() { }
|
|
|
|
|
|
|
|
goTo.select('a', 'b')
|
2017-08-25 18:53:28 +02:00
|
|
|
edit.applyRefactor({
|
2017-09-15 01:04:44 +02:00
|
|
|
refactorName: "Extract Symbol",
|
|
|
|
actionName: "function_scope_0",
|
2017-09-09 14:52:52 +02:00
|
|
|
actionDescription: "Extract to inner function in function 'fn'",
|
2017-09-13 18:02:10 +02:00
|
|
|
newContent:
|
|
|
|
`function fn() {
|
|
|
|
/*RENAME*/newFunction_1();
|
2017-08-05 01:10:33 +02:00
|
|
|
|
|
|
|
function newFunction_1() {
|
|
|
|
console.log("hi");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-09-13 18:02:10 +02:00
|
|
|
function newFunction() { }`
|
|
|
|
});
|