IDEA-CR-56782: CPP-18466: Add default implementation to deprecated reformat calls

GitOrigin-RevId: 47c4dbae5bcc0331d81bc5588b0a541f20149004
This commit is contained in:
Ivan Donchevskii
2019-12-23 15:07:19 +00:00
committed by intellij-monorepo-bot
parent 0666056872
commit 60c469e5e6
@@ -83,7 +83,10 @@ public abstract class CodeStyleManager {
* @see #reformatText(PsiFile, int, int)
*/
@Deprecated
@NotNull public abstract PsiElement reformat(@NotNull PsiElement element, boolean canChangeWhiteSpacesOnly) throws IncorrectOperationException;
@NotNull
public PsiElement reformat(@NotNull PsiElement element, boolean canChangeWhiteSpacesOnly) throws IncorrectOperationException {
return reformat(element, canChangeWhiteSpacesOnly, false);
}
/**
* Reformats the contents of the specified PSI element, and optionally enforces braces
@@ -132,10 +135,12 @@ public abstract class CodeStyleManager {
* @see #reformatText(PsiFile, int, int)
*/
@Deprecated
public abstract PsiElement reformatRange(@NotNull PsiElement element,
int startOffset,
int endOffset,
boolean canChangeWhiteSpacesOnly) throws IncorrectOperationException;
public PsiElement reformatRange(@NotNull PsiElement element,
int startOffset,
int endOffset,
boolean canChangeWhiteSpacesOnly) throws IncorrectOperationException {
return reformatRange(element, startOffset, endOffset, canChangeWhiteSpacesOnly, false);
}
/**
* Reformats part of the contents of the specified PSI element, and optionally enforces braces