mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 08:11:30 -06:00
fix class expression + expressionWithTypeArgument
This commit is contained in:
parent
f92aa8681a
commit
f832bd20f2
@ -715,6 +715,7 @@ namespace ts.formatting {
|
||||
case SyntaxKind.TypeReference:
|
||||
case SyntaxKind.TypeAssertionExpression:
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
case SyntaxKind.ClassExpression:
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
case SyntaxKind.FunctionExpression:
|
||||
@ -725,6 +726,7 @@ namespace ts.formatting {
|
||||
case SyntaxKind.ConstructSignature:
|
||||
case SyntaxKind.CallExpression:
|
||||
case SyntaxKind.NewExpression:
|
||||
case SyntaxKind.ExpressionWithTypeArguments:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
||||
@ -14,6 +14,13 @@
|
||||
////
|
||||
////foo()<number, string, T >();
|
||||
////(a + b)<number, string, T >();
|
||||
////
|
||||
////function bar<T>() {
|
||||
/////*inClassExpression*/ return class < T2 > {
|
||||
//// }
|
||||
////}
|
||||
/////*expressionWithTypeArguments*/class A < T > extends bar < T >( ) < T > {
|
||||
////}
|
||||
|
||||
|
||||
format.document();
|
||||
@ -33,4 +40,10 @@ goTo.marker("inNewSignature");
|
||||
verify.currentLineContentIs(" new <T>(a: T);");
|
||||
|
||||
goTo.marker("inOptionalMethodSignature");
|
||||
verify.currentLineContentIs(" op?<T, M>(a: T, b: M);");
|
||||
verify.currentLineContentIs(" op?<T, M>(a: T, b: M);");
|
||||
|
||||
goTo.marker("inClassExpression");
|
||||
verify.currentLineContentIs(" return class <T2> {");
|
||||
|
||||
goTo.marker("expressionWithTypeArguments");
|
||||
verify.currentLineContentIs("class A<T> extends bar<T>()<T> {");
|
||||
Loading…
x
Reference in New Issue
Block a user