revert 28a13b77d1 due to performance problems - skip read only blocks while building formatting model (IDEA-142200, should fix adjustLineIndent performance problem)

This commit is contained in:
Yaroslav Lepenkin
2015-07-03 13:28:36 +03:00
parent b60534b90f
commit d619da839d
@@ -203,6 +203,9 @@ class InitialInfoBuilder {
if (rootBlock instanceof ReadOnlyBlockInformationProvider) {
myReadOnlyBlockInformationProvider = (ReadOnlyBlockInformationProvider)rootBlock;
}
if (!isInsideFormattingRanges && !myCollectAlignmentsInsideFormattingRange) {
return processSimpleBlock(rootBlock, parent, true, index, parentBlock);
}
final List<Block> subBlocks = rootBlock.getSubBlocks();
if (subBlocks.isEmpty() || myReadOnlyBlockInformationProvider != null
@@ -237,10 +240,11 @@ class InitialInfoBuilder {
}
boolean blocksMayBeOfInterest = false;
if (myPositionOfInterest != -1) {
if (myPositionOfInterest != -1 && rootBlock.getTextRange().contains(myPositionOfInterest)) {
myResult.put(wrappedRootBlock, rootBlock);
blocksMayBeOfInterest = true;
}
final boolean blocksAreReadOnly = rootBlock instanceof ReadOnlyBlockContainer || blocksMayBeOfInterest;
State state = new State(rootBlock, wrappedRootBlock, currentWrapParent, blocksAreReadOnly, rootBlockIsRightBlock);