Skip to content

Conversation

@sh41
Copy link
Contributor

@sh41 sh41 commented Nov 26, 2025

Hi,

I saw the chat in #3711 about the difficulties with the changes that JB have made to the APIs but I wanted to carry on using this excellent plugin with 2025.3, so I've created a version that only works on IntelliJ IDEA 2025.3 Beta. It's based off all the good work that @joshuataylor has done in #3711, but I haven't done much real world testing with it yet.

I've got the tests working (at least on my local setup) and have resolved a bunch of warnings that I thought were causing issues, but actually weren't.

The main reason I created this was to resolve an issue I was having opening Elixir projects for the first time in IDEA 2025.3 Beta. It would crash with the error below (reproduced here to help others with the same problem find it).

   Internal error
   
   com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Access is allowed from Event Dispatch Thread (EDT) only; If you access or modify model on EDT consider wrapping your code in WriteIntentReadAction  or ReadAction; see https://jb.gg/ij-platform-threading for details
   Current thread: Thread[#93,DefaultDispatcher-worker-42,5,main] 177714018 (EventQueue.isDispatchThread()=false)
   SystemEventQueueThread: Thread[#42,AWT-EventQueue-0,6,main] 993174760
           at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:257)
           at com.intellij.util.concurrency.ThreadingAssertions.throwThreadAccessException(ThreadingAssertions.java:248)
           at com.intellij.util.concurrency.ThreadingAssertions.assertEventDispatchThread(ThreadingAssertions.java:89)
           at com.intellij.ide.impl.DataManagerImpl.getDataContext(DataManagerImpl.kt:198)
           at com.intellij.ide.impl.DataManagerImpl.getDataContext(DataManagerImpl.kt:231)
           at com.intellij.projectImport.ProjectImportBuilder.getCurrentProject(ProjectImportBuilder.java:64)
           at org.elixir_lang.mix.project._import.Builder.setProjectRoot(Builder.kt:162)
           at org.elixir_lang.mix.project.OpenProcessor.doQuickImport(OpenProcessor.kt:20)
           at com.intellij.projectImport.ProjectOpenProcessorBase.openProjectAsync$suspendImpl(ProjectOpenProcessorBase.kt:97)
           at com.intellij.projectImport.ProjectOpenProcessorBase.openProjectAsync(ProjectOpenProcessorBase.kt)
           at com.intellij.ide.impl.ProjectUtil.chooseProcessorAndOpenAsync(ProjectUtil.kt:319)
           at com.intellij.ide.impl.ProjectUtil.openOrImportAsync(ProjectUtil.kt:246)
           at com.intellij.ide.impl.ProjectUtil$openOrImportAsync$1.invokeSuspend(ProjectUtil.kt)
           at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34)
           at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100)
           at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:610)
           at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runDefaultDispatcherTask(CoroutineScheduler.kt:1194)
           at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:906)
           at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:775)
           at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:762)``` 

Hope this is useful to someone!

intellij-elixir-22.0.0-pre+20251203020128.zip

  • built with IDEA Ultimate 2025 Release Candidate libraries.

sh41 added 12 commits November 26, 2025 02:39
- Switch from IC to IU (IntelliJ IDEA Community to Ultimate)
- Update platform versions to 2025.3-EAP-SNAPSHOT
- Add dynamic EAP version fetching from JetBrains API
- Replace intelliLang plugin with intellij.platform.langInjection module
- Update Gradle plugin from 2.7.2 to 2.10.4
The Char.toInt() method has been deprecated in Kotlin stdlib.
Replace all occurrences with the Char.code property.
The String.capitalize() and String.decapitalize() methods have been
deprecated in Kotlin stdlib. Replace with replaceFirstChar { it.uppercase() }
and replaceFirstChar { it.lowercase() } respectively.
The java.nio.charset.StandardCharsets.UTF_8 static field has been
deprecated. Replace with Charset.forName("UTF-8").
The 4-parameter addBrowseFolderListener(title, description, project, descriptor)
has been deprecated. Use the 2-parameter version and move title/description
into the FileChooserDescriptor via withTitle() and withDescription().
The startOffset and endOffset extension properties from
com.intellij.refactoring.suggested are deprecated. Replace with
direct access to PsiElement.textRange.startOffset and
PsiElement.textRange.endOffset.
2025.3 reverts to the same behaviour as 2021.3 which caused bug KronicDeth#2374 resolved in KronicDeth#2461. This just includes the 2025.3 build in the workaround logic.
…UsagesAction`

