5f597e69b2
* Initial draft of named tuple members * Show tuple labels and documentation in completions * Swap allowed syntax to parameter-like * Add quickfix for labeled tuple syntax mistakes * Add refactoring to convert list of signatures to single overload * Fix small bug in visitor verification * Signature help for rest parameters which are unions of tuples are displayed as seperate entries now * Expand sanity check test cases in conformance suite * Add tests and code for preserving tuple names through spreads where possible * More refactoring tests, some comment preservation and some fixed formatting of multiline tuples * Handle missing parameter named in isValidDeclarationForTupleLabel * Minor text fixes
19 lines
611 B
TypeScript
19 lines
611 B
TypeScript
/// <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;
|
|
}`,
|
|
});
|