In a Gradle setup, I updated to the latest 2026.2 eap.
Now, this test fails:
@Test
fun `write testing`(): Unit = runBlocking {
codeInsight.configureByText("a.txt", "")
val document = codeInsight.editor.document
writeAction {
document.setText("new")
}
}
Apparently, with this EAP, writeAction is now executed in the background.
But document.setText explicitly requires a write action in the EDT, thus edtWriteAction.
https://youtrack.jetbrains.com/issue/IJPL-149765 mentions that edtWriteAction will be deprecated.
What’s the right way to this this?
Is it a problem of setText or are we expected to updates all such writeAction calls to the deprecated edtWriteAction?
Exception:
Access is allowed from Event Dispatch Thread (EDT) only; see https://jb.gg/ij-platform-threading for details
Current thread: Thread[#95,DefaultDispatcher-worker-30 @coroutine#1080,5,main] 1102984295 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[#50,AWT-EventQueue-0,6,main] 935160003
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Access is allowed from Event Dispatch Thread (EDT) only; see https://jb.gg/ij-platform-threading for details
Current thread: Thread[#95,DefaultDispatcher-worker-30 @coroutine#1080,5,main] 1102984295 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[#50,AWT-EventQueue-0,6,main] 935160003
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.assertEventDispatchThread(ThreadingAssertions.java:78)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:105)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:80)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:68)
at com.intellij.openapi.command.impl.CoreCommandProcessor.executeCommand(CoreCommandProcessor.java:46)
at com.intellij.openapi.editor.impl.DocumentImpl.setText(DocumentImpl.java:1181)