File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1- ///<reference path='..\services.ts' />
1+ ///<reference path='..\services.ts' />
22///<reference path='formattingScanner.ts' />
33///<reference path='rulesProvider.ts' />
44///<reference path='references.ts' />
@@ -542,6 +542,16 @@ namespace ts.formatting {
542542 }
543543 }
544544 if ( suppressDelta ) {
545+ // if list end token is LessThanToken '>' then its delta should be explicitly suppressed
546+ // so that LessThanToken as a binary operator can still be indented.
547+ // foo.then
548+ // <
549+ // number,
550+ // string,
551+ // >();
552+ // vs
553+ // var a = xValue
554+ // > yValue;
545555 return indentation ;
546556 }
547557 else {
@@ -722,6 +732,10 @@ namespace ts.formatting {
722732 consumeTokenAndAdvanceScanner ( tokenInfo , parent , parentDynamicIndentation , parent ) ;
723733
724734 if ( indentationOnLastIndentedLine !== Constants . Unknown ) {
735+ // scanner just processed list start token so consider last indentation as list indentation
736+ // function foo(): { // last indentation was 0, list item will be indented based on this value
737+ // foo: number;
738+ // }: {};
725739 indentationOnListStartToken = indentationOnLastIndentedLine ;
726740 }
727741 else {
You can’t perform that action at this time.
0 commit comments