From 60c469e5e616010e2d306dc870f63f2cd118d873 Mon Sep 17 00:00:00 2001 From: Ivan Donchevskii Date: Fri, 20 Dec 2019 09:23:56 +0100 Subject: [PATCH] IDEA-CR-56782: CPP-18466: Add default implementation to deprecated reformat calls GitOrigin-RevId: 47c4dbae5bcc0331d81bc5588b0a541f20149004 --- .../intellij/psi/codeStyle/CodeStyleManager.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/platform/core-api/src/com/intellij/psi/codeStyle/CodeStyleManager.java b/platform/core-api/src/com/intellij/psi/codeStyle/CodeStyleManager.java index bcd5a583258f..d72710efee7b 100644 --- a/platform/core-api/src/com/intellij/psi/codeStyle/CodeStyleManager.java +++ b/platform/core-api/src/com/intellij/psi/codeStyle/CodeStyleManager.java @@ -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