# 2026.2 eap with writeAction and document.setText()

**URL:** <https://platform.jetbrains.com/t/2026-2-eap-with-writeaction-and-document-settext/4437>\
**Category:** IntelliJ Platform\
**Tags:** threading, eap\
**Created:** [June 10, 2026, 11:00am UTC](https://platform.jetbrains.com/t/2026-2-eap-with-writeaction-and-document-settext/4437 "2026-06-10T11:00:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jansorg](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/jansorg/32/52_2.png) [@jansorg](https://platform.jetbrains.com/u/jansorg)\
**Post date:** [June 10, 2026, 11:00am UTC](https://platform.jetbrains.com/t/2026-2-eap-with-writeaction-and-document-settext/4437/1 "2026-06-10T11:00:30Z")

</div>

In a Gradle setup, I updated to the latest 2026.2 eap.

Now, this test fails:

```kotlin
    @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](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:

```auto
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)

```

---

<div class="post-metadata">

**Author:** ![konstantin.nisht](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/konstantin.nisht/32/186_2.png) [@konstantin.nisht](https://platform.jetbrains.com/u/konstantin.nisht)\
**Post date:** [June 10, 2026, 12:46pm UTC](https://platform.jetbrains.com/t/2026-2-eap-with-writeaction-and-document-settext/4437/3 "2026-06-10T12:46:56Z")

</div>

Hi Joachim,

`edtWriteAction` is not deprecated, this is a stable API. It is the intended function for your use-case. Deprecation of `edtWriteAction` will not happen anytime soon, the Platform is not ready yet for this.

`writeAction` is promoted to stable for 2026.2, and with stabilization it changed its semantics one final time.

---

<div class="post-metadata">

**Author:** ![jansorg](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/jansorg/32/52_2.png) [@jansorg](https://platform.jetbrains.com/u/jansorg)\
**Post date:** [June 10, 2026, 1:19pm UTC](https://platform.jetbrains.com/t/2026-2-eap-with-writeaction-and-document-settext/4437/4 "2026-06-10T13:19:54Z")

</div>

Thanks!

If I understand correctly, any plugin using writeAction to update documents (and possible other types of changes) will cause exceptions and will have to switch to edtWriteAction and thus update the baseline to 2025.1 because only that version has the edtWriteAction method?

---

<div class="post-metadata">

**Author:** ![konstantin.nisht](https://sea1.discourse-cdn.com/flex001/user_avatar/platform.jetbrains.com/konstantin.nisht/32/186_2.png) [@konstantin.nisht](https://platform.jetbrains.com/u/konstantin.nisht)\
**Post date:** [June 10, 2026, 1:35pm UTC](https://platform.jetbrains.com/t/2026-2-eap-with-writeaction-and-document-settext/4437/5 "2026-06-10T13:35:21Z")

</div>

Yes, that’s correct.
