[formatter-core] minor rename

This commit is contained in:
Yaroslav Lepenkin
2016-06-22 17:46:47 +03:00
parent 3226369d60
commit dd61f64dcc
3 changed files with 5 additions and 14 deletions
@@ -160,7 +160,7 @@ public class InitialInfoBuilder {
checkRanges(parent, textRange);
}
myCurrentWhiteSpace.append(blockStartOffset, myModel, myOptions);
myCurrentWhiteSpace.changeEndOffset(blockStartOffset, myModel, myOptions);
collectAlignments(rootBlock);
@@ -110,15 +110,11 @@ public class WhiteSpace {
* @param model formatting model that is used to access to the underlying document text
* @param options indent formatting options
*/
public void append(int newEndOffset, FormattingDocumentModel model, CommonCodeStyleSettings.IndentOptions options) {
public void changeEndOffset(int newEndOffset, FormattingDocumentModel model, CommonCodeStyleSettings.IndentOptions options) {
final int oldEndOffset = myEnd;
if (newEndOffset == oldEndOffset) return;
if (myStart >= newEndOffset) {
myRangesAssert.assertInvalidRanges(myStart,
newEndOffset,
model,
"some block intersects with whitespace"
);
myRangesAssert.assertInvalidRanges(myStart, newEndOffset, model, "some block intersects with whitespace");
}
myEnd = newEndOffset;
@@ -127,14 +123,9 @@ public class WhiteSpace {
myInitial = model.getText(range);
if (!coveredByBlock(model)) {
myRangesAssert.assertInvalidRanges(myStart,
myEnd,
model,
"nonempty text is not covered by block"
);
myRangesAssert.assertInvalidRanges(myStart, myEnd, model, "nonempty text is not covered by block");
}
// There is a possible case that this method is called more than once on the same object. We want to
if (newEndOffset > oldEndOffset) {
refreshStateOnEndOffsetIncrease(newEndOffset, oldEndOffset, options.TAB_SIZE);
} else {
@@ -68,7 +68,7 @@ public class WrapBlocksState extends State {
myLastWhiteSpace = new WhiteSpace(lastBlockOffset, false);
FormattingDocumentModel model = myWrapper.getFormattingDocumentModel();
CommonCodeStyleSettings.IndentOptions options = myBlockIndentOptions.getIndentOptions();
myLastWhiteSpace.append(Math.max(lastBlockOffset, myWrapper.getEndOffset()), model, options);
myLastWhiteSpace.changeEndOffset(Math.max(lastBlockOffset, myWrapper.getEndOffset()), model, options);
}
return myLastWhiteSpace;
}