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

25 lines
528 B
TypeScript
Raw Normal View History

2017-08-10 22:07:42 +02:00
/// <reference path='fourslash.ts' />
// Preserve newlines correctly when semicolons aren't present
//// function fn() {
//// var q = /*a*/[0]/*b*/
//// q[0]++
//// }
goTo.select('a', 'b')
edit.applyRefactor({
refactorName: "Extract Symbol",
actionName: "function_scope_0",
actionDescription: "Extract to inner function in function 'fn'",
newContent:
`function fn() {
var q = /*RENAME*/newFunction()
2017-08-10 22:07:42 +02:00
q[0]++
function newFunction() {
return [0]
2017-08-10 22:07:42 +02:00
}
}`
});