TypeScript/tests/cases/fourslash/extract-method19.ts

27 lines
574 B
TypeScript
Raw Normal View History

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-05 01:10:33 +02:00
//// function newFunction() { }
goTo.select('a', 'b')
edit.applyRefactor({
refactorName: "Extract Symbol",
actionName: "function_scope_0",
actionDescription: "Extract to inner function in function 'fn'",
newContent:
`function fn() {
/*RENAME*/newFunction_1();
2017-08-05 01:10:33 +02:00
function newFunction_1() {
console.log("hi");
}
}
function newFunction() { }`
});