mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-26 19:25:41 -05:00
handle cases when new expression is used with no arguments
This commit is contained in:
@@ -253,7 +253,8 @@ module ts.formatting {
|
||||
rangeContainsStartEnd((<CallExpression>node.parent).typeArguments, start, node.getEnd())) {
|
||||
return (<CallExpression>node.parent).typeArguments;
|
||||
}
|
||||
if (rangeContainsStartEnd((<CallExpression>node.parent).arguments, start, node.getEnd())) {
|
||||
if ((<CallExpression>node.parent).arguments &&
|
||||
rangeContainsStartEnd((<CallExpression>node.parent).arguments, start, node.getEnd())) {
|
||||
return (<CallExpression>node.parent).arguments;
|
||||
}
|
||||
break;
|
||||
|
||||
7
tests/cases/fourslash/indentNewExpressionNoBraces.ts
Normal file
7
tests/cases/fourslash/indentNewExpressionNoBraces.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////new Foo/*1*/
|
||||
|
||||
goTo.marker("1");
|
||||
edit.insert("\n");
|
||||
verify.indentationIs(0);
|
||||
Reference in New Issue
Block a user