mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[formatter-core] minor rename
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user