TypeScript/tests/cases/fourslash/textChangesPreserveNewlines8.ts
Andrew Branch 7d4fc73331
Fix preserveNewlines printer option when a list child has the same start or end as its parent (#37846)
* Fix preserveNewlines printer option when a list child has the same start or end as its parent

* Fix leading line separator calculation and JSX bug
2020-04-21 15:34:30 -07:00

30 lines
471 B
TypeScript

// #37813
/// <reference path="fourslash.ts" />
////function foo() {
//// /*1*/var x: number
////
//// x = 10;
//// return x;/*2*/
////}
goTo.select("1", "2");
edit.applyRefactor({
refactorName: "Extract Symbol",
actionName: "function_scope_1",
actionDescription: "Extract to function in global scope",
newContent:
`function foo() {
return /*RENAME*/newFunction();
}
function newFunction() {
var x: number;
x = 10;
return x;
}
`
});