This avoids a "Double smart pointer removal" exception in the teardown while retaining the ability to check the actual results of the usage search
@sh41 sh41 changed the base branch from main to feature/support-2025-2 November 26, 2025 02:53
sh41 added 17 commits November 26, 2025 03:12
The scan is now performed lazily when `getList()` is called, rather than immediately in `setProjectRoot()`. Fixes IntelliJ 2025.3 compatibility by returning false from OpenProcessor.
…ions

This won't work on previous versions. Also, disable the dynamic EAP version because that's only intended for dev work.
The base classes are not tests, but they were showing as "Ignored". This excludes them from the search pattern so that they are not mentioned as Ignored in the completed test report.
```
Build file '/dev/build.gradle': line 112
The org.gradle.api.plugins.JavaPluginConvention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.14.3/userguide/upgrading_version_8.html#java_convention_deprecation
        at build_8l04vxwyktujcq3n0cbxr7t3w$_run_closure2.doCall$original(/dev/build.gradle:112)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at build_8l04vxwyktujcq3n0cbxr7t3w.run(/dev/build.gradle:110)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
Build file '/dev/build.gradle': line 113
The org.gradle.api.plugins.JavaPluginConvention type has been deprecated. This is scheduled to be removed in Gradle 9.0. Consult the upgrading guide for further information: https://docs.gradle.org/8.14.3/userguide/upgrading_version_8.html#java_convention_deprecation
        at build_8l04vxwyktujcq3n0cbxr7t3w$_run_closure2.doCall$original(/dev/build.gradle:113)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
        at build_8l04vxwyktujcq3n0cbxr7t3w.run(/dev/build.gradle:110)
        (Run with --stacktrace to get the full stack trace of this deprecation warning.)
```
@sh41
Copy link
Contributor Author

sh41 commented Nov 28, 2025

@joshuataylor I spent some more time on this dealing with some of the deprecations and have ended up migrating the build.gradle scripts to kotlin and refactoring the GH Actions to be a bit DRYer. I also added in some test reporting which you can see an example of in https://github.com/KronicDeth/intellij-elixir/actions/runs/19750620486?pr=3717

Now I need to spend some time actually using the plugin! I've uploaded the latest plugin artifact to the summary above if anyone else wants to try it.

@sh41 sh41 force-pushed the feature/support-2025-3 branch from 9b789a0 to e8c4fc8 Compare November 28, 2025 20:38
@CrystalJewell
Copy link

CrystalJewell commented Dec 1, 2025

@sh41
Just installed this updated version in the 2025.3 RC Build #IU-253.28294.251 and right off the bat the first thing I noticed is this is the first time in what feels like years that I haven't been greeted with the report error box as soon as I open a project. I didn't realize how much of a habit it had become to just close out that popup until I didn't need to. I almost exclusively work in Elixir so I'd be more than happy to help with testing updated versions.


Update: Got the first error popup.

Looks like req which is a nested dependency in this particular project uses warn_if_outdated for the ex_doc dependency and causes this error. Interestingly it didn't happen when I opened the project, only when switching branches.

Element

{:ex_doc, ">= 0.0.0", only: :docs, warn_if_outdated: true}

From: /deps/req/mix.exs:70

Context

      {:plug, "~> 1.0", [optional: true] ++ plug_opts()},
      {:brotli, "~> 0.3.1", optional: true},
      {:ezstd, "~> 1.0", optional: true},
      {:aws_signature, "~> 0.3.2", only: :test},
      {:bypass, "~> 2.1", only: :test},
      {:ex_doc, ">= 0.0.0", only: :docs, warn_if_outdated: true},
      {:bandit, "~> 1.0", only: :test},
      {:castore, "~> 1.0", only: :test}
    ]
  end

