Repository navigation
fix: LSP4IJ uses no internal IntelliJ API, which the Marketplace verification of the nightly build reported - #2276
Merged
lagergren merged 3 commits intoNov 26, 2026
Conversation
The plugin verifier reported `FileEditorManagerImpl` and its field `CLOSING_TO_REOPEN` as internal API usages on all eight verified IDEs, 2024.2 to 2026.3, from `ConnectDocumentToLanguageServerSetupParticipant.isClosingToReopen` (1a0dca5, redhat-developer#2212). No public field has the key on every supported version: - `FileEditorManagerImpl` is `@ApiStatus.Internal` on all of them. - `FileEditorManagerKeys.CLOSING_TO_REOPEN` is public from 2024.3 on, but `FileEditorManagerKeys` is missing in 2024.2, the minimum. - No public editor event tells a close to reopen apart: at the end of a tab drag, the platform sets the marker, closes the editor and only then drops it into the target, which for a detached window opens the file later, in a coroutine. So `isClosingToReopen` finds the platform's key by its name, with `Key.findKeyByName("CLOSING_TO_REOPEN")`, and keeps it once found. It's the same key on every supported version: from 2024.3, `FileEditorManagerImpl.CLOSING_TO_REOPEN` is `FileEditorManagerKeys.CLOSING_TO_REOPEN`, and no other platform key has the name. It's a workaround, and `findKeyByName` is deprecated, not internal, so the verifier reports one deprecated usage instead of two internal ones. Once the minimum version has `FileEditorManagerKeys`, `isClosingToReopen` can read it instead (redhat-developer#1971). The key exists once the platform's editor manager is loaded, before any editor closes. Until it's found, as with the editor manager of a test, no file has the marker, and the lookup is tried again at the next close. `EditorWindowConnectionTest` gets a test that the marker which the platform's editor manager sets is the one that LSP4IJ reads. With a wrong key name, it fails, and so do the tests of the move to the opposite tab group and of the drag into another window. Part of redhat-developer#2274
…P4IJ The plugin verifier reported `ExtensionPointName.addExtensionPointListener(CoroutineScope, ExtensionPointListener)` as an internal API usage on 2024.3 to 2026.2, from `LanguageServersRegistry.registerEpListener` and the constructor of `ServerInstallerManager` (35eb012, redhat-developer#2088). No overload is public and not deprecated on all the supported versions, 2024.2 to 2026.3: | Overload | Internal | Deprecated | Missing | |---|---|---|---| | `ExtensionPointName.addExtensionPointListener(CoroutineScope, listener)`, of redhat-developer#2088 | 2024.3 to 2026.2 | | | | `ExtensionPointName.addExtensionPointListener(listener, Disposable)` | | 2025.3 to 2026.3 | | | `ExtensionPoint.addExtensionPointListener(listener, boolean, Disposable)`, of before redhat-developer#2088 | | 2025.2 to 2026.3 | | | `ExtensionPoint.addExtensionPointListener(CoroutineScope, boolean, listener)` | | | 2024.2 to 2025.1 | So both use `ExtensionPointName.addExtensionPointListener(listener, Disposable)`, which is never internal, and deprecated on the fewest versions. A deprecation is a warning, and an internal usage blocks the Marketplace. redhat-developer#2088 said that it's deprecated only in 2026.3; it is from 2025.3. The behaviour is the one of redhat-developer#2088: - The parent of the listeners is a Disposable of the service, which `dispose()` disposes, as it cancelled their scope before: they end when the service is disposed. - The overload calls the listener only for the extensions added later, not those already loaded (`invokeForLoadedExtensions` is false on every version). `ExtensionPointListenerLifetimeTest` checks both services. Without the disposal in `dispose()`, both of its tests fail. Part of redhat-developer#2274
…account, whose API is internal in 2026.3 The plugin verifier reported `GHAccountManager` of the GitHub plugin as an internal API usage on 2026.3, with 4 usages in `GitHubPluginAccountTokenProvider` (7b66f44, redhat-developer#2230). Neither the GitHub plugin nor `com.intellij.collaboration.auth` has a public way to read the token of an account on 2026.3: - `GHAccountManager`, which has the credentials of the accounts, is `@ApiStatus.Internal` there, and public on 2024.2 to 2026.2. - `GHCompatibilityUtil.getOrRequestToken` is internal too, and asks the user to log in when there is no token. - `GHAccountsUtil` is public, but gives the accounts only. Its methods which give a token, as `requestNewToken`, are internal and show a login dialog. - `AccountManager.findCredentials` of the collaboration tools is public, but GitHub's account manager is `GHAccountManager`, which nothing public returns: `GithubProjectDefaultAccountHolder.accountManager()` is protected. - Git4Idea's `GitHttpAuthDataProvider` extensions, as the GitHub plugin's `GHSilentHttpAuthDataProvider`, are public, but they give Git the credentials of a remote URL: they need a project, which a download has none of, and an optional dependency on Git4Idea, and the provider that isn't silent shows a login dialog. So the token of the IDE's GitHub account is no longer a source: - `GitHubPluginAccountTokenProvider`, its interface `GitHubAccountTokenProvider`, `plugin-github.xml` and the optional dependency on `org.jetbrains.plugins.github` are removed, and so is the plugin from `platformBundledPlugins`. - `GitHubAssetFetcher` sends the token of `GITHUB_TOKEN`, or else of `GH_TOKEN`, or else of the LSP4IJ settings, or none. - The docs of the GitHub token no longer name the account. The settings comment and the message of the rate limit didn't name it. redhat-developer#2230 isn't in a release yet: compared with 0.30.1, a github download only gains the token of the LSP4IJ settings. Tests: - `GitHubPluginAccountTokenProviderTest` is removed. - `GitHubAssetFetcherTest` and `GitHubDownloadTaskTest` lose the tests of the account. The tests where the account was the fallback, after a token of the settings that is blank, unreadable or invalid, now expect no token. - `SecretRedactorTest` checks a message of a settings token instead of an account token. Fixes redhat-developer#2274
Collaborator
Author
|
@coderabbitai review |
Action performed
|
19 of 35 tasks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2276 +/- ##
=======================================
Coverage 58.07% 58.08%
=======================================
Files 848 846 -2
Lines 36436 36424 -12
Branches 5717 5714 -3
=======================================
- Hits 21162 21158 -4
+ Misses 12283 12281 -2
+ Partials 2991 2985 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Nov 26, 2026
lagergren
added a commit
to lagergren/lsp4ij
that referenced
this pull request
Nov 26, 2026
…a source of the GitHub token redhat-developer#2276 removes that source, whose API is internal in IntelliJ 2026.3 (redhat-developer#2274). A github download takes the token of GITHUB_TOKEN or GH_TOKEN, or else of the LSP4IJ settings.
lagergren
added a commit
that referenced
this pull request
Nov 26, 2026
… version each task and key exists (#2258) The installer descriptor, which UserDefinedLanguageServerTemplate.md described in its second half, gets a page of its own, docs/Installer.md, listed in the docs tree, with stub anchors where its sections were. Each task, key and variable says since which LSP4IJ version it exists, and a section says what an earlier version does with what it doesn't know. The task list includes showMessage, configureServer and replaceTemplateCommand get sections of their own, and the GitHub token section no longer names the IDE's GitHub account, which #2276 removed. The pages of the bundled language servers and debug adapters, and the documentation links in the installer's error messages, point to the new page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2274
What
The JetBrains Marketplace verification of the nightly build reports 6 internal API usages, from three changes since 0.30.1. An internal API usage blocks the Marketplace. This PR removes all of them: the plugin verifier now reports 0 internal API usages on every IDE from 2024.2 to 2026.3.
One commit per source, to be rebase-merged, as the third one changes a behaviour of main:
FileEditorManagerImpl.CLOSING_TO_REOPEN(2 usages, all versions)ConnectDocumentToLanguageServerSetupParticipant.isClosingToReopenKey.findKeyByName("CLOSING_TO_REOPEN"), deprecated, a workaroundExtensionPointName.addExtensionPointListener(CoroutineScope, listener)(2 usages, 2024.3 to 2026.2)LanguageServersRegistry,ServerInstallerManagerExtensionPointName.addExtensionPointListener(listener, Disposable), deprecated from 2025.3GHAccountManager(4 usages, 2026.3)GitHubPluginAccountTokenProvider1. Close to reopen
No public field has the key on every supported version.
FileEditorManagerImplis@ApiStatus.Internalon all of them.FileEditorManagerKeys.CLOSING_TO_REOPENis public from 2024.3, butFileEditorManagerKeysis missing in 2024.2, the minimum. No public editor event tells a close to reopen apart either: at the end of a tab drag, the platform sets the marker, closes the editor, and only then drops it into the target, which opens a detached window's file later, in a coroutine.So
isClosingToReopenfinds the key by its name, once, and keeps it. This is a workaround:Key.findKeyByNameis deprecated, as access by name is "a kind of hack", but it's not internal, and it's the same key on all versions:FileEditorManagerImpl.CLOSING_TO_REOPENis initialized fromFileEditorManagerKeys.CLOSING_TO_REOPEN.CLOSING_TO_REOPENis a constant of one class only, among all the jars of the IDE and its bundled plugins:FileEditorManagerImplin 2024.2,FileEditorManagerKeysin 2026.3. No other key has the name.Once the minimum is 2024.3 or later, it can read
FileEditorManagerKeys.CLOSING_TO_REOPEN(#1971).2. Extension point listeners
No overload is public and not deprecated on all the supported versions:
ExtensionPointName.addExtensionPointListener(CoroutineScope, listener), of #2088ExtensionPointName.addExtensionPointListener(listener, Disposable)ExtensionPoint.addExtensionPointListener(listener, boolean, Disposable), before #2088ExtensionPoint.addExtensionPointListener(CoroutineScope, boolean, listener)The chosen one is never internal, and deprecated on the fewest versions. (#2088 said it's deprecated only in 2026.3: it is from 2025.3.) The listeners' parent is a Disposable of the service, which
dispose()disposes, so they still end with the service. The overload passesinvokeForLoadedExtensions = falseon every version, so they still don't run for the extensions already loaded.3. The IDE's GitHub account
Neither the GitHub plugin nor
com.intellij.collaboration.authhas a public way to read an account's token on 2026.3:GHAccountManageris@ApiStatus.Internalon 2026.3 (public on 2024.2 to 2026.2).GHCompatibilityUtil.getOrRequestTokenis internal too, and asks the user to log in without a token.GHAccountsUtilis public, but gives the accounts only; its token methods (requestNewToken,requestReLogin) are internal and show a login dialog.AccountManager.findCredentialsis public, but GitHub's account manager isGHAccountManager, which nothing public returns (GithubProjectDefaultAccountHolder.accountManager()is protected).GitHttpAuthDataProviderextensions (the GitHub plugin'sGHSilentHttpAuthDataProvider) are public, but they give Git the credentials of a remote URL: they need a project, which a download has none of, and a dependency on Git4Idea; the one that isn't silent shows a login dialog.So the account is no longer a token source.
GitHubPluginAccountTokenProvider,GitHubAccountTokenProvider,plugin-github.xml, the optional dependency onorg.jetbrains.plugins.githuband its entry inplatformBundledPluginsare removed. Agithubdownload sends the token ofGITHUB_TOKEN, elseGH_TOKEN, else the LSP4IJ settings, else none. The docs no longer name the account; the settings comment and the rate-limit message never did.Release notes: #2230 isn't released, and its commit title, "…or else of the IDE's GitHub account…", would go into the 0.30.2 notes. It needs editing there to the settings token only.
Plugin verifier
./gradlew verifyPluginover all the IDEs that main's CI verifies, locally, before and after (the same IDE builds as CI run 45722841876):All 8 stay Compatible, and the 1 scheduled-for-removal usage from 2025.2 on is unchanged. The deprecated counts change by:
Key.findKeyByName: +1 on every version. From 2024.3, it replaces the access ofFileEditorManagerImpl.CLOSING_TO_REOPEN, which is deprecated there too, so 2024.3 to 2025.2 stay the same.ExtensionPointName.addExtensionPointListener(listener, Disposable): +2 from 2025.3, one per service.The experimental count drops by 4 on 2024.2 to 2025.1:
runBlockingCancellable, which only the removed account provider used.Tests
dispose(), 5 of 6 tests fail: inEditorWindowConnectionTest, the move to the opposite tab group and the drag into another window (the server read[didOpen, didClose, didOpen]) and the new marker test; inExtensionPointListenerLifetimeTest, both tests. The two-tab-groups test doesn't use the marker. With the change, all pass.EditorWindowConnectionTest.testTheMarkerOfTheEditorManagerTellsThatAnEditorClosesToReopen: the marker that the platform's editor manager sets is the one LSP4IJ reads.GitHubAssetFetcherTestandGitHubDownloadTaskTestlose the account tests; where the account was the fallback after a blank, unreadable or invalid settings token, they now expect no token.SecretRedactorTestchecks a settings-token message instead of an account one.GitHubPluginAccountTokenProviderTestis removed with its class.SelectedEditorConnectionTest,*Document*,*Connection*,ConnectDuringStopTest,KeepAliveDuringPendingStopTest,ServerStopPendingRequestsTest,WorkspaceDiagnosticsTest,com.redhat.devtools.lsp4ij.LanguageServer*,ServerAddedWithSeveralOpenProjectsTest,server.definition.extension.*,dap.definitions.extension.*,installation.*andsettings.*:Behaviour change
GITHUB_TOKENandGH_TOKEN, agithubdownload sends the token of the LSP4IJ settings, or else of the IDE's first github.com accountThe other two changes keep the behaviour: a file whose editor moves to another window or tab group stays open in its language servers, and the extension point listeners end with their service.