Skip to content

Commit 5225b40

Browse files
author
Armando Aguirre
committed
Addedn rangeContainsRange helper function
1 parent 8683ac9 commit 5225b40

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/services/formatting/formatting.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,8 @@ namespace ts.formatting {
665665

666666
// if child is a list item - try to get its indentation, only if parent is within the original range.
667667
let childIndentationAmount = Constants.Unknown;
668-
if (isListItem && parent.pos >= originalRange.pos && parent.end <= originalRange.end) {
668+
669+
if (isListItem && rangeContainsRange(originalRange, parent)) {
669670
childIndentationAmount = tryComputeIndentationForListItem(childStartPos, child.end, parentStartLine, originalRange, inheritedIndentation);
670671
if (childIndentationAmount !== Constants.Unknown) {
671672
inheritedIndentation = childIndentationAmount;

0 commit comments

Comments
 (0)