From: /deps/req/mix.exs:65-75

Element Class Name

org.elixir_lang.psi.impl.ElixirTupleImpl
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: java.lang.Throwable: Don't know if Mix.Dep option `warn_if_outdated` is important for determining location of dependency
	at com.intellij.idea.IdeaLogger.error(IdeaLogger.java:162)
	at org.elixir_lang.errorreport.Logger.error(Logger.kt:51)
 (omitting for space but more than happy to supply entire stacktrace if needed)
Caused by: java.lang.Throwable: Don't know if Mix.Dep option `warn_if_outdated` is important for determining location of dependency
	at org.elixir_lang.errorreport.Logger.error(Logger.kt:45)

@joshuataylor
Copy link
Collaborator

joshuataylor commented Dec 2, 2025

Legend!

Sorry for the delay on this, I've been busy with other work.

I've also been working on "Elixir Helper", which is a LSP integration of Elixir.

I'll try and have a look at this this week, otherwise it'll be over the weekend.

(Got IRL family stuff going on this week, apologies for the delay)

@sh41
Copy link
Contributor Author

sh41 commented Dec 2, 2025

Hi @CrystalJewell, funnily enough I just had the same error pop up and have fixed it. New version now available in the first comment above.

@joshuataylor, great news on the LSP work. Not sure what is best to do with this version. I don't use RubyMine or anything like that and haven't even looked at what would be needed for it to work on those.

sh41 added 3 commits December 2, 2025 09:30
 - Remove IntellijIdeaCommunity from runIdePlatforms (no longer available in 2025.3+)
 - Use Action wrapper for intellijPlatformTesting.runIde.register() to fix type inference
 - Clean up deprecated Community Edition version properties
 - Remove IntellijIdeaCommunity from runIdePlatforms (no longer available in 2025.3+)
 - Use Action wrapper for intellijPlatformTesting.runIde.register() to fix type inference
 - Clean up deprecated Community Edition version properties
@joshuataylor
Copy link
Collaborator

(commented with wrong account)
Yeah I don't use RubyMine either, IMHO we should just merge this branch some point, once you're happy with it, given 2025.3 is in RC now.

Let me know once you're happy with the changes, and I'll review and merge.

Again, absolute legend 👍

