vaadin / designer

Public repository for Vaadin Designer
https://vaadin.com/designer
16 stars 3 forks source link

Slow operations prohibited on EDT exceptions with IntelliJ IDEA 2021.2.4 and later #2424

Open anssit opened 2 years ago

anssit commented 2 years ago

Steps to reproduce

Open a V10+ design in IntelliJ IDEA Ultimate 2021.2.4 and later.

Actual behavior

IntelliJ IDEA pops up "IDE error occurred" notifications about "Slow operations prohibited on EDT" such as

java.lang.Throwable: Slow operations are prohibited on EDT. See SlowOperations.assertSlowOperationsAreAllowed javadoc.
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:182)
    at com.intellij.util.SlowOperations.assertSlowOperationsAreAllowed(SlowOperations.java:102)
    at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:784)
    at com.intellij.psi.stubs.StubIndexImpl.getContainingIds(StubIndexImpl.java:514)
    at com.intellij.psi.stubs.StubIndexImpl.processElements(StubIndexImpl.java:318)
    at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:100)
    at com.intellij.psi.stubs.StubIndex.getElements(StubIndex.java:88)
    at com.intellij.psi.impl.java.stubs.index.JavaAnnotationIndex.get(JavaAnnotationIndex.java:30)

Expected behavior

No such exceptions

IDE, Designer and OS version

IntelliJ IDEA 2021.2.4 and later, Designer 4.6.12, any OS

anssit commented 2 years ago

Notice that these exceptions do not block the use of Designer.

anssit commented 2 years ago

See SlowOperations.assertSlowOperationsAreAllowed. The purpose of these exceptions is apparently to make plugin developers aware of the potentially slow operations they are performing in the event thread and make them perform the operations in background tasks instead. However, such changes are easily non-trivial, and take some time to get implemented.

Meanwhile, if the exceptions get annoying, those can be disabled: "The notification can be disabled at Help | Find Action | Registry | ide.slow.operations.assertion." (source).