Skip to content

Settings | Languages & Frameworks | Language Servers keeps showing "Loading…": JsonTextField.setJsonFilename runs a non-blocking read action on the EDT #1921

Closed

Description

@muescha

Problem

In IntelliJ IDEA 2026.3 (builds IU-263.7307.112 and IU-263.7307.200) with LSP4IJ 0.30.0-SNAPSHOT, LSP4IJ's settings page can't show a server's details:

  • Opening Settings → Languages & Frameworks → Language Servers (LSP4IJ's page) shows a spinner with "Loading…" that never ends. The page never appears.

LSP4IJ's settings page stuck at "Loading…"

  • When the page does appear, clicking a server in the list (here LuaLS) leaves the detail panel on the right empty.

The detail panel stays empty after selecting LuaLS

Both come from the same exception, thrown while the detail panel of the selected server is built.

(The tree shows two "Language Servers" entries because IntelliJ 2026.3 bundles its own page with the same name; that is a separate issue, #1920. The one stuck here is LSP4IJ's page, as the stack trace below shows.)

Cause

At the same moment, idea.log has this error, with "Plugin to blame: LSP4IJ version: 0.30.0-SNAPSHOT":

SEVERE - Unhandled exception in [ModalityState.NON_MODAL, Dispatchers.Default]
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Access from Event Dispatch Thread (EDT) is not allowed; see https://jb.gg/ij-platform-threading for details
Current thread: Thread[#112,AWT-EventQueue-0,6,main] (EventQueue.isDispatchThread()=true)
  at com.intellij.util.concurrency.ThreadingAssertions.assertBackgroundThread(ThreadingAssertions.java:145)
  at com.intellij.openapi.application.impl.ApplicationImpl.assertIsNonDispatchThread(ApplicationImpl.java:1253)
  at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:143)
  at com.intellij.openapi.application.impl.NonBlockingReadActionImpl.executeSynchronously(NonBlockingReadActionImpl.java:306)
  at com.redhat.devtools.lsp4ij.internal.ApplicationUtils.runCancellableReadAction(ApplicationUtils.java:59)
  at com.redhat.devtools.lsp4ij.LSPIJUtils.getFile(LSPIJUtils.java:562)
  at com.redhat.devtools.lsp4ij.settings.ui.JsonTextField.setJsonFilename(JsonTextField.java:92)
  at com.redhat.devtools.lsp4ij.settings.ui.LanguageServerPanel.createClientConfigurationField(LanguageServerPanel.java:472)
  at com.redhat.devtools.lsp4ij.settings.ui.LanguageServerPanel.addConfigurationTab(LanguageServerPanel.java:319)
  at com.redhat.devtools.lsp4ij.settings.ui.LanguageServerPanel.createUI(LanguageServerPanel.java:237)
  at com.redhat.devtools.lsp4ij.settings.ui.LanguageServerPanel.<init>(LanguageServerPanel.java:109)
  at com.redhat.devtools.lsp4ij.settings.LanguageServerView.createSettings(LanguageServerView.java:407)
  at com.redhat.devtools.lsp4ij.settings.LanguageServerView.<init>(LanguageServerView.java:80)
  at com.redhat.devtools.lsp4ij.settings.LanguageServerConfigurable.createOptionsPanel(LanguageServerConfigurable.java:69)
  at com.intellij.openapi.ui.NamedConfigurable.createComponent(NamedConfigurable.java:132)
  at com.intellij.openapi.ui.MasterDetailsComponent.updateSelection(MasterDetailsComponent.java:612)
  at com.intellij.openapi.ui.MasterDetailsComponent.updateSelectionFromTree(MasterDetailsComponent.java:261)
  at com.intellij.openapi.ui.MasterDetailsComponent.addNotify(MasterDetailsComponent.java:239)
  ...
  at com.intellij.ui.CardLayoutPanel.select(CardLayoutPanel.java:110)

Claude Code traced it through the code like this:

  1. When the page opens, MasterDetailsComponent selects the first server in the list and builds its detail panel on the EDT (LanguageServerConfigurable.createOptionsPanel → LanguageServerPanel.createUI).
  2. createClientConfigurationField calls clientConfigurationWidget.setJsonFilename(...), which renames the editor's virtual file so the right JSON schema applies. To get that file, JsonTextField.setJsonFilename calls LSPIJUtils.getFile(document, project).
  3. LSPIJUtils.getFile(Document, Disposable) only reads directly if isReadAccessAllowed(). Here the EDT has no read access, so it goes to ApplicationUtils.runCancellableReadAction, which is ReadAction.nonBlocking(...).executeSynchronously(). The platform forbids that on the EDT and throws.
  4. The exception aborts building the panel. When this happens while the page itself is being shown (MasterDetailsComponent.addNotify inside CardLayoutPanel.select), the settings dialog keeps showing its "Loading…" placeholder. When it happens on a click in the server list, the trace goes through AutoScrollToSourceHandler.onMouseClicked → MasterDetailsComponent.updateSelectionFromTree to the same createOptionsPanel, and the detail panel stays empty.

idea.log has this exception three times: twice in build .112 (once on opening the page, once on a click in the list) and once in build .200 (on opening the page).

Related

#1807 fixed the same exception on closing the page (LanguageServerPanel.dispose → resetJsonSchema → setJsonFilename, reported in #1650) by not renaming the file on dispose. The opening path is still on main: LanguageServerPanel.createClientConfigurationField still calls setJsonFilename (line 541 on main).

The same call, and so the same risk, is also in:

  • InstallerPanel (installerConfigurationWidget.setJsonFilename(...), line 94 in our checkout)
  • WorkspaceFoldersPanel (jsonEditor.setJsonFilename(...), line 124)
  • LanguageServerPanel line 561 (configurationWidget.resetJsonSchema() outside of dispose)
  • SchemaBackedJsonTextField.setJsonSchema, which calls setJsonFilename itself

Possible fix

Don't use nonBlocking().executeSynchronously() on the EDT. Options:

  • In ApplicationUtils.runCancellableReadAction (or in LSPIJUtils.getFile(Document, Disposable)): if the current thread is the EDT, run a plain ReadAction.compute(...). FileDocumentManager.getFile(document) is cheap, so a short blocking read on the EDT doesn't freeze anything. This covers every caller at once.
  • Or in JsonTextField.setJsonFilename: get the file with ReadAction.compute(() -> FileDocumentManager.getInstance().getFile(document)) instead of LSPIJUtils.getFile.

The first option is safer, because other EDT callers of runCancellableReadAction would fail the same way.

How this was checked

  • Observed in IntelliJ IDEA 2026.3, builds IU-263.7307.112 and IU-263.7307.200 (JBR 25.0.4.1), macOS, with LSP4IJ 0.30.0-SNAPSHOT and one user-defined server (LuaLS).
  • Claude Code read the stack trace from idea.log and followed it through the current main sources. It didn't build or test a fix.
  • Not checked: whether older IDE versions are affected. The code path itself isn't new, so the trigger is probably that the EDT has no read access at that point in 2026.3.

Activity

  1. added a commit that references this issue on Nov 10, 2026
    754254a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions