intellij-elixir icon indicating copy to clipboard operation
intellij-elixir copied to clipboard

Add comptibility for 2024.1 IDEs

Open ashleysommer opened this issue 10 months ago • 33 comments

Alternative to #3567

There were a couple more changes required other than simply bumping the IntelliJ IDE version number.

When I try to build this plugin against 2024.1 IDEs and run the Test suite, I get the error NoSuchFieldError: FILE_HASHING_STRATEGY. See relevant underlying IDE code change

While in the process of fixing that issue, I upgraded the org.jetbrains.intellij gradle plugin to v1.17.3 as recommended in the IntelliJ docs. Unfortunately that brings in some other gradle dependencies that require gradle v7.6.4 minimum see here for details.

So this PR bumps IDE version to "2024.1", adds that version to the test suite PluginVerifier matrix, fixes the NoSuchFieldError in jps-build tests, bumps org.jetbrains.intellij gradle plugin to v1.17.3, and bumps gradlewrapper version to v7.6.4.

ashleysommer avatar Apr 07 '24 11:04 ashleysommer

Thanks for doing this.

Would it be helpful if we try out the plugin? If you attach the plugin I'd be happy to install it and give it a go, so we can help boost the confidence that the plugin works as advertised?

gaggle avatar Apr 08 '24 14:04 gaggle

@gaggle Yes, I had the same thought. I'll finish my current round of testing, and later today I'll attach the .zip for users to try.

ashleysommer avatar Apr 08 '24 19:04 ashleysommer

Here is the build I'm currently personally using. Note, it also includes changes from https://github.com/KronicDeth/intellij-elixir/pull/3562 to fix launching IEx run configurations on Elixir 1.15+, and includes https://github.com/KronicDeth/intellij-elixir/pull/3563 to fix debugging on Erlang/OTP 26.

intellij-elixir-17.0.0-pre+20240408035552.zip

ashleysommer avatar Apr 08 '24 21:04 ashleysommer

hi @ashleysommer having an issue with the plugin where some coloring seems off and when i tried adding a moduledoc, the """ didn't get autocompleted.

allenwyma avatar Apr 09 '24 04:04 allenwyma

hi @ashleysommer having an issue with the plugin where some coloring seems off and when i tried adding a moduledoc, the """ didn't get autocompleted.

Yeah, there's probably a bunch of things still not working correctly.

I'm actually very new to Elixir, I'm still learning what the features are and I was only using this plugin for 1 week before Jetbrains 2024.1 IDEs were released, and I'm still learning what this plugin is even capable of or what it should do correctly.

ashleysommer avatar Apr 09 '24 05:04 ashleysommer

It LGTM too!

gaggle avatar Apr 09 '24 07:04 gaggle

Thanks for looking at this! Note that while it does allow the plugin to load I am seeing various UI issues with intellij-elixir-17.0.0-pre+20240408035552.zip. Most annoyingly I have lost the matching brackets highlight - you don't realise how much you use that until it is gone! Also comments are showing as black, the same as normal code, which is getting very confusing.

Screenshot 2024-04-22 at 11 38 14

Is anyone seeing either of those issues?

Edit - also we seem to have lost the ability to run tests via the IDE

colmben avatar Apr 22 '24 10:04 colmben

This worked fine for me with just updating until-version. I also played with changing org.jetbrains. I did need to purge m2 deps however. https://github.com/KronicDeth/intellij-elixir/pull/3579

noizu avatar Apr 25 '24 11:04 noizu

@ashleysommer @KronicDeth I have a commit in my fork that I believe fixes the failing FindUsagesTest tests.

I could use some feedback on this; I think the difference is just formatting for the usage output, in which case this commit should be good.

I'm also still seeing the following test failures:

Configuration file for j.u.l.LogManager does not exist: /Users/jameskbride/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2024.1/181fa36f74690e64a81a8e06ceda9480d2a6c626/ideaIC-2024.1/test-log.properties

ERLANG_SDK_HOME is not set
junit.framework.AssertionFailedError: ERLANG_SDK_HOME is not set
	at junit.framework.Assert.fail(Assert.java:57)
	at junit.framework.Assert.assertTrue(Assert.java:22)
	at junit.framework.Assert.assertNotNull(Assert.java:256)
	at junit.framework.TestCase.assertNotNull(TestCase.java:399)
	at org.elixir_lang.jps.BuilderTest.erlangSdkHome(BuilderTest.java:49)
	at org.elixir_lang.jps.BuilderTest.addErlangSdk(BuilderTest.java:139)
	at org.elixir_lang.jps.BuilderTest.setUp(BuilderTest.java:172)
	at com.intellij.testFramework.UsefulTestCase.invokeSetUp(UsefulTestCase.java:430)
	at com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCase.java:422)
	at com.intellij.testFramework.UsefulTestCase.lambda$runBare$12(UsefulTestCase.java:491)
	at com.intellij.testFramework.EdtTestUtil.lambda$runInEdtAndWait$3(EdtTestUtil.java:80)
	at com.intellij.openapi.application.impl.RwLockHolder.runWriteIntentReadAction(RwLockHolder.kt:70)
	at com.intellij.testFramework.EdtTestUtil.lambda$runInEdtAndWait$4(EdtTestUtil.java:79)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:308)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:326)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)


