mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
[platform] API cleanup: remove unused deprecated API scheduled for removal (IJPL-178044)
GitOrigin-RevId: 6c805f3efc84069175af18ec3efa157c0c9e5a53
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1661f90d44
commit
0c0660b845
@@ -1454,20 +1454,6 @@ f:com.intellij.codeInspection.ProblemDescriptorUtil
|
||||
com.intellij.codeInspection.ProblemDescriptorUtil$ProblemPresentation
|
||||
- a:getDescription():java.lang.String
|
||||
- a:getTooltip():java.lang.String
|
||||
c:com.intellij.codeInspection.SetInspectionOptionFix
|
||||
- com.intellij.codeInspection.IntentionAndQuickFixAction
|
||||
- com.intellij.codeInsight.intention.LowPriorityAction
|
||||
- com.intellij.openapi.util.Iconable
|
||||
- <init>(com.intellij.codeInspection.LocalInspectionTool,java.lang.String,java.lang.String,I):V
|
||||
- <init>(com.intellij.codeInspection.LocalInspectionTool,java.lang.String,java.lang.String,Z):V
|
||||
- applyFix(com.intellij.openapi.project.Project,com.intellij.psi.PsiFile,com.intellij.openapi.editor.Editor):V
|
||||
- availableInBatchMode():Z
|
||||
- generatePreview(com.intellij.openapi.project.Project,com.intellij.codeInspection.ProblemDescriptor):com.intellij.codeInsight.intention.preview.IntentionPreviewInfo
|
||||
- generatePreview(com.intellij.openapi.project.Project,com.intellij.openapi.editor.Editor,com.intellij.psi.PsiFile):com.intellij.codeInsight.intention.preview.IntentionPreviewInfo
|
||||
- getFamilyName():java.lang.String
|
||||
- getIcon(I):javax.swing.Icon
|
||||
- getName():java.lang.String
|
||||
- startInWriteAction():Z
|
||||
f:com.intellij.codeInspection.SuppressIntentionActionFromFix
|
||||
- com.intellij.codeInspection.SuppressIntentionAction
|
||||
- java.lang.Comparable
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.intellij.codeInsight.daemon.impl;
|
||||
|
||||
import com.intellij.codeHighlighting.HighlightingPass;
|
||||
import com.intellij.codeInsight.daemon.GutterMark;
|
||||
import com.intellij.codeInsight.intention.preview.IntentionPreviewUtils;
|
||||
import com.intellij.codeInsight.multiverse.*;
|
||||
import com.intellij.lang.annotation.HighlightSeverity;
|
||||
import com.intellij.openapi.application.AccessToken;
|
||||
@@ -475,22 +474,4 @@ public final class UpdateHighlightersUtil {
|
||||
LOG.warn(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Do not use. This method might break highlighting, left for binary compatibility only
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
@ApiStatus.Internal
|
||||
public static void removeHighlightersWithExactRange(@NotNull Document document, @NotNull Project project, @NotNull Segment range) {
|
||||
if (IntentionPreviewUtils.isIntentionPreviewActive()) return;
|
||||
ThreadingAssertions.assertEventDispatchThread();
|
||||
MarkupModel model = DocumentMarkupModel.forDocument(document, project, false);
|
||||
if (model == null) return;
|
||||
|
||||
for (RangeHighlighter highlighter : model.getAllHighlighters()) {
|
||||
if (TextRange.areSegmentsEqual(range, highlighter)) {
|
||||
model.removeHighlighter(highlighter);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,186 +0,0 @@
|
||||
// Copyright 2000-2023 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.analysis.AnalysisBundle;
|
||||
import com.intellij.codeInsight.intention.LowPriorityAction;
|
||||
import com.intellij.codeInsight.intention.preview.IntentionPreviewInfo;
|
||||
import com.intellij.codeInspection.ex.InspectionProfileModifiableModelKt;
|
||||
import com.intellij.codeInspection.ex.InspectionToolWrapper;
|
||||
import com.intellij.codeInspection.options.LocMessage;
|
||||
import com.intellij.codeInspection.options.OptCheckbox;
|
||||
import com.intellij.codeInspection.options.OptNumber;
|
||||
import com.intellij.codeInspection.options.OptPane;
|
||||
import com.intellij.codeInspection.util.IntentionName;
|
||||
import com.intellij.icons.AllIcons;
|
||||
import com.intellij.openapi.command.undo.BasicUndoableAction;
|
||||
import com.intellij.openapi.command.undo.UndoManager;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Iconable;
|
||||
import com.intellij.openapi.util.text.HtmlBuilder;
|
||||
import com.intellij.openapi.util.text.HtmlChunk;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.profile.codeInspection.InspectionProfileManager;
|
||||
import com.intellij.psi.PsiFile;
|
||||
import com.intellij.psi.PsiManager;
|
||||
import com.intellij.util.ObjectUtils;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
import static com.intellij.openapi.util.text.HtmlChunk.*;
|
||||
|
||||
/**
|
||||
* @deprecated use {@link UpdateInspectionOptionFix} instead.
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public class SetInspectionOptionFix extends IntentionAndQuickFixAction implements LowPriorityAction, Iconable {
|
||||
private final String myShortName;
|
||||
private final String myProperty;
|
||||
private final @IntentionName String myMessage;
|
||||
private final Object myValue;
|
||||
|
||||
public SetInspectionOptionFix(LocalInspectionTool inspection, @NonNls String property, @IntentionName String message, boolean value) {
|
||||
this(inspection.getShortName(), property, message, value);
|
||||
}
|
||||
|
||||
public SetInspectionOptionFix(LocalInspectionTool inspection, @NonNls String property, @IntentionName String message, int value) {
|
||||
this(inspection.getShortName(), property, message, value);
|
||||
}
|
||||
|
||||
private SetInspectionOptionFix(@NotNull String shortName, @NonNls String property, @IntentionName String message, Object value) {
|
||||
myShortName = shortName;
|
||||
myProperty = property;
|
||||
myMessage = message;
|
||||
myValue = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getName() {
|
||||
return myMessage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull String getFamilyName() {
|
||||
return AnalysisBundle.message("set.inspection.option.fix");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean startInWriteAction() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean availableInBatchMode() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyFix(@NotNull Project project, PsiFile psiFile, @Nullable Editor editor) {
|
||||
VirtualFile vFile = psiFile.getVirtualFile();
|
||||
Object oldValue = getOption(project, vFile);
|
||||
setOption(project, vFile, myValue);
|
||||
if (oldValue != null) {
|
||||
UndoManager.getInstance(project).undoableActionPerformed(new BasicUndoableAction(vFile) {
|
||||
@Override
|
||||
public void undo() {
|
||||
setOption(project, vFile, oldValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void redo() {
|
||||
setOption(project, vFile, myValue);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull IntentionPreviewInfo generatePreview(@NotNull Project project, @NotNull ProblemDescriptor previewDescriptor) {
|
||||
return generatePreviewForFile(previewDescriptor.getPsiElement().getContainingFile());
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull IntentionPreviewInfo generatePreview(@NotNull Project project, @NotNull Editor editor, @NotNull PsiFile psiFile) {
|
||||
return generatePreviewForFile(psiFile);
|
||||
}
|
||||
|
||||
private @NotNull IntentionPreviewInfo generatePreviewForFile(@NotNull PsiFile psiFile) {
|
||||
Project project = psiFile.getProject();
|
||||
InspectionToolWrapper<?, ?> tool =
|
||||
InspectionProfileManager.getInstance(project).getCurrentProfile().getInspectionTool(myShortName, psiFile);
|
||||
if (tool == null) return IntentionPreviewInfo.EMPTY;
|
||||
InspectionProfileEntry inspection = getLocalTool(tool);
|
||||
OptPane pane = inspection.getOptionsPane();
|
||||
if (myValue instanceof Boolean value) {
|
||||
OptCheckbox control = ObjectUtils.tryCast(pane.findControl(myProperty), OptCheckbox.class);
|
||||
if (control == null) return IntentionPreviewInfo.EMPTY;
|
||||
HtmlChunk label = text(control.label().label());
|
||||
Element checkbox = tag("input").attr("type", "checkbox").attr("readonly", "true");
|
||||
if (value) {
|
||||
checkbox = checkbox.attr("checked", "true");
|
||||
}
|
||||
HtmlChunk info = tag("table")
|
||||
.child(tag("tr").children(
|
||||
tag("td").child(checkbox),
|
||||
tag("td").child(label)
|
||||
));
|
||||
return new IntentionPreviewInfo.Html(
|
||||
new HtmlBuilder().append(value ? AnalysisBundle.message("set.option.description.check")
|
||||
: AnalysisBundle.message("set.option.description.uncheck"))
|
||||
.br().br().append(info).toFragment());
|
||||
} else if (myValue instanceof Integer value) {
|
||||
OptNumber control = ObjectUtils.tryCast(pane.findControl(myProperty), OptNumber.class);
|
||||
if (control == null) return IntentionPreviewInfo.EMPTY;
|
||||
LocMessage.PrefixSuffix prefixSuffix = control.splitLabel().splitLabel();
|
||||
Element input = tag("input").attr("type", "text").attr("value", value)
|
||||
.attr("size", value.toString().length() + 1).attr("readonly", "true");
|
||||
HtmlChunk info = tag("table").child(tag("tr").children(
|
||||
tag("td").child(text(prefixSuffix.prefix())),
|
||||
tag("td").child(input),
|
||||
tag("td").child(text(prefixSuffix.suffix()))
|
||||
));
|
||||
return new IntentionPreviewInfo.Html(
|
||||
new HtmlBuilder().append(AnalysisBundle.message("set.option.description.input"))
|
||||
.br().br().append(info).br().toFragment());
|
||||
}
|
||||
else {
|
||||
throw new IllegalStateException("Value of type " + myValue.getClass() + " is not supported");
|
||||
}
|
||||
}
|
||||
|
||||
private static InspectionProfileEntry getLocalTool(InspectionToolWrapper<?, ?> tool) {
|
||||
InspectionProfileEntry inspection = tool.getTool();
|
||||
if (inspection instanceof GlobalInspectionTool global) {
|
||||
return global.getSharedLocalInspectionTool();
|
||||
}
|
||||
return inspection;
|
||||
}
|
||||
|
||||
private Object getOption(@NotNull Project project, @NotNull VirtualFile vFile) {
|
||||
PsiFile file = PsiManager.getInstance(project).findFile(vFile);
|
||||
if (file == null) return null;
|
||||
InspectionToolWrapper<?, ?> tool = InspectionProfileManager.getInstance(project).getCurrentProfile().getInspectionTool(myShortName, file);
|
||||
if (tool == null) return null;
|
||||
InspectionProfileEntry inspection = getLocalTool(tool);
|
||||
return inspection.getOptionController().getOption(myProperty);
|
||||
}
|
||||
|
||||
private void setOption(@NotNull Project project, @NotNull VirtualFile vFile, Object value) {
|
||||
PsiFile file = PsiManager.getInstance(project).findFile(vFile);
|
||||
if (file == null) return;
|
||||
InspectionProfileModifiableModelKt.modifyAndCommitProjectProfile(project, model -> {
|
||||
InspectionToolWrapper<?, ?> tool = model.getInspectionTool(myShortName, file);
|
||||
if (tool == null) return;
|
||||
InspectionProfileEntry inspection = getLocalTool(tool);
|
||||
inspection.getOptionController().setOption(myProperty, value);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public Icon getIcon(int flags) {
|
||||
return AllIcons.Actions.Cancel;
|
||||
}
|
||||
}
|
||||
@@ -1332,7 +1332,6 @@ f:com.intellij.openapi.actionSystem.Presentation
|
||||
- getTextWithMnemonic():java.lang.String
|
||||
- getTextWithMnemonic(java.util.function.Supplier,Z):java.util.function.Supplier
|
||||
- getTextWithPossibleMnemonic():java.util.function.Supplier
|
||||
- getWeight():D
|
||||
- isApplicationScope():Z
|
||||
- isDisableGroupIfEmpty():Z
|
||||
- isEnabled():Z
|
||||
|
||||
@@ -667,12 +667,6 @@ public final class Presentation implements Cloneable {
|
||||
fireObjectPropertyChange(key, oldValue, value);
|
||||
}
|
||||
|
||||
/** @deprecated The feature is dropped. See {@link com.intellij.ide.actions.WeighingActionGroup} */
|
||||
@Deprecated(forRemoval = true)
|
||||
public double getWeight() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/** @deprecated The feature is dropped. See {@link com.intellij.ide.actions.WeighingActionGroup} */
|
||||
@Deprecated(forRemoval = true)
|
||||
public void setWeight(double ignore) {
|
||||
|
||||
@@ -28,32 +28,12 @@ public interface UpdatableIndex<Key, Value, Input, FileIndexMetaData> extends In
|
||||
*/
|
||||
@Nullable FileIndexMetaData getFileIndexMetaData(@NotNull IndexedFile file);
|
||||
|
||||
/**
|
||||
* @deprecated use {@linkplain #setIndexedStateForFileOnFileIndexMetaData(int, Object, boolean)}
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Deprecated(forRemoval = true)
|
||||
default void setIndexedStateForFileOnFileIndexMetaData(int fileId, @Nullable FileIndexMetaData data) {
|
||||
throw new IllegalStateException("Please override setIndexedStateForFileOnFileIndexMetaData(int, FileIndexMetaData, boolean)");
|
||||
}
|
||||
|
||||
default void setIndexedStateForFileOnFileIndexMetaData(int fileId,
|
||||
@Nullable FileIndexMetaData fileIndexMetaData,
|
||||
boolean isProvidedByInfrastructureExtension) {
|
||||
setIndexedStateForFileOnFileIndexMetaData(fileId, fileIndexMetaData);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@linkplain #setIndexedStateForFile(int, IndexedFile, boolean)}
|
||||
*/
|
||||
@SuppressWarnings("unused")
|
||||
@Deprecated(forRemoval = true)
|
||||
default void setIndexedStateForFile(int fileId, @NotNull IndexedFile file) {
|
||||
throw new IllegalStateException("Please override setIndexedStateForFile(int, IndexedFile, boolean)");
|
||||
}
|
||||
|
||||
default void setIndexedStateForFile(int fileId, @NotNull IndexedFile file, boolean isProvidedByInfrastructureExtension) {
|
||||
setIndexedStateForFile(fileId, file);
|
||||
}
|
||||
|
||||
void invalidateIndexedStateForFile(int fileId);
|
||||
|
||||
@@ -168,8 +168,6 @@ a:com.intellij.openapi.module.ConfigurationErrorType
|
||||
- getFeatureType():java.lang.String
|
||||
f:com.intellij.openapi.module.impl.ModuleGroupersKt
|
||||
- sf:splitStringByDotsJoiningIncorrectIdentifiers(java.lang.String):kotlin.Pair
|
||||
f:com.intellij.openapi.module.impl.ModulePathKt
|
||||
- sf:getModuleNameByFilePath(java.lang.String):java.lang.String
|
||||
a:com.intellij.openapi.options.BaseSchemeProcessor
|
||||
- com.intellij.openapi.options.NonLazySchemeProcessor
|
||||
- <init>():V
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
// 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.openapi.module.impl
|
||||
|
||||
import com.intellij.platform.workspace.jps.serialization.impl.ModulePath
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
@Deprecated("Use ModulePath.getModuleNameByFilePath instead", ReplaceWith("ModulePath.getModuleNameByFilePath(path)"))
|
||||
fun getModuleNameByFilePath(path: String): String {
|
||||
return ModulePath.getModuleNameByFilePath(path)
|
||||
}
|
||||
@@ -458,19 +458,6 @@ class ProgressCoroutineScopeLegacy private constructor(indicator: ProgressIndica
|
||||
}
|
||||
}
|
||||
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
@Deprecated("Use progress reporter api")
|
||||
inline fun withText(@Nls(capitalization = Nls.Capitalization.Sentence) text: String, action: ProgressCoroutineScope.() -> Unit) {
|
||||
val oldText = indicator.text
|
||||
try {
|
||||
indicator.text = text
|
||||
action()
|
||||
}
|
||||
finally {
|
||||
indicator.text = oldText
|
||||
}
|
||||
}
|
||||
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
@Deprecated("Use progress reporter api")
|
||||
inline fun withDetails(@Nls(capitalization = Nls.Capitalization.Sentence) text: String, action: ProgressCoroutineScope.() -> Unit) {
|
||||
|
||||
@@ -14,10 +14,7 @@ import kotlin.collections.plus
|
||||
import kotlin.collections.toList
|
||||
|
||||
abstract class BaseEventId(val eventId: String, val recorder: String, val description: String?) {
|
||||
@ApiStatus.ScheduledForRemoval
|
||||
@Deprecated("Recorder ID should be explicitly provided", replaceWith = ReplaceWith("BaseEventId(eventId, recorder)"))
|
||||
constructor(eventId: String) : this(eventId, "FUS", null)
|
||||
|
||||
|
||||
internal fun getLogger(): StatisticsEventLogger = StatisticsEventLogProviderUtil.getEventLogProvider(recorder).logger
|
||||
|
||||
abstract fun getFields(): List<EventField<*>>
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.intellij.openapi.project.IndexNotReadyException;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.util.ArrayUtil;
|
||||
import org.jetbrains.annotations.ApiStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.annotations.Unmodifiable;
|
||||
@@ -85,13 +84,6 @@ public abstract class AbstractTreeStructureBase extends AbstractTreeStructure {
|
||||
|
||||
public abstract @Unmodifiable @Nullable List<TreeStructureProvider> getProviders();
|
||||
|
||||
/** @deprecated Drop together with {@link TreeStructureProvider#getData(Collection, String)} */
|
||||
@Deprecated(forRemoval = true)
|
||||
@ApiStatus.Internal
|
||||
public @Nullable Object getDataFromProviders(@NotNull List<AbstractTreeNode<?>> selectedNodes, @NotNull String dataId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private @Unmodifiable @NotNull List<TreeStructureProvider> getProvidersDumbAware() {
|
||||
if (myProject == null) {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -157,7 +157,6 @@ f:org.intellij.plugins.intelliLang.inject.InjectorUtils
|
||||
- s:putInjectedFileUserData(com.intellij.psi.PsiElement,com.intellij.lang.Language,com.intellij.openapi.util.Key,java.lang.Object):V
|
||||
- s:registerInjection(com.intellij.lang.Language,com.intellij.psi.PsiFile,java.util.List,com.intellij.lang.injection.MultiHostRegistrar):V
|
||||
- s:registerInjection(com.intellij.lang.Language,com.intellij.psi.PsiFile,java.util.List,com.intellij.lang.injection.MultiHostRegistrar,java.util.function.Consumer):V
|
||||
- s:registerInjection(com.intellij.lang.Language,java.util.List,com.intellij.psi.PsiFile,com.intellij.lang.injection.MultiHostRegistrar):V
|
||||
- s:registerInjectionSimple(com.intellij.psi.PsiLanguageInjectionHost,org.intellij.plugins.intelliLang.inject.config.BaseInjection,org.intellij.plugins.intelliLang.inject.LanguageInjectionSupport,com.intellij.lang.injection.MultiHostRegistrar):Z
|
||||
- s:registerSupport(com.intellij.lang.injection.MultiHostRegistrar,org.intellij.plugins.intelliLang.inject.LanguageInjectionSupport,Z):V
|
||||
- s:registerSupport(org.intellij.plugins.intelliLang.inject.LanguageInjectionSupport,Z,com.intellij.psi.PsiElement,com.intellij.lang.Language):V
|
||||
|
||||
@@ -112,17 +112,6 @@ public final class InjectorUtils {
|
||||
public record InjectionInfo(@NotNull PsiLanguageInjectionHost host, @NotNull InjectedLanguage language, @NotNull TextRange range) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use {@link #registerInjection(Language, PsiFile, List, MultiHostRegistrar)}
|
||||
*/
|
||||
@Deprecated(forRemoval = true)
|
||||
public static void registerInjection(@Nullable Language language,
|
||||
@NotNull List<? extends Trinity<PsiLanguageInjectionHost, InjectedLanguage, TextRange>> list,
|
||||
@NotNull PsiFile containingFile,
|
||||
@NotNull MultiHostRegistrar registrar) {
|
||||
registerInjection(language, containingFile,
|
||||
ContainerUtil.map(list, trinity -> new InjectionInfo(trinity.first, trinity.second, trinity.third)), registrar);
|
||||
}
|
||||
public static void registerInjection(@Nullable Language language,
|
||||
@NotNull PsiFile containingFile,
|
||||
@NotNull List<InjectionInfo> list,
|
||||
|
||||
Reference in New Issue
Block a user