donkirkby/live-py-plugin

Read access error with new versions of PyCharm and IDEA

mtkalms opened this issue · 0 comments

What I did

Installed latest versions of PyCharm and InelliJ IDEA.

What happened

An error occurs as soon as a project is opened.

java.lang.Throwable: Read access is allowed from inside read-action (or EDT) only (see com.intellij.openapi.application.Application.runReadAction())
Current thread: Thread[DefaultDispatcher-worker-8,5,main] 975513678 (EventQueue.isDispatchThread()=false)
SystemEventQueueThread: Thread[AWT-EventQueue-0,6,main] 192334495
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:202)
	at com.intellij.openapi.application.impl.ApplicationImpl.assertReadAccessAllowed(ApplicationImpl.java:1004)
	at com.intellij.openapi.fileEditor.impl.FileDocumentManagerBase.getDocument(FileDocumentManagerBase.java:45)
	at io.github.donkirkby.livepycharm.SplitFileEditorProvider.createEditorAsync(SplitFileEditorProvider.java:68)
	at com.intellij.openapi.fileEditor.impl.FileEditorManagerImpl.openFileOnStartup$intellij_platform_ide_impl(FileEditorManagerImpl.kt:2000)
	at com.intellij.openapi.fileEditor.impl.UiBuilder$processFiles$2.invokeSuspend(EditorsSplitters.kt:977)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

JetBrains has completely redesigned the UI for both programs in version 2023.1. Enabling or disabling the new UI feature seems to have no effect on the error message.

When the new UI is enabled, the buttons for Live Coding and Turtle sessions are not visible anymore.

Otherwise the plugin works fine.

My environment

  • PyCharm 2023.1 (Community Edition), Build #PC-231.8109.197, built on March 29, 2023
  • IntelliJ IDEA 2023.1 (Community Edition), Build #IC-231.8109.175, built on March 28, 2023
  • Python 3.10.8
  • Apple Silicon, Mac OS 13.2