Java: preview for "Inconsistent whitespace indentation in text block" inspection quick-fix

GitOrigin-RevId: 9321032196884bd1fa0f4e524b18e55d37f48356
This commit is contained in:
Bas Leijdekkers
2022-07-20 18:53:23 +00:00
committed by intellij-monorepo-bot
parent fc3b0c3520
commit 4690ccc884
@@ -1,8 +1,9 @@
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.codeInspection;
import com.intellij.application.options.CodeStyle;
import com.intellij.codeInsight.daemon.impl.analysis.HighlightingFeature;
import com.intellij.codeInsight.intention.preview.IntentionPreviewInfo;
import com.intellij.codeInspection.util.IntentionFamilyName;
import com.intellij.ide.highlighter.JavaFileType;
import com.intellij.java.JavaBundle;
@@ -99,6 +100,12 @@ public class InconsistentTextBlockIndentInspection extends AbstractBaseJavaLocal
if (newTextBlock == null) return;
TrailingWhitespacesInTextBlockInspection.replaceTextBlock(project, literalExpression, "\"\"\"\n" + newTextBlock + "\"\"\"");
}
@Override
public @NotNull IntentionPreviewInfo generatePreview(@NotNull Project project, @NotNull ProblemDescriptor previewDescriptor) {
applyFix(project, previewDescriptor);
return IntentionPreviewInfo.DIFF_NO_TRIM;
}
}
private static class MixedIndentModel {