File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,19 +14,19 @@ export class SpanModification {
1414 * @remarks
1515 * Also, the modify() operation will not recurse into these spans.
1616 */
17- public omitChildren : boolean ;
17+ public omitChildren : boolean = false ;
1818
1919 /**
2020 * If true, then the Span.separator will be removed from the Span.getModifiedText() output.
2121 */
22- public omitSeparatorAfter : boolean ;
22+ public omitSeparatorAfter : boolean = false ;
2323
2424 /**
2525 * If true, then Span.getModifiedText() will sort the immediate children according to their Span.sortKey
2626 * property. The separators will also be fixed up to ensure correct indentation. If the Span.sortKey is undefined
2727 * for some items, those items will not be moved, i.e. their array indexes will be unchanged.
2828 */
29- public sortChildren : boolean ;
29+ public sortChildren : boolean = false ;
3030
3131 /**
3232 * Used if the parent span has Span.sortChildren=true.
@@ -133,7 +133,7 @@ export class Span {
133133
134134 public constructor ( node : ts . Node ) {
135135 this . node = node ;
136- this . startIndex = node . getStart ( ) ;
136+ this . startIndex = node . kind === ts . SyntaxKind . SourceFile ? node . getFullStart ( ) : node . getStart ( ) ;
137137 this . endIndex = node . end ;
138138 this . _separatorStartIndex = 0 ;
139139 this . _separatorEndIndex = 0 ;
You can’t perform that action at this time.
0 commit comments