sh41 added 2 commits December 2, 2025 22:19
- Targeted 2025.3 RC in build.gradle.kts
- Moved Java-dependent extensions to rich-platform-plugin.xml
- Implemented Service pattern for BeforeRunTaskProvider to abstract 'Make' step
- Updated Run Configuration Factories to use safe services
- Created EditorHelper to centralize module selection logic
- Replaced direct ElixirModuleType usage with String ID lookup
- Prevents NoClassDefFoundError in WebStorm when opening Run settings
@sh41 sh41 force-pushed the feature/support-2025-3 branch 2 times, most recently from 207e1a8 to 1b4aec1 Compare December 3, 2025 02:00
sh41 added 9 commits December 3, 2025 02:02
- Add Version Catalog (libs.versions.toml) for dependency management
- Moved EAP version fetching logic to buildSrc/VersionFetcher.kt
- Refactored build.gradle.kts to use declarative plugins and properties
- Fixed test environment race conditions by polling Quoter daemon status
- Cleaned up gradle.properties
Was removed in e71b247, but seems to run fine, so added back in.
java.lang.IllegalStateException: application library named Erlang for Elixir 24 already exists
	at com.intellij.workspaceModel.ide.impl.legacyBridge.library.GlobalLibraryTableDelegate.createLibrary$intellij_platform_projectModel_impl(GlobalLibraryTableDelegate.kt:155)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.library.GlobalLibraryTableBridgeImpl.createLibrary(GlobalLibraryTableBridgeImpl.kt:61)
	at org.elixir_lang.facet.sdks.Configurable$addListeners$listener$1.sdkAdded$lambda$1$0(Configurable.kt:126)
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: Write access is allowed inside write-action only (see Application.runWriteAction()); If you access or modify model on EDT consider wrapping your code in WriteIntentReadAction ; see https://jb.gg/ij-platform-threading for details
Current thread: Thread[KronicDeth#46,AWT-EventQueue-0,6,main] 1321404175 (EventQueue.isDispatchThread()=true)
SystemEventQueueThread: (same)
	at com.intellij.util.concurrency.ThreadingAssertions.createThreadAccessException(ThreadingAssertions.java:257)
	at com.intellij.util.concurrency.ThreadingAssertions.throwThreadAccessException(ThreadingAssertions.java:248)
	at com.intellij.util.concurrency.ThreadingAssertions.assertWriteAccess(ThreadingAssertions.java:233)
	at com.intellij.openapi.projectRoots.impl.ProjectJdkImpl.commitChanges(ProjectJdkImpl.java:181)
	at org.elixir_lang.facet.sdk.Editor.reset(Editor.kt:201)
	at org.elixir_lang.facet.sdk.Editor.<init>(Editor.kt:65)
	at org.elixir_lang.facet.sdks.Configurable.updateSdkPanel$lambda$0$0(Configurable.kt:197)
	at org.elixir_lang.facet.sdks.Configurable.updateSdkPanel$lambda$0$1(Configurable.kt:197)
- Refactor `ModuleStubElementTypes` to an interface with top-level Kotlin classes to satisfy `StubElementTypeHolderEP` requirements.
- Update `ModuleStubElementType` to use the correct `BEAM` Language instance.
- Align External IDs with field names (UPPER_CASE) to enable the `externalIdPrefix` optimization.
- Increment `STUB_VERSION` to force re-indexing of incompatible data.
@sh41 sh41 force-pushed the feature/support-2025-3 branch from 1b4aec1 to e4af4c6 Compare December 3, 2025 02:02
@sh41
Copy link
Contributor Author

sh41 commented Dec 3, 2025

I've put some work in to making sure that the plugin at least loads on the 2025.3 RC version of RubyMine and it passes the verifyPlugin task on the RC versions IDEA/RubyMine/PyCharm & Webstorm.

I'm not going to have any time to look at this for at least a couple of weeks, so if it's good enough merging is probably the best thing to do. The latest build is available in the first comment.

@CrystalJewell if you have time to test and provide feedback that would be great.

@joshuataylor, I think this PR is big enough as it is, so I'm not going add anything else unless there are still critical regressions to resolve. It's currently targeting your 2025.2 branch as that is where I started from, but if you'd prefer to merge to it's own branch or main that's cool too.

@CrystalJewell
Copy link

CrystalJewell commented Dec 3, 2025

@CrystalJewell if you have time to test and provide feedback that would be great.

@sh41 Its been a busy week for me already so the last version of the plugin has def been put to the test with nothing that has errored since the warn_if_outdated issue. I gotchu on the new one 🫶 just downloaded the file and got it installed, will report back with any issues as I use it this week. Thank you so much for all your work on this!


Update:

Just got a new one around the credo check.ex module

From: deps/credo/lib/credo/check.ex:0-890

Element Class Name

org.elixir_lang.psi.impl.ElixirStabBodyImpl
com.intellij.openapi.diagnostic.RuntimeExceptionWithAttachments: java.lang.Throwable: Don't know how to walk unquoted variable parent
	at com.intellij.idea.IdeaLogger.error(IdeaLogger.java:162)
	at org.elixir_lang.errorreport.Logger.error(Logger.kt:51)
(Omitted for space)
Caused by: java.lang.Throwable: Don't know how to walk unquoted variable parent
	at org.elixir_lang.errorreport.Logger.error(Logger.kt:45)
	... 119 more

I also got this however, this is throwing in the IDEA core so not sure if there is anything to do here but it really really doesn't like that I have the .heex templates also marked as HtmlCompatible for the template data language but it's the only way to get mostly correct syntax highlighting

java.lang.Throwable: org.elixir_lang.eex.file.ViewProvider{vFile=file:///path/to/this/file/all_users.html.heex, vFileId=79371, content=VirtualFileContent{size=12070}, eventSystemEnabled=true} for file Embedded Elixir File returned null root for language Language: HtmlCompatible despite listing it as one of its own languages: [Language: HtmlCompatible, Language: Elixir, Language: EEx]
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:375)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants