mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Deprecate FormattingModelBuilderEx.getIndentOptionsToUse(), replaced with FileIndentOptionsProvider.
This commit is contained in:
@@ -50,8 +50,12 @@ public interface FormattingModelBuilderEx extends FormattingModelBuilder {
|
||||
* @param settings code style settings holder
|
||||
* @return indent options to use for the target formatting operation (if any adjustment is required);
|
||||
* <code>null</code> to trigger default algorithm usage
|
||||
* @deprecated Use <code>FileIndentOptionsProvider</code> instead.
|
||||
* @see com.intellij.psi.codeStyle.FileIndentOptionsProvider
|
||||
*/
|
||||
@SuppressWarnings("UnusedDeclaration")
|
||||
@Nullable
|
||||
@Deprecated
|
||||
CommonCodeStyleSettings.IndentOptions getIndentOptionsToUse(@NotNull PsiFile file,
|
||||
@NotNull FormatTextRanges ranges,
|
||||
@NotNull CodeStyleSettings settings);
|
||||
|
||||
+2
-7
@@ -237,13 +237,8 @@ public class CodeFormatterFacade {
|
||||
formatter.setProgressTask(new FormattingProgressTask(project, file, document));
|
||||
}
|
||||
|
||||
CommonCodeStyleSettings.IndentOptions indentOptions = null;
|
||||
if (builder instanceof FormattingModelBuilderEx) {
|
||||
indentOptions = ((FormattingModelBuilderEx)builder).getIndentOptionsToUse(file, ranges, mySettings);
|
||||
}
|
||||
if (indentOptions == null) {
|
||||
indentOptions = mySettings.getIndentOptionsByFile(file, textRanges.size() == 1 ? textRanges.get(0).getTextRange() : null);
|
||||
}
|
||||
CommonCodeStyleSettings.IndentOptions indentOptions =
|
||||
mySettings.getIndentOptionsByFile(file, textRanges.size() == 1 ? textRanges.get(0).getTextRange() : null);
|
||||
|
||||
formatter.format(model, mySettings, indentOptions, ranges);
|
||||
for (FormatTextRanges.FormatTextRange range : textRanges) {
|
||||
|
||||
+1
-7
@@ -94,13 +94,7 @@ abstract class CodeStyleManagerRunnable<T> {
|
||||
mySettings = CodeStyleSettingsManager.getSettings(myCodeStyleManager.getProject());
|
||||
|
||||
mySignificantRange = offset != -1 ? getSignificantRange(file, offset) : null;
|
||||
|
||||
if (builder instanceof FormattingModelBuilderEx) {
|
||||
myIndentOptions = ((FormattingModelBuilderEx)builder).getIndentOptionsToUse(file, new FormatTextRanges(mySignificantRange, true), mySettings);
|
||||
}
|
||||
if (myIndentOptions == null) {
|
||||
myIndentOptions = mySettings.getIndentOptionsByFile(file);
|
||||
}
|
||||
myIndentOptions = mySettings.getIndentOptionsByFile(file, mySignificantRange);
|
||||
|
||||
myModel = CoreFormatterUtil.buildModel(builder, file, mySettings, myMode);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user