Addedn rangeContainsRange helper function

This commit is contained in:
Armando Aguirre 2017-09-28 10:23:30 -07:00
parent 8683ac92c8
commit 5225b40aab

View file

@ -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;