Merge pull request #4303 from SaschaNaz/fixClassExpressionFormatting
Fix formatting for class expression + expressionWithTypeArguments
This commit is contained in:
commit
82b78d85d7
|
@ -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…
Reference in a new issue