2019-05-07 17:26:54 +02:00
|
|
|
/// <reference path='fourslash.ts' />
|
|
|
|
|
|
|
|
//// function foo(a: number, b?: /*a*/number/*b*/, ...c: number[]): boolean {
|
2019-06-06 19:28:42 +02:00
|
|
|
//// return false as boolean;
|
2019-05-07 17:26:54 +02:00
|
|
|
//// }
|
|
|
|
|
|
|
|
goTo.select("a", "b");
|
|
|
|
edit.applyRefactor({
|
|
|
|
refactorName: "Extract type",
|
|
|
|
actionName: "Extract to type alias",
|
|
|
|
actionDescription: "Extract to type alias",
|
|
|
|
newContent: `type /*RENAME*/NewType = number;
|
|
|
|
|
|
|
|
function foo(a: number, b?: NewType, ...c: number[]): boolean {
|
2019-06-06 19:28:42 +02:00
|
|
|
return false as boolean;
|
2019-05-07 17:26:54 +02:00
|
|
|
}`,
|
|
|
|
});
|