2017-09-13 18:02:10 +02:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
2018-05-30 23:11:53 +02:00
|
|
|
////const newFunction = 0;
|
2017-09-13 18:02:10 +02:00
|
|
|
/////*start*/1 + 1/*end*/;
|
|
|
|
|
|
|
|
goTo.select('start', 'end')
|
|
|
|
edit.applyRefactor({
|
2017-09-15 01:04:44 +02:00
|
|
|
refactorName: "Extract Symbol",
|
|
|
|
actionName: "function_scope_0",
|
2017-09-13 18:02:10 +02:00
|
|
|
actionDescription: "Extract to function in global scope",
|
|
|
|
newContent:
|
2018-05-30 23:11:53 +02:00
|
|
|
`const newFunction = 0;
|
2017-10-12 20:34:34 +02:00
|
|
|
/*RENAME*/newFunction_1();
|
2017-10-12 20:37:31 +02:00
|
|
|
|
2017-09-13 18:02:10 +02:00
|
|
|
function newFunction_1() {
|
|
|
|
1 + 1;
|
|
|
|
}
|
|
|
|
`
|
|
|
|
});
|