KronicDeth / intellij-elixir

Elixir plugin for JetBrain's IntelliJ Platform (including Rubymine)
Other
1.84k stars 154 forks source link

Runtime Exception results in not being able to select newly addes Elixir SDK for the project #3637

Open psteininger opened 3 months ago

psteininger commented 3 months ago

System

Plugin Version: 19.0.0 Application: RubyMine (2024.2) Operating System: Mac OS X (14.0)

What I was doing

This seems to occur when adding/removing elixir and Erlang SDKs.

After adding one of each, one can't select the elixir SDK for the project until the settings editor is closed and then re-opened.

Event

Exception

Stacktrace

com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Write access is allowed inside write-action only (see Application.runWriteAction()); see https://jb.gg/ij-platform-threading for details ``` com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Write access is allowed inside write-action only (see Application.runWriteAction()); see https://jb.gg/ij-platform-threading for details Current thread: Thread[#46,AWT-EventQueue-0,6,main] 878135896 (EventQueue.isDispatchThread()=true) SystemEventQueueThread: (same) at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:177) at com.intellij.util.concurrency.ThreadingAssertions.throwThreadAccessException(ThreadingAssertions.java:172) at com.intellij.util.concurrency.ThreadingAssertions.assertWriteAccess(ThreadingAssertions.java:167) at com.intellij.openapi.projectRoots.impl.ProjectJdkImpl.commitChanges(ProjectJdkImpl.java:187) at org.elixir_lang.facet.sdk.Editor.reset(Editor.kt:201) at org.elixir_lang.facet.sdk.Editor.(Editor.kt:65) at org.elixir_lang.facet.sdks.Configurable$updateSdkPanel$selectedEditor$1$1.invoke(Configurable.kt:197) at org.elixir_lang.facet.sdks.Configurable$updateSdkPanel$selectedEditor$1$1.invoke(Configurable.kt:197) at org.elixir_lang.facet.sdks.Configurable.updateSdkPanel$lambda$13$lambda$12(Configurable.kt:197) at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1228) at org.elixir_lang.facet.sdks.Configurable.updateSdkPanel(Configurable.kt:197) at org.elixir_lang.facet.sdks.Configurable.addListeners$lambda$7(Configurable.kt:167) at java.desktop/javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:231) at java.desktop/javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:206) at java.desktop/javax.swing.DefaultListSelectionModel.fireValueChanged(DefaultListSelectionModel.java:258) at java.desktop/javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:459) at java.desktop/javax.swing.DefaultListSelectionModel.changeSelection(DefaultListSelectionModel.java:469) at java.desktop/javax.swing.DefaultListSelectionModel.setSelectionInterval(DefaultListSelectionModel.java:513) at java.desktop/javax.swing.JList.setSelectedIndex(JList.java:2232) at java.desktop/javax.swing.JList.setSelectedValue(JList.java:2389) at org.elixir_lang.facet.sdks.Configurable.addCreatedSdk(Configurable.kt:105) at org.elixir_lang.facet.sdks.Configurable.access$addCreatedSdk(Configurable.kt:33) at org.elixir_lang.facet.sdks.Configurable$addSdk$1.invoke(Configurable.kt:173) at org.elixir_lang.facet.sdks.Configurable$addSdk$1.invoke(Configurable.kt:173) at org.elixir_lang.facet.sdks.Configurable.addSdk$lambda$8(Configurable.kt:173) at com.intellij.util.Consumer.accept(Consumer.java:20) at com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectSdksModel.doAdd(ProjectSdksModel.java:560) at com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectSdksModel.setupSdk(ProjectSdksModel.java:546) at com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectSdksModel.lambda$doAdd$5(ProjectSdksModel.java:446) at com.intellij.openapi.projectRoots.impl.DependentSdkType.lambda$createSdkOfType$1(DependentSdkType.java:77) at com.intellij.openapi.projectRoots.impl.SdkConfigurationUtil.lambda$selectSdkHome$12(SdkConfigurationUtil.java:332) at com.intellij.openapi.fileChooser.ex.FileChooserDialogImpl.choose(FileChooserDialogImpl.java:141) at com.intellij.openapi.fileChooser.FileChooser.chooseFiles(FileChooser.java:99) at com.intellij.openapi.projectRoots.impl.SdkConfigurationUtil.selectSdkHome(SdkConfigurationUtil.java:324) at com.intellij.openapi.projectRoots.impl.SdkConfigurationUtil.selectSdkHome(SdkConfigurationUtil.java:294) at com.intellij.openapi.projectRoots.impl.DependentSdkType.createSdkOfType(DependentSdkType.java:74) at com.intellij.openapi.projectRoots.impl.DependentSdkType.showCustomCreateUI(DependentSdkType.java:59) at com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectSdksModel.doAdd(ProjectSdksModel.java:446) at com.intellij.openapi.roots.ui.configuration.projectRoot.ProjectSdksModel.doAdd(ProjectSdksModel.java:429) at org.elixir_lang.facet.sdks.Configurable.addSdk(Configurable.kt:173) at org.elixir_lang.facet.sdks.Configurable.createComponent$lambda$1(Configurable.kt:66) at com.intellij.ui.ToolbarDecorator$3.doAdd(ToolbarDecorator.java:536) at com.intellij.ui.CommonActionsPanel$AddButton.actionPerformed(CommonActionsPanel.java:387) at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:221) at com.intellij.openapi.actionSystem.impl.ActionButton.lambda$performAction$2(ActionButton.java:200) at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.performWithActionCallbacks(ActionManagerImpl.kt:1172) at com.intellij.openapi.actionSystem.ex.ActionUtil.performDumbAwareWithCallbacks(ActionUtil.kt:359) at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:200) at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:515) at java.desktop/java.awt.Component.processEvent(Component.java:6386) ```
joshuataylor commented 3 months ago

Yeah, there is a massive issue with how SDKs work, especially for RubyMine. I think this is also tied to the EDT and timeouts.

I've been pushing some recent commits to help with this, and i'm hoping I can get a point release out soon for this.

Would you be up for help testing an EAP release, if one was made available?

Also, the entire SDK concept is in the concept of bring replaced to simplify and remove the concept of bring tied to JDK.

psteininger commented 3 months ago

@joshuataylor I am happy to help in whatever way I can. I can definitely do some testing on multiple versions (I have a full-suite subscription).

I am doing some interviews and code assignments atm, but I should have a lot more free time in about 3-4 weeks to even try my hand at development. I haven't touched Java in over a decade, but I shouldn't have too much trouble getting back into it. It would be super helpful to get my eyes on some IntelliJ docs for Plugins and an idea of how to best structure workflow for dev and testing.

I know you're just getting into it now, but learning quickly what you have learned so far would be an extra boost of motivation :)

I am particularly motivated to sort out why the debugger doesn't work and try to get that fixed ( #3629 ).

joshuataylor commented 3 months ago

Awesome! With the new 19.0.0 release we can test super easily with new commands for every IDE JB offers, but I usually test on the most used ones.

I'm hoping the testing for this specific issue should be in just selecting EAP, seeing if it's fixed, then releasing 19.0.1.

joshuataylor commented 3 months ago

Added #3646 as an issue to track, keeping this open.