ERLANG_SDK_HOME is not set
junit.framework.AssertionFailedError: ERLANG_SDK_HOME is not set
	at junit.framework.Assert.fail(Assert.java:57)
	at junit.framework.Assert.assertTrue(Assert.java:22)
	at junit.framework.Assert.assertNotNull(Assert.java:256)
	at junit.framework.TestCase.assertNotNull(TestCase.java:399)
	at org.elixir_lang.jps.BuilderTest.erlangSdkHome(BuilderTest.java:49)
	at org.elixir_lang.jps.BuilderTest.addErlangSdk(BuilderTest.java:139)
	at org.elixir_lang.jps.BuilderTest.setUp(BuilderTest.java:172)
	at com.intellij.testFramework.UsefulTestCase.invokeSetUp(UsefulTestCase.java:430)
	at com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCase.java:422)
	at com.intellij.testFramework.UsefulTestCase.lambda$runBare$12(UsefulTestCase.java:491)
	at com.intellij.testFramework.EdtTestUtil.lambda$runInEdtAndWait$3(EdtTestUtil.java:80)
	at com.intellij.openapi.application.impl.RwLockHolder.runWriteIntentReadAction(RwLockHolder.kt:70)
	at com.intellij.testFramework.EdtTestUtil.lambda$runInEdtAndWait$4(EdtTestUtil.java:79)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:308)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:326)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

These pass for me locally on the main branch and fail on @ashleysommer's branch, so I don't believe it is simply my environment setup.

jameskbride avatar Apr 28 '24 11:04 jameskbride

@ashleysommer @KronicDeth I have a commit in my fork that I believe fixes the failing FindUsagesTest tests.

I could use some feedback on this; I think the difference is just formatting for the usage output, in which case this commit should be good.

Yes, that is the main remaining test failure that I've been working to fix the last couple of weeks. Unfortunately simply changing the formatting to match the new version is not good enough because that breaks compatibility with pre-2024.1 IDEs. Its very hard to nail down in the IntelliJ IDE source code exactly where this behaviour changed and when. I actually think the whitespace formatting difference was an unintentional change by Jetbrains, introduced by fixing or changing something different or unrelated, and it may be fixed/reverted in the future if it was unintentional.

I've been working on a way that can assert success of the tests regardless of the whitespace formatting in the returned usages serialization.

I'm also still seeing the following test failures: ... These pass for me locally on the main branch and fail on @ashleysommer's branch, so I don't believe it is simply my environment setup.

I don't see any of those ERLANG_SDK_HOME errors in my local tests in this branch.

ashleysommer avatar Apr 28 '24 23:04 ashleysommer

@colmben

Most annoyingly I have lost the matching brackets highlight - you don't realise how much you use that until it is gone!

I think I've narrowed down where this issue is coming from. I've found one difference in the parser in 2024.1 regarding brackets that must be causing this.

ashleysommer avatar Apr 28 '24 23:04 ashleysommer

Unfortunately simply changing the formatting to match the new version is not good enough because that breaks compatibility with pre-2024.1 IDEs

Is this needed? From what I remember recent updates of this plugin required an upgrade of the IDE.

szymon-jez avatar Apr 29 '24 09:04 szymon-jez

From what I remember recent updates of this plugin required an upgrade of the IDE.

I wouldn't know, I only started using this plugin in March 2024, after IntelliJ 2023.3 was released. Looking back through the upgrade commits, it seems like sometimes the min version is bumped, sometimes it isn't.

Is this needed?

Well, no its not strictly needed, but all other changes in this branch have kept backwards compatibility with 2023.3 IDE, normally when I contribute to an open source project the expectation is to avoid breaking changes at all costs wherever possible.

ashleysommer avatar Apr 29 '24 09:04 ashleysommer

Here is the build I'm currently personally using. Note, it also includes changes from #3562 to fix launching IEx run configurations on Elixir 1.15+, and includes #3563 to fix debugging on Erlang/OTP 26.

intellij-elixir-17.0.0-pre+20240408035552.zip

I have tested your build and it was not working with the newest IDEA, but it does work with the previous one making IEx and debugging work in the IDE with Elixir 1.16 and Erlang OTP 26. This is very helpful - thanks! Looking forward to seeing those in the next release.

szymon-jez avatar Apr 30 '24 13:04 szymon-jez

Here is the build I'm currently personally using. Note, it also includes changes from #3562 to fix launching IEx run configurations on Elixir 1.15+, and includes #3563 to fix debugging on Erlang/OTP 26. intellij-elixir-17.0.0-pre+20240408035552.zip

I have tested your build and it was not working with the newest IDEA, but it does work with the previous one making IEx and debugging work in the IDE with Elixir 1.16 and Erlang OTP 26. This is very helpful - thanks! Looking forward to seeing those in the next release.

That binary you shared installs pretty well on my IntelliJ IDEA 2024.1.1 (Ultimate Edition) Build #IU-241.15989.150, built on April 29, 2024

vkuprin avatar May 09 '24 00:05 vkuprin

Hey guys, is there any ETA for this? I really love this plugin... but right now, this is the only thing blocking me from updating IntelliJ IDEA Can anyone confirm that the zip file works?? I have seen mixed responses 🤔

jmSfernandes avatar May 15 '24 08:05 jmSfernandes

Hey guys, is there any ETA for this? I really love this plugin... but right now, this is the only thing blocking me from updating IntelliJ IDEA Can anyone confirm that the zip file works?? I have seen mixed responses 🤔

It certainly works fine for me, across both an Intel Mac and an ARM Mac. I have IntelliJ Ultimate 2024.1.1 installed, with 17.0.0-pre+20240408035552 of this plugin added via the zip of this thread.

gaggle avatar May 15 '24 09:05 gaggle

Hey guys, is there any ETA for this? I really love this plugin... but right now, this is the only thing blocking me from updating IntelliJ IDEA Can anyone confirm that the zip file works?? I have seen mixed responses 🤔

well, it "works", but found that like the auto complete of say parentheses etc are gone and the colors come and go if the syntax is "broken" which happens as you type character by character.

allenwyma avatar May 15 '24 09:05 allenwyma

per formatting issues. branch by abstraction. Just clone the formatting logic, add a toggle to switch between the new/old logic. Make it work for just the new ide version then start comparing the change diffs to make the new iteration backwards compatible.

noizu avatar May 16 '24 04:05 noizu

If you can hack that to work properly I can help with the switching logic.

noizu avatar May 16 '24 04:05 noizu

Hi, is there an estimated timeline for this? Would be great to have it.

iampeter avatar May 18 '24 10:05 iampeter

@KronicDeth could we please have some clarity on this PR?

iampeter avatar May 20 '24 23:05 iampeter

Could I just build this branch and have it work on Intellij, Or is there something else I have to pay attention to?

Askath avatar May 30 '24 14:05 Askath

I also encourage everyone interested to visit

  • https://youtrack.jetbrains.com/issue/IDEABKL-7050/Elixir-Plugin or
  • https://youtrack.jetbrains.com/issue/FL-17030/Elixir-support-with-LSP

and try to poke Jetbrains. Without a visible community, they will never support Elixir.

iampeter avatar May 31 '24 09:05 iampeter

Found the fix for syntax breaking was a deprecated key in plugin.xml

- <lang.syntaxHighlighterFactory key="Elixir"
+ <lang.syntaxHighlighterFactory language="Elixir"

Fixed version below

intellij-elixir-17.0.0-pre+20240611160330.zip

nulian avatar Jun 11 '24 16:06 nulian

FYI - I installed the above pre+ zip with RubyMine 2024.1 and when I install a newer version of Elixir and Erlang, I can add them individually, but it won't let me set the erlang version in the elixir SDK, so the SDK that gets set is running newer elixir (the version I picked from ASDF) and the old version of erlang (i.e. 26.1 instead of 27.0). It used to allow setting the erlang version when setting the elixir SDK version.

This is the 2023 version image

I don't have an image for 2024, but the entire right-hand panel is blank in 2024.

drl123 avatar Jun 12 '24 17:06 drl123

Is this plugin dead? I can't install it on the latest JetBrains IDE. Is there any alternative to it?

alexnogueirasilva avatar Jun 25 '24 01:06 alexnogueirasilva

I use it all the time, i'm on 2023.3.7. No real rush to upgrade, there seems to be quite a few BC lately with the last few JB releases.

On Tue, 25 Jun 2024 at 09:40, Alex Nogueira @.***> wrote:

Is this plugin dead? I can't install it on the latest JetBrains IDE. Is there any alternative to it?

— Reply to this email directly, view it on GitHub https://github.com/KronicDeth/intellij-elixir/pull/3569#issuecomment-2187760719, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABW627FPIYYIAUQGPVOVRLZJDDAZAVCNFSM6AAAAABF3IHO62VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBXG43DANZRHE . You are receiving this because you commented.Message ID: @.***>

joshuataylor avatar Jun 25 '24 02:06 joshuataylor

I've been using Zed on MacOS for elixir. The inline Heex syntax highlighting has changed my life.

I have nothing but love for all the work @KronicDeth put into this plugin but I can understand why maintaining a plugin for a profitable company is not that rewarding. Especially with breaking changes from upstream.

billylaing avatar Jun 25 '24 21:06 billylaing

I didn't want to go back to VSCode, nor leave Linux, but I see that the main tools come out first for Mac. Maybe I'll change my operating system since I'm diving into Elixir and don't want to spend time adjusting Neovim.

alexnogueirasilva avatar Jun 25 '24 22:06 alexnogueirasilva