TypeScript/tests/cases/fourslash/extract-method-uniqueName.ts
Andrew Casey 2ea4cfe23b Insert a line break before a function at EOF if needed
This is a pre-existing issue that became more obvious after refining
trivia handling.
2017-10-12 14:19:36 -07:00

22 lines
489 B
TypeScript

/// <reference path='fourslash.ts' />
////// newFunction
/////*start*/1 + 1/*end*/;
// NOTE: '// newFunction' should be included, but due to incorrect handling of trivia,
// it's omitted right now.
goTo.select('start', 'end')
edit.applyRefactor({
refactorName: "Extract Symbol",
actionName: "function_scope_0",
actionDescription: "Extract to function in global scope",
newContent:
`// newFunction
/*RENAME*/newFunction_1();
function newFunction_1() {
1 + 1;
}
`
});