mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-09 07:21:18 -05:00
fix class expression + expressionWithTypeArgument
This commit is contained in:
@@ -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> {");
|
||||
Reference in New Issue
Block a user