mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
fix generics/type-assertion formatting
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
//// }
|
||||
////}
|
||||
/////*typeArguments*/var foo = new Foo < number, Array < number > > ( );
|
||||
/////*typeArgumentsWithTypeLiterals*/foo = new Foo < { bar : number }, Array < { baz : string } > > ( );
|
||||
////
|
||||
////interface IFoo {
|
||||
/////*inNewSignature*/new < T > ( a: T);
|
||||
@@ -25,6 +26,8 @@ verify.currentLineContentIs(" public method<T3, T4>(a: T1, b: Array<T4>): Map
|
||||
|
||||
goTo.marker("typeArguments");
|
||||
verify.currentLineContentIs("var foo = new Foo<number, Array<number>>();");
|
||||
goTo.marker("typeArgumentsWithTypeLiterals");
|
||||
verify.currentLineContentIs("foo = new Foo<{ bar: number }, Array<{ baz: string }>>();");
|
||||
|
||||
goTo.marker("inNewSignature");
|
||||
verify.currentLineContentIs(" new <T>(a: T);");
|
||||
|
||||
13
tests/cases/fourslash/typeAssertionsFormatting.ts
Normal file
13
tests/cases/fourslash/typeAssertionsFormatting.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////( < any > publisher);/*1*/
|
||||
//// < any > 3;/*2*/
|
||||
|
||||
|
||||
format.document();
|
||||
|
||||
goTo.marker("1");
|
||||
verify.currentLineContentIs("(<any>publisher);");
|
||||
|
||||
goTo.marker("2");
|
||||
verify.currentLineContentIs("<any>3;");
|
||||
Reference in New Issue
Block a user