[platform] API cleanup: mark deprecated unused API for removal (IJPL-163936)

GitOrigin-RevId: 3f0fa9b798a14cafc36552fa66918e99bb7468da
This commit is contained in:
Nikolay Chashnikov
2025-02-14 12:52:26 +01:00
committed by intellij-monorepo-bot
parent 627b6de614
commit 2f71c71bf1
44 changed files with 66 additions and 20 deletions

View File

@@ -24,7 +24,7 @@ public interface CompileContext extends UserDataHolder, MessageHandler {
/**
* @deprecated use {@link JavaBuilderUtil#isForcedRecompilationAllJavaModules(CompileContext)} for java-related usages
*/
@Deprecated
@Deprecated(forRemoval = true)
default boolean isProjectRebuild() {
return JavaBuilderUtil.isForcedRecompilationAllJavaModules(getScope());
}

View File

@@ -16,7 +16,7 @@ public abstract class JpsCompositeElementBase<Self extends JpsCompositeElementBa
* @deprecated creating copies isn't supported in for all elements in JPS anymore; if you need to create a copy for your element,
* write the corresponding code in your class directly.
*/
@Deprecated
@Deprecated(forRemoval = true)
protected JpsCompositeElementBase(@NotNull JpsCompositeElementBase<Self> original) {
myContainer = JpsExElementFactory.getInstance().createContainerCopy(original.myContainer, this);
}

View File

@@ -24,7 +24,7 @@ public abstract class JpsElementBase<Self extends JpsElementBase<Self>> implemen
/**
* @deprecated does nothing, all calls must be removed
*/
@Deprecated
@Deprecated(forRemoval = true)
protected void fireElementChanged() {
}

View File

@@ -87,7 +87,7 @@ public final class TransientCodeStyleSettings extends CodeStyleSettings {
* @deprecated Use {@link #applyIndentOptionsFromProviders(Project, VirtualFile)}
*/
@SuppressWarnings("DeprecatedIsStillUsed")
@Deprecated
@Deprecated(forRemoval = true)
@ApiStatus.Internal
public void applyIndentOptionsFromProviders(@NotNull PsiFile file) {
applyIndentOptionsFromProviders(file.getProject(), file.getVirtualFile());

View File

@@ -1,10 +1,13 @@
// 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.collaboration.api.page
import org.jetbrains.annotations.ApiStatus
/**
* Loads the list of data in a sequential manner - one batch after the other
* Processes only one request at a time
*/
@ApiStatus.ScheduledForRemoval
@Deprecated("Unused internally")
interface SequentialListLoader<T> {
/**

View File

@@ -13,6 +13,7 @@ import com.intellij.platform.util.coroutines.childScope
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.collectLatest
import org.jetbrains.annotations.ApiStatus
import java.awt.Component
import javax.swing.JComponent
@@ -24,6 +25,7 @@ class TokenLoginDialog @JvmOverloads constructor(
private val centerPanelSupplier: CoroutineScope.() -> DialogPanel
) : DialogWrapper(project, parent, false, IdeModalityType.IDE) {
@ApiStatus.ScheduledForRemoval
@Deprecated("A proper coroutine scope should be provided")
@OptIn(DelicateCoroutinesApi::class)
@JvmOverloads

View File

@@ -21,6 +21,7 @@ import com.intellij.ui.dsl.builder.panel
import com.intellij.ui.layout.ComponentPredicate
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.collectLatest
import org.jetbrains.annotations.ApiStatus
import javax.swing.event.DocumentEvent
/**
@@ -31,7 +32,7 @@ import javax.swing.event.DocumentEvent
class TokenLoginInputPanelFactory(
private val model: TokenLoginPanelModel
) {
@ApiStatus.ScheduledForRemoval
@Deprecated(
"Use the 'TokenLoginInputPanelFactory.createIn' method",
ReplaceWith(

View File

@@ -10,6 +10,7 @@ import com.intellij.collaboration.ui.codereview.details.data.ReviewState
import com.intellij.icons.AllIcons
import com.intellij.openapi.util.NlsSafe
import com.intellij.ui.ExperimentalUI
import org.jetbrains.annotations.ApiStatus
import org.jetbrains.annotations.Nls
import java.awt.Color
import java.awt.Insets
@@ -61,6 +62,8 @@ object ReviewDetailsUIUtil {
newUI = Insets(16, NEW_UI_LEFT_GAP, 16, RIGHT_GAP),
)
@get:ApiStatus.ScheduledForRemoval
@get:Deprecated("Description should not be shown in details panel")
@Deprecated("Description should not be shown in details panel")
@Suppress("UseDPIAwareInsets")
val DESCRIPTION_GAPS: Insets

View File

@@ -16,6 +16,7 @@ import org.jetbrains.annotations.ApiStatus
import org.jetbrains.annotations.Nls
import javax.swing.Icon
@ApiStatus.ScheduledForRemoval
@Deprecated("Deprecated with the move to ViewModel-based approach")
@ApiStatus.Internal
abstract class LineGutterIconRenderer : GutterIconRenderer(), DumbAware, Disposable {

View File

@@ -26,6 +26,7 @@ class CodeReviewDiffViewModelComputer<D> @ApiStatus.Experimental constructor(
private val changesSorter: Flow<RefComparisonChangesSorter>,
private val diffProducerFactory: (D, RefComparisonChange) -> CodeReviewDiffRequestProducer?
) {
@ApiStatus.ScheduledForRemoval
@Deprecated("Use a more simplified constructor instead")
constructor(dataLoadingFlow: Flow<Deferred<D>>, diffProducerFactory: (D, RefComparisonChange) -> CodeReviewDiffRequestProducer?) :
this(dataLoadingFlow.computationState(), flowOf(RefComparisonChangesSorter.None), diffProducerFactory)

View File

@@ -125,6 +125,7 @@ private fun <VM : DiffMapped> TwosideTextDiffViewer.controlInlaysIn(
* @param I - inlay model
*/
@ApiStatus.ScheduledForRemoval
@Deprecated("Using a suspend function is safer for threading",
ReplaceWith("cs.launch { controlReview(modelFactory, modelKey, rendererFactory) }"))
fun <M : CodeReviewEditorModel<I>, I : CodeReviewInlayModel> DiffViewerBase.controlReviewIn(

View File

@@ -243,6 +243,7 @@ open class CodeReviewEditorGutterChangesRenderer(
}
companion object {
@ApiStatus.ScheduledForRemoval
@Deprecated("Use a suspending function", ReplaceWith("cs.launch { render(model, editor) }"))
fun setupIn(cs: CoroutineScope, model: CodeReviewEditorGutterActionableChangesModel, editor: Editor) {
cs.launchNow { render(model, editor) }

View File

@@ -31,6 +31,7 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.NonCancellable
import kotlinx.coroutines.withContext
import org.jetbrains.annotations.ApiStatus
import java.awt.Graphics
import java.awt.Rectangle
import java.awt.event.MouseEvent
@@ -335,6 +336,7 @@ private constructor(
val doAction: () -> Unit,
)
@ApiStatus.ScheduledForRemoval
@Deprecated("Use a suspending function", ReplaceWith("cs.launch { render(model, editor) }"))
fun setupIn(cs: CoroutineScope, model: CodeReviewEditorGutterControlsModel, editor: EditorEx) {
cs.launchNow(Dispatchers.Main) {

View File

@@ -21,6 +21,7 @@ import org.jetbrains.annotations.ApiStatus
* Changes model which uses [DocumentTracker] to track and shift changes between review head and current document state
*/
@ApiStatus.Internal
@ApiStatus.ScheduledForRemoval
@Deprecated("Please use com.intellij.collaboration.ui.codereview.editor.ReviewInEditorUtil.trackDocumentDiffSync")
class DocumentTrackerCodeReviewEditorGutterChangesModel(
parentCs: CoroutineScope,

View File

@@ -52,6 +52,7 @@ suspend fun <T> durationStep(
return durationStep(duration, text, action)
}
@ApiStatus.ScheduledForRemoval
@Deprecated(
"Moved to com.intellij.platform.util.progress",
ReplaceWith("withRawProgressReporter(action)", "com.intellij.platform.util.progress.withRawProgressReporter"),

View File

@@ -139,6 +139,7 @@ inline fun <Y> runUnderNestedProgressAndRelayMessages(parentProgress: ProgressIn
* A best effort way to bind a cancellation of one progress with the other.
*/
@ApiStatus.Internal
@ApiStatus.ScheduledForRemoval
@Deprecated("Use coroutines")
inline fun <Y> runUnderBoundCancellation(cancelOf: ProgressIndicator,
cancels: ProgressIndicator,

View File

@@ -65,6 +65,7 @@ public interface StubInconsistencyReporter {
/**
* @deprecated Use {@link #reportStubInconsistencyBetweenPsiAndText(Project, SourceOfCheck, InconsistencyType)}
*/
@ApiStatus.ScheduledForRemoval
@Deprecated
void reportStubInconsistencyBetweenPsiAndText(@NotNull Project project, @NotNull StubInconsistencyReporter.SourceOfCheck reason,
@NotNull InconsistencyType type,

View File

@@ -9,7 +9,7 @@ public final class IndexComparator implements Comparator<NodeDescriptor<?>> {
/**
* @deprecated use {@link #getInstance()} instead
*/
@Deprecated
@Deprecated(forRemoval = true)
public static final IndexComparator INSTANCE = new IndexComparator();
public static IndexComparator getInstance() {

View File

@@ -930,7 +930,7 @@ public final class ChooseRunConfigurationPopup implements ExecutorProvider {
/**
* @deprecated Use {@link #createSettingsList(Project, ExecutorProvider, DataContext, boolean)}
*/
@Deprecated
@Deprecated(forRemoval = true)
public static @NotNull List<ItemWrapper<?>> createSettingsList(@NotNull Project project,
@NotNull ExecutorProvider executorProvider,
boolean isCreateEditAction) {

View File

@@ -51,7 +51,7 @@ public interface ExternalSystemNotificationExtension {
/**
* @deprecated Use {@link #customize(NotificationData, Project, String, Throwable)} instead
*/
@Deprecated
@Deprecated(forRemoval = true)
default void customize(
@NotNull NotificationData notificationData,
@NotNull Project project,

View File

@@ -56,7 +56,7 @@ public final class CommonBundle {
/**
* @deprecated use {@link AbstractBundle#messageOrNull(ResourceBundle, String, Object...)}
*/
@Deprecated
@Deprecated(forRemoval = true)
public static @Nullable @Nls String messageOfNull(@NotNull ResourceBundle bundle, @NotNull String key, Object @NotNull ... params) {
return AbstractBundle.messageOrNull(bundle, key, params);
}

View File

@@ -55,6 +55,7 @@ open class UiNotifyConnector : Disposable, HierarchyListener {
setupListeners(component)
}
@ApiStatus.ScheduledForRemoval
@Deprecated(
"""Use the static method {@link UiNotifyConnector#installOn(Component, Activatable, boolean)}.
<p>

View File

@@ -6,6 +6,7 @@ import com.intellij.psi.PsiNamedElement
import com.intellij.refactoring.RefactoringBundle
import com.intellij.refactoring.suggested.SuggestedRefactoringSupport.Parameter
import com.intellij.refactoring.suggested.SuggestedRefactoringSupport.Signature
import org.jetbrains.annotations.ApiStatus
import org.jetbrains.annotations.Nls
/**
@@ -119,10 +120,13 @@ abstract class SuggestedRefactoringAvailability(protected val refactoringSupport
}
companion object {
@ApiStatus.ScheduledForRemoval
@Deprecated("Use RefactoringBundle.message(\"suggested.refactoring.usages\") explicitly")
@JvmField val USAGES: @Nls String = RefactoringBundle.message("suggested.refactoring.usages")
@ApiStatus.ScheduledForRemoval
@Deprecated("Use RefactoringBundle.message(\"suggested.refactoring.overrides\") explicitly")
@JvmField val OVERRIDES: @Nls String = RefactoringBundle.message("suggested.refactoring.overrides")
@ApiStatus.ScheduledForRemoval
@Deprecated("Use RefactoringBundle.message(\"suggested.refactoring.implementations\") explicitly")
@JvmField val IMPLEMENTATIONS: @Nls String = RefactoringBundle.message("suggested.refactoring.implementations")
}

View File

@@ -9,6 +9,7 @@ import com.intellij.openapi.util.TextRange
import com.intellij.psi.PsiElement
import com.intellij.psi.SmartPointerManager
import com.intellij.psi.SmartPsiElementPointer
import org.jetbrains.annotations.ApiStatus
@Suppress("DeprecatedCallableAddReplaceWith")
@Deprecated("Use TextRange(offset, offset + DocumentEvent.oldLength) directly")
@@ -16,6 +17,8 @@ val DocumentEvent.oldRange: TextRange
get() = TextRange(offset, offset + oldLength)
@Suppress("DeprecatedCallableAddReplaceWith")
@get:ApiStatus.ScheduledForRemoval
@get:Deprecated("Use TextRange(offset, offset + DocumentEvent.newLength) directly")
@Deprecated("Use TextRange(offset, offset + DocumentEvent.newLength) directly")
val DocumentEvent.newRange: TextRange
get() = TextRange(offset, offset + newLength)

View File

@@ -3,14 +3,17 @@ package com.intellij.ide.navigationToolbar
import com.intellij.ide.ui.UISettingsListener
import com.intellij.util.ui.JBSwingUtilities
import org.jetbrains.annotations.ApiStatus
import java.awt.Graphics
import java.awt.LayoutManager
import javax.swing.JPanel
@ApiStatus.ScheduledForRemoval
@Deprecated(message = "Moved to `com.intellij.platform.navbar.frontend.NavBarRootPaneExtension`", level = DeprecationLevel.ERROR)
class NavBarRootPaneExtension {
// used externally
@ApiStatus.ScheduledForRemoval
@Deprecated(message = "Use `JPanel` instead", level = DeprecationLevel.ERROR)
abstract class NavBarWrapperPanel(layout: LayoutManager?) : JPanel(layout), UISettingsListener {
override fun getComponentGraphics(graphics: Graphics): Graphics {

View File

@@ -33,7 +33,7 @@ public class GotoSymbolModel2 extends FilteringGotoByModel<LanguageRef> {
/**
* @deprecated Please pass parent disposable explicitly
*/
@Deprecated
@Deprecated(forRemoval = true)
public GotoSymbolModel2(@NotNull Project project) {
this(project, project);
}

View File

@@ -17,6 +17,7 @@ interface SdkLookupProvider {
fun getSdk(): Sdk?
@ApiStatus.ScheduledForRemoval
@Deprecated("Consider using the SdkLookupProvider.waitForLookup with the SdkLookupUtil.getSdk")
fun blockingGetSdk(): Sdk?

View File

@@ -9,6 +9,7 @@ import com.intellij.openapi.project.Project
import com.intellij.openapi.projectRoots.Sdk
import com.intellij.openapi.projectRoots.SdkType
import com.intellij.util.ThrowableRunnable
import org.jetbrains.annotations.ApiStatus
import java.util.function.Consumer
/**
@@ -53,11 +54,13 @@ fun lookupAndSetupSdkBlocking(project: Project, indicator: ProgressIndicator, sd
}
}
@ApiStatus.ScheduledForRemoval
@Deprecated("Use lookupSdkBlocking instead", ReplaceWith("lookupSdkBlocking(configure)"))
fun lookupSdk(configure: (SdkLookupBuilder) -> SdkLookupBuilder): Sdk? {
return lookupSdkBlocking(configure)
}
@ApiStatus.ScheduledForRemoval
@Deprecated("Use lookupAndSetupSdk instead", ReplaceWith("lookupAndSetupSdkBlocking(project, indicator, sdkType, applySdk)"))
fun findAndSetupSdk(project: Project, indicator: ProgressIndicator, sdkType: SdkType, applySdk: (Sdk) -> Unit) {
lookupAndSetupSdkBlocking(project, indicator, sdkType, applySdk)

View File

@@ -21,7 +21,7 @@ public abstract class SchemeExporter<T extends Scheme> {
*/
@SuppressWarnings({"unused", "RedundantThrows"})
@ApiStatus.Internal
@Deprecated
@Deprecated(forRemoval = true)
public void exportScheme(@NotNull T scheme, @NotNull OutputStream outputStream) throws Exception {
}

View File

@@ -228,6 +228,7 @@ fun <T> runBlockingModalWithRawProgressReporter(
}
}
@ApiStatus.ScheduledForRemoval
@Deprecated(
message = "Function was renamed to `runWithModalProgressBlocking`",
replaceWith = ReplaceWith(
@@ -245,6 +246,7 @@ fun <T> runBlockingModal(
return runWithModalProgressBlocking(ModalTaskOwner.project(project), title, TaskCancellation.cancellable(), action)
}
@ApiStatus.ScheduledForRemoval
@Deprecated(
message = "Function was renamed to `runWithModalProgressBlocking`",
replaceWith = ReplaceWith(

View File

@@ -22,7 +22,7 @@ public interface WelcomeTabFactory {
* @deprecated use createWelcomeTabs instead
*/
@ApiStatus.Internal
@Deprecated
@Deprecated(forRemoval = true)
default WelcomeScreenTab createWelcomeTab(@NotNull Disposable parentDisposable) { return null; }
/**

View File

@@ -115,7 +115,7 @@ public final class PluginNode implements IdeaPluginDescriptor {
/**
* @deprecated Use {@link #getDefaultTrialPeriod()}
*/
@Deprecated
@Deprecated(forRemoval = true)
public @Nullable Integer getTrialPeriod() {
return defaultTrialPeriod;
}
@@ -123,7 +123,7 @@ public final class PluginNode implements IdeaPluginDescriptor {
/**
* @deprecated Use {@link #setDefaultTrialPeriod(Integer)}}
*/
@Deprecated
@Deprecated(forRemoval = true)
public void setTrialPeriod(@Nullable Integer trialPeriod) {
this.defaultTrialPeriod = trialPeriod;
}

View File

@@ -5,6 +5,7 @@ import com.intellij.util.SystemProperties
import org.jetbrains.annotations.ApiStatus
@ApiStatus.Internal
@ApiStatus.ScheduledForRemoval
@Deprecated("Use `com.intellij.util.SystemProperties.getUserName`", level = DeprecationLevel.ERROR)
object LocalUserSettings {
val userName: String

View File

@@ -3,12 +3,14 @@ package com.intellij.openapi.actionSystem.impl
import com.intellij.openapi.actionSystem.ActionGroup
import com.intellij.ui.PopupHandler
import org.jetbrains.annotations.ApiStatus
import org.jetbrains.annotations.ApiStatus.Internal
import java.awt.event.HierarchyEvent
import java.awt.event.HierarchyListener
import java.util.function.Supplier
import javax.swing.JComponent
@ApiStatus.ScheduledForRemoval
@Deprecated("Does nothing", ReplaceWith(""), DeprecationLevel.ERROR)
@Internal
class PopupMenuPreloader private constructor() : HierarchyListener {
@@ -16,7 +18,7 @@ class PopupMenuPreloader private constructor() : HierarchyListener {
}
companion object {
@ApiStatus.ScheduledForRemoval
@Deprecated("Does nothing", ReplaceWith(""), DeprecationLevel.ERROR)
@JvmStatic
fun install(component: JComponent,

View File

@@ -201,6 +201,7 @@ object Utils {
fun wrapDataContext(dataContext: DataContext): DataContext = createAsyncDataContext(dataContext)
@JvmStatic
@ApiStatus.ScheduledForRemoval
@Deprecated("Use `createAsyncDataContext` instead", ReplaceWith("createAsyncDataContext(dataContext)"), DeprecationLevel.ERROR)
fun wrapToAsyncDataContext(dataContext: DataContext): DataContext = createAsyncDataContext(dataContext)

View File

@@ -153,6 +153,7 @@ class EditorWindow internal constructor(
get() = currentCompositeFlow.value
@Suppress("DEPRECATION")
@ApiStatus.ScheduledForRemoval
@Deprecated("Use getSelectedComposite", ReplaceWith("getSelectedComposite(ignorePopup)"), level = DeprecationLevel.ERROR)
fun getSelectedEditor(@Suppress("UNUSED_PARAMETER") ignorePopup: Boolean): EditorWithProviderComposite? {
return selectedComposite as EditorWithProviderComposite?

View File

@@ -79,6 +79,7 @@ import com.intellij.util.xmlb.jsonDomToXml
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.*
import org.jdom.Element
import org.jetbrains.annotations.ApiStatus
import org.jetbrains.annotations.ApiStatus.Internal
import org.jetbrains.annotations.NonNls
import java.awt.*
@@ -373,6 +374,7 @@ open class EditorsSplitters internal constructor(
_currentWindowFlow.value = window
}
@ApiStatus.ScheduledForRemoval
@Deprecated("Use openFilesAsync(Boolean) instead", ReplaceWith("openFilesAsync(true)"))
fun openFilesAsync(): Job = openFilesAsync(requestFocus = true)

View File

@@ -4,6 +4,6 @@ package com.intellij.openapi.wm.ex;
/**
* @deprecated Use {@link ToolWindowManagerListener} directly
*/
@Deprecated
@Deprecated(forRemoval = true)
public abstract class ToolWindowManagerAdapter implements ToolWindowManagerListener {
}

View File

@@ -74,7 +74,7 @@ public class TreeTableSpeedSearch extends SpeedSearchBase<TreeTable> {
* Also, note that non-deprecated constructor is side effect free, and you should call for {@link TreeTableSpeedSearch#setupListeners()}
* method to enable speed search
*/
@Deprecated
@Deprecated(forRemoval = true)
public TreeTableSpeedSearch(TreeTable tree) {
this(tree, TreeSpeedSearch.NODE_DESCRIPTOR_TOSTRING);
}

View File

@@ -3,6 +3,7 @@ package com.intellij.execution.process
import com.intellij.openapi.util.SystemInfo
import com.intellij.openapi.util.registry.Registry
import org.jetbrains.annotations.ApiStatus
import org.jetbrains.annotations.ApiStatus.Internal
class LocalPtyOptions private constructor(val consoleMode: Boolean,
@@ -23,6 +24,7 @@ class LocalPtyOptions private constructor(val consoleMode: Boolean,
@JvmStatic
fun defaults(): LocalPtyOptions = LocalPtyOptions(false, false, -1, -1, shouldUseWinConPty())
@ApiStatus.ScheduledForRemoval
@Deprecated("Use [defaults] instead", ReplaceWith("LocalPtyOptions.defaults()"))
@JvmField
val DEFAULT: LocalPtyOptions = LocalPtyOptions(false, false, -1, -1, false)

View File

@@ -233,7 +233,7 @@ public final class ProcessListUtil {
* @deprecated The method seems to be not used, but it can be hypothetically used in some unpublished third-party plugin.
*/
@ApiStatus.Internal
@Deprecated
@Deprecated(forRemoval = true)
public static @Nullable List<ProcessInfo> parseLinuxOutputMacStyle(@NotNull String commandOnly, @NotNull String full) {
return parseLinuxOutputMacStyle(commandOnly, full, null);
}

View File

@@ -22,6 +22,7 @@ import org.jetbrains.annotations.ApiStatus
const val RECEIVER_NAME: String = "this"
@ApiStatus.Internal
@ApiStatus.ScheduledForRemoval
@Deprecated("")
/**
* Use kotlin - base class is not required in this case (no boilerplate code)

View File

@@ -278,7 +278,7 @@ public class XDebuggerUtilImpl extends XDebuggerUtil {
/**
* @deprecated use {@link #toggleAndReturnLineBreakpoint(Project, List, XSourcePosition, boolean, boolean, Editor, boolean)}
*/
@Deprecated
@Deprecated(forRemoval = true)
public static @NotNull Promise<@Nullable XLineBreakpoint> toggleAndReturnLineBreakpoint(final @NotNull Project project,
@NotNull List<? extends XLineBreakpointType> types,
final @NotNull XSourcePosition position,

View File

@@ -20,7 +20,7 @@ public final class PercentageCoverageColumnInfo extends ColumnInfo<NodeDescripto
/**
* @deprecated Use {@link PercentageCoverageColumnInfo#PercentageCoverageColumnInfo(int, String, CoverageSuitesBundle)}
*/
@Deprecated
@Deprecated(forRemoval = true)
public PercentageCoverageColumnInfo(int columnIdx,
@NlsContexts.ColumnName String name,
final CoverageSuitesBundle suitesBundle,