-
Notifications
You must be signed in to change notification settings - Fork 12.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More refactoring tests, some comment preservation and some fixed form…
…atting of multiline tuples
- Loading branch information
Showing
13 changed files
with
220 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
tests/cases/fourslash/refactorOverloadListToSingleSignature3.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
/////*a*/function foo(): void; | ||
////function foo(a: string): void; | ||
////function foo(a: number, b: number): void; | ||
////function foo(...rest: symbol[]): void;/*b*/ | ||
////function foo(...args: any[]): void { | ||
//// // body | ||
////} | ||
|
||
goTo.select("a", "b"); | ||
edit.applyRefactor({ | ||
refactorName: "Convert overload list to single signature", | ||
actionName: "Convert overload list to single signature", | ||
actionDescription: ts.Diagnostics.Convert_overload_list_to_single_signature.message, | ||
newContent: `function foo(...args: [] | [a: string] | [a: number, b: number] | [...rest: symbol[]]): void { | ||
// body | ||
}`, | ||
}); |
23 changes: 23 additions & 0 deletions
23
tests/cases/fourslash/refactorOverloadListToSingleSignature4.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
////class A { | ||
//// /*a*/foo(): void; | ||
//// foo(a: string): void; | ||
//// foo(a: number, b: number): void; | ||
//// foo(...rest: symbol[]): void;/*b*/ | ||
//// foo(...args: any[]): void { | ||
//// // body | ||
//// } | ||
////} | ||
|
||
goTo.select("a", "b"); | ||
edit.applyRefactor({ | ||
refactorName: "Convert overload list to single signature", | ||
actionName: "Convert overload list to single signature", | ||
actionDescription: ts.Diagnostics.Convert_overload_list_to_single_signature.message, | ||
newContent: `class A { | ||
foo(...args: [] | [a: string] | [a: number, b: number] | [...rest: symbol[]]): void { | ||
// body | ||
} | ||
}`, | ||
}); |
23 changes: 23 additions & 0 deletions
23
tests/cases/fourslash/refactorOverloadListToSingleSignature5.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
////class A { | ||
//// /*a*/constructor(); | ||
//// constructor(a: string); | ||
//// constructor(a: number, b: number); | ||
//// constructor(...rest: symbol[]);/*b*/ | ||
//// constructor(...args: any[]) { | ||
//// // body | ||
//// } | ||
////} | ||
|
||
goTo.select("a", "b"); | ||
edit.applyRefactor({ | ||
refactorName: "Convert overload list to single signature", | ||
actionName: "Convert overload list to single signature", | ||
actionDescription: ts.Diagnostics.Convert_overload_list_to_single_signature.message, | ||
newContent: `class A { | ||
constructor(...args: [] | [a: string] | [a: number, b: number] | [...rest: symbol[]]) { | ||
// body | ||
} | ||
}`, | ||
}); |
18 changes: 18 additions & 0 deletions
18
tests/cases/fourslash/refactorOverloadListToSingleSignature6.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
////interface A { | ||
//// /*a*/(): void; | ||
//// (a: string): void; | ||
//// (a: number, b: number): void; | ||
//// (...rest: symbol[]): void;/*b*/ | ||
////} | ||
|
||
goTo.select("a", "b"); | ||
edit.applyRefactor({ | ||
refactorName: "Convert overload list to single signature", | ||
actionName: "Convert overload list to single signature", | ||
actionDescription: ts.Diagnostics.Convert_overload_list_to_single_signature.message, | ||
newContent: `interface A { | ||
(...args: [] | [a: string] | [a: number, b: number] | [...rest: symbol[]]): void; | ||
}`, | ||
}); |
18 changes: 18 additions & 0 deletions
18
tests/cases/fourslash/refactorOverloadListToSingleSignature7.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
////interface A { | ||
//// /*a*/new (): void; | ||
//// new (a: string): void; | ||
//// new (a: number, b: number): void; | ||
//// new (...rest: symbol[]): void;/*b*/ | ||
////} | ||
|
||
goTo.select("a", "b"); | ||
edit.applyRefactor({ | ||
refactorName: "Convert overload list to single signature", | ||
actionName: "Convert overload list to single signature", | ||
actionDescription: ts.Diagnostics.Convert_overload_list_to_single_signature.message, | ||
newContent: `interface A { | ||
new(...args: [] | [a: string] | [a: number, b: number] | [...rest: symbol[]]): void; | ||
}`, | ||
}); |
18 changes: 18 additions & 0 deletions
18
tests/cases/fourslash/refactorOverloadListToSingleSignature8.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/// <reference path='fourslash.ts' /> | ||
|
||
////interface A { | ||
//// /*a*/foo(): void; | ||
//// foo(a: string): void; | ||
//// foo(a: number, b: number): void; | ||
//// foo(...rest: symbol[]): void;/*b*/ | ||
////} | ||
|
||
goTo.select("a", "b"); | ||
edit.applyRefactor({ | ||
refactorName: "Convert overload list to single signature", | ||
actionName: "Convert overload list to single signature", | ||
actionDescription: ts.Diagnostics.Convert_overload_list_to_single_signature.message, | ||
newContent: `interface A { | ||
foo(...args: [] | [a: string] | [a: number, b: number] | [...rest: symbol[]]): void; | ||
}`, | ||
}); |