Addedn rangeContainsRange helper function
This commit is contained in:
parent
8683ac92c8
commit
5225b40aab
|
@ -665,7 +665,8 @@ namespace ts.formatting {
|
|||
|
||||
// if child is a list item - try to get its indentation, only if parent is within the original range.
|
||||
let childIndentationAmount = Constants.Unknown;
|
||||
if (isListItem && parent.pos >= originalRange.pos && parent.end <= originalRange.end) {
|
||||
|
||||
if (isListItem && rangeContainsRange(originalRange, parent)) {
|
||||
childIndentationAmount = tryComputeIndentationForListItem(childStartPos, child.end, parentStartLine, originalRange, inheritedIndentation);
|
||||
if (childIndentationAmount !== Constants.Unknown) {
|
||||
inheritedIndentation = childIndentationAmount;
|
||||
|
|
Loading…
Reference in a new issue