redhat-developer / redhat-developer/lsp4ij

com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Access from Event Dispatch Thread (EDT) is not allowed;

Open
#1,650 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
344
Forks
113
Avg merge
5h 22m
Merged PRs (30d)
15

Description

Current thread: Thread[#48,AWT-EventQueue-0,6,main] 584739690 (EventQueue.isDispatchThread()=true)
SystemEventQueueThread: (same)
	at com.intellij.util.concurrency.ThreadingAssertions.createThreadRequirementException(ThreadingAssertions.java:281)
	at com.intellij.util.concurrency.ThreadingAssertions.throwThreadRequirementException(ThreadingAssertions.java:275)
	at com.intellij.util.concurrency.ThreadingAssertions.assertBackgroundThread(ThreadingAssertions.java:101)
	at com.intellij.openapi.application.impl.ApplicationImpl.assertIsNonDispatchThread(ApplicationImpl.java:1251)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runWithWriteActionPriority(ProgressIndicatorUtils.java:138)
	at com.intellij.openapi.progress.util.ProgressIndicatorUtils.runInReadActionWithWriteActionPriority(ProgressIndicatorUtils.java:102)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.attemptComputation(NonBlockingReadActionImpl.java:768)
	at com.intellij.concurrency.ThreadContext.installThreadContext(threadContext.kt:307)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.lambda$executeSynchronously$0(NonBlockingReadActionImpl.java:656)
	at com.intellij.openapi.application.impl.NbraUtilKt.runSynchronousNonBlockingReadActionWithCompensation$lambda$0(nbraUtil.kt:15)
	at kotlinx.coroutines.internal.intellij.IntellijCoroutines.runAndCompensateParallelism-VtjQ1oo(intellij.kt:91)
	at com.intellij.util.IntelliJCoroutinesFacade.runAndCompensateParallelism-VtjQ1oo(IntelliJCoroutinesFacade.kt:45)
	at com.intellij.openapi.application.impl.NbraUtilKt.runSynchronousNonBlockingReadActionWithCompensation(nbraUtil.kt:14)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl$Submission.executeSynchronously(NonBlockingReadActionImpl.java:643)
	at com.intellij.openapi.application.impl.NonBlockingReadActionImpl.executeSynchronously(NonBlockingReadActionImpl.java:295)
	at com.redhat.devtools.lsp4ij.internal.ApplicationUtils.runCancellableReadAction(ApplicationUtils.java:59)
	at com.redhat.devtools.lsp4ij.LSPIJUtils.getPsiFile(LSPIJUtils.java:570)
	at com.redhat.devtools.lsp4ij.ConnectDocumentToLanguageServerSetupParticipant.fileClosed(ConnectDocumentToLanguageServerSetupParticipant.java:125)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeMethod(MessageBusImpl.kt:831)
	at com.intellij.util.messages.impl.MessageBusImplKt.invokeListener(MessageBusImpl.kt:775)
	at com.intellij.util.messages.impl.MessageBusImplKt.deliverMessage(MessageBusImpl.kt:514)
	at com.intellij.util.messages.impl.MessageBusImplKt.pumpWaiting(MessageBusImpl.kt:493)
	at com.intellij.util.messages.impl.MessageBusImplKt.access$pumpWaiting(MessageBusImpl.kt:1)
	at com.intellij.util.messages.impl.MessagePublisher.invoke(MessageBusImpl.kt:556)
	at jdk.proxy2/jdk.proxy2.$Proxy170.fileClosed(Unknown Source)
	at com.intellij.openapi.fileEditor.impl.EditorWindow.closeFile(EditorWindow.kt:759)
	at com.intellij.openapi.fileEditor.impl.EditorWindow.closeFile(EditorWindow.kt:701)
	at com.intellij.openapi.fileEditor.impl.EditorWindow.closeFile(EditorWindow.kt:695)
	at com.intellij.openapi.fileEditor.impl.EditorWindow.defaultCloseFile(EditorWindow.kt:1170)
	at com.intellij.openapi.fileEditor.impl.EditorWindow.doTrimSize(EditorWindow.kt:1089)
	at com.intellij.openapi.fileEditor.impl.EditorWindow.trimToSize(EditorWindow.kt:1051)
	at com.intellij.openapi.fileEditor.impl.EditorWindow.addComposite$intellij_platform_ide_impl(EditorWindow.kt:404)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.doOpenInEdt(FileEditorManagerImpl.kt:1433)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.doOpenInEdt$default(FileEditorManagerImpl.kt:1417)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl$open(FileEditorManagerImpl.kt:1319)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileImpl(FileEditorManagerImpl.kt:1329)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFile(FileEditorManagerImpl.kt:1067)
	at com.intellij.diff.editor.DiffEditorTabFilesManagerImpl.showDiffFile(DiffEditorTabFilesManagerImpl.kt:26)
	at com.intellij.diff.editor.DiffEditorTabFilesManager.showDiffFile(DiffEditorTabFilesManager.kt:13)
	at com.intellij.openapi.vcs.changes.ui.CommitToolWindowUtil.openDiff(CommitToolWindowUtil.kt:30)
	at com.intellij.openapi.vcs.changes.ChangesViewEditorDiffPreview.openPreview(ChangesViewEditorDiffPreview.kt:70)
	at com.intellij.openapi.vcs.changes.EditorTabDiffPreview.performDiffAction(EditorTabDiffPreview.kt:81)
	at com.intellij.openapi.vcs.changes.ChangesViewEditorDiffPreview$1$1.invokeSuspend$lambda$0(ChangesViewEditorDiffPreview.kt:47)
	at com.intellij.codeWithMe.ClientId$Companion.withExplicitClientId(ClientId.kt:253)
	at com.intellij.openapi.vcs.changes.ChangesViewEditorDiffPreview$1$1.invokeSuspend(ChangesViewEditorDiffPreview.kt:39)
	at com.intellij.openapi.vcs.changes.ChangesViewEditorDiffPreview$1$1.invoke(ChangesViewEditorDiffPreview.kt)
	at com.intellij.openapi.vcs.changes.ChangesViewEditorDiffPreview$1$1.invoke(ChangesViewEditorDiffPreview.kt)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$mapLatest$1.invokeSuspend(Merge.kt:213)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$mapLatest$1.invoke(Merge.kt)
	at kotlinx.coroutines.flow.FlowKt__MergeKt$mapLatest$1.invoke(Merge.kt)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invokeSuspend(Merge.kt:30)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invoke(Merge.kt)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1$2.invoke(Merge.kt)
	at kotlinx.coroutines.intrinsics.UndispatchedKt.startCoroutineUndispatched(Undispatched.kt:20)
	at kotlinx.coroutines.CoroutineStart.invoke(CoroutineStart.kt:360)
	at kotlinx.coroutines.AbstractCoroutine.start(AbstractCoroutine.kt:134)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch(Builders.common.kt:53)
	at kotlinx.coroutines.BuildersKt.launch(Unknown Source)
	at kotlinx.coroutines.BuildersKt__Builders_commonKt.launch$default(Builders.common.kt:44)
	at kotlinx.coroutines.BuildersKt.launch$default(Unknown Source)
	at kotlinx.coroutines.flow.internal.ChannelFlowTransformLatest$flowCollect$3$1.emit(Merge.kt:29)
	at kotlinx.coroutines.flow.internal.FlowValueWrapperInternalKt.emitInternal(FlowValueWrapperInternal.kt:39)
	at kotlinx.coroutines.flow.SharedFlowImpl.collect$suspendImpl(SharedFlow.kt:397)
	at kotlinx.coroutines.flow.SharedFlowImpl$collect$1.invokeSuspend(SharedFlow.kt)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
	at com.intellij.openapi.application.impl.DispatchedRunnable.run(DispatchedRunnable.kt:42)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:246)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:228)
	at com.intellij.openapi.application.impl.NonBlockingFlushQueue.runNextEvent$lambda$4(NonBlockingFlushQueue.kt:353)
	at com.intellij.concurrency.ThreadContext.resetThreadContext(threadContext.kt:295)
	at com.intellij.openapi.application.impl.NonBlockingFlushQueue.runNextEvent(NonBlockingFlushQueue.kt:352)
	at com.intellij.openapi.application.impl.NonBlockingFlushQueue.flushNow(NonBlockingFlushQueue.kt:299)
	at com.intellij.openapi.application.impl.NonBlockingFlushQueue.FLUSH_NOW$lambda$0(NonBlockingFlushQueue.kt:158)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:323)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:732)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:711)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:731)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:584)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$0$0$0(IdeEventQueue.kt:384)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$0(IdeEventQueue.kt:1122)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:106)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1122)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$0(IdeEventQueue.kt:382)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:422)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in ConnectDocumentToLanguageServerSetupParticipant.java at fileClosed, then trace LSPIJUtils.getPsiFile and ApplicationUtils.runCancellableReadAction against the supplied EDT stack trace. Reproduce the failure by opening a diff preview and closing or replacing the file; done means this path no longer raises the EDT access exception.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
desktop, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.