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')
|
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() {
|
|
|
|
var q = /*RENAME*/newFunction()
|
2017-08-10 22:07:42 +02:00
|
|
|
q[0]++
|
|
|
|
|
|
|
|
function newFunction() {
|
2019-08-29 01:28:31 +02:00
|
|
|
return [0]
|
2017-08-10 22:07:42 +02:00
|
|
|
}
|
2017-09-13 18:02:10 +02:00
|
|
|
}`
|
|
|
|
});
|