Skip to content

Umbrella: deprecated IntelliJ APIs that LSP4IJ uses, and their replacements #1971

Open

Description

@lagergren

The plugin verifier reports 29 deprecated IntelliJ APIs that LSP4IJ still uses. The source is Verify plugin on main at 9ad31b0, checked against the IntelliJ releases from 2024.2 to 2026.3 EAP. None of them is scheduled for removal.

This issue lists each deprecated API with:

  • when it was deprecated;
  • what the platform names as its replacement;
  • whether that replacement already exists in 2024.2, LSP4IJ's minimum;
  • where LSP4IJ uses it, and how much work a switch is.

Tick each one off as it's replaced.

Replaceable now: the replacement exists in 2024.2

Needs a newer minimum version, or reflection

  • Key.findKeyByName(String), deprecated, used by fix: LSP4IJ uses no internal IntelliJ API, which the Marketplace verification of the nightly build reported #2276 (6 internal API usages #2274) in ConnectDocumentToLanguageServerSetupParticipant.isClosingToReopen to find the platform's CLOSING_TO_REOPEN key: FileEditorManagerImpl.CLOSING_TO_REOPEN is internal on every version, and the public FileEditorManagerKeys.CLOSING_TO_REOPEN only exists from 2024.3. Use FileEditorManagerKeys once the minimum is 2024.3. Trivial then.
  • ExtensionPointName.addExtensionPointListener(ExtensionPointListener, Disposable), deprecated from 2025.3, used by fix: LSP4IJ uses no internal IntelliJ API, which the Marketplace verification of the nightly build reported #2276 (6 internal API usages #2274) in LanguageServersRegistry and ServerInstallerManager. ExtensionPoint.addExtensionPointListener(CoroutineScope, boolean, ExtensionPointListener) is public and not deprecated, but only exists from 2025.2. Small once the minimum is 2025.2; the listeners must still end when the service is disposed.
  • CompletionConfidence.shouldSkipAutopopup(PsiElement, PsiFile, int), deprecated in 2024.3. Use the variant with an Editor, from 2024.3. In LSPCompletionConfidence. Trivial once the minimum is 2024.3.
  • InlayActionHandler.handleClick(Editor, InlayActionPayload), deprecated in 2024.3. Use handleClick(EditorMouseEvent, InlayActionPayload), from 2024.3. In LSPDeclarativeInlayActionHandler. Trivial once the minimum is 2024.3.
  • FileSaverDescriptor(String, String, String...), deprecated in 2025.1. Use FileSaverDescriptor(String, String) with withExtensionFilter(...), from 2025.1. In ExportServerAction. Trivial once the minimum is 2025.1.
  • TextMateHighlightingLexer(TextMateLanguageDescriptor, int), deprecated in 2025.1. Use the constructor with a TextMateSyntaxMatcher, from 2025.1. Needs work: the matcher is built differently in 2025.2 and 2025.3. In TextMateHighlighterHelper.
  • ActionUtil.invokeAction(AnAction, DataContext, String, InputEvent, Runnable), deprecated in 2024.3.
    • Its first replacement, invokeAction(AnAction, AnActionEvent, Runnable), from 2024.3, is itself deprecated in 2025.2, in favor of performAction(AnAction, AnActionEvent).
    • Small once the minimum is 2025.2. In CommandExecutor and TriggerCommandAction.
  • XDropFrameHandler.canDrop(XStackFrame), deprecated in 2025.2. Use canDropFrame(XStackFrame), which returns ThreeState, from 2025.2. In DAPDropFrameHandler. Trivial once the minimum is 2025.2.
  • XSmartStepIntoHandler.getPopupTitle(XSourcePosition), deprecated in 2025.2. Use getPopupTitle(), which LSP4IJ already implements. The override has to stay while the old method is abstract, before 2025.2. In DAPSmartStepIntoHandler. Trivial once the minimum is 2025.2.
  • DaemonCodeAnalyzer.restart(PsiFile), deprecated in 2025.3. Use restart(PsiFile, Object reason), from 2025.3. In LSPFileSupport. Small, with reflection.
  • TerminalToolWindowManager.createShellWidget(...), deprecated in 2026.1. Use TerminalToolWindowTabsManager.createTabBuilder(), from 2025.3, @Experimental. Needs work: it gives a different terminal view than the ShellTerminalWidget that LSP4IJ runs the command in. In RunInIntegratedTerminalService.
  • XDebugSession.getRunContentDescriptor() and XDebuggerManager.startSession(ExecutionEnvironment, XDebugProcessStarter), deprecated in 2026.1. Use XSessionStartedResult.getRunContentDescriptor() and newSessionBuilder(...)...startSession(), from 2026.1, @Experimental. DAPDebugRunner already uses the new API through reflection when it exists, and the verifier only flags the fallback for older versions. Nothing to do until the minimum is 2026.1.
  • EnvironmentVariablesComponent(), deprecated in 2026.2. Use EnvironmentVariablesComponent(Project), from 2026.2. In LanguageServerPanel and DebugAdapterServerPanel. Small, with reflection.
  • FileEditorManager.openFile(VirtualFile, boolean) and openTextEditor(OpenFileDescriptor, boolean), deprecated in 2026.3.
    • Replacements: requestOpenFile and requestOpenTextEditor, with a FileEditorOpenRequest, which open asynchronously, from 2026.3.
    • Needs work: LSPIJUtils.doOpenInEditor uses the result synchronously.
    • A trap: requestOpenFile(VirtualFile) returns void in 2024.2 and a CompletableFuture in 2026.3, so a call compiled against 2024.2 fails with NoSuchMethodError on 2026.3.

Raising the minimum from 2024.2 to 2025.2 would make seven of these possible: the first six, plus XSmartStepIntoHandler.

No replacement

  • InlayProviderSettingsModel.getMainCheckBoxLabel(), deprecated in 2024.1 or earlier as "Not used in new UI". It's still abstract, so LSP4IJ has to implement it as long as it extends InlayProviderSettingsModel.

Experimental APIs

The verifier also reports 75 experimental IntelliJ APIs. They usually have no stable replacement, so they're listed by area rather than one by one:

  • inlay hints: 39, such as ImmediateConfigurable, InlayHintsSink, NoSettings and InlayPresentation;
  • Code Vision: 8;
  • the debugger: 9, such as XAlternativeSourceHandler and XDebugProcess;
  • com.intellij.platform.backend: 4;
  • Pointer and Symbol: 5;
  • documentation: 3;
  • others: about 7.

The other 50 experimental APIs in the report are LSP4IJ's own, flagged where LSP4IJ itself uses them, and need nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions