KronicDeth / intellij-elixir

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

Add comptibility for 2024.1 IDEs #3569

Open ashleysommer opened 3 months ago

ashleysommer commented 3 months ago

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.

gaggle commented 3 months ago

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?

ashleysommer commented 3 months ago

@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 commented 3 months ago

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

allenwyma commented 3 months ago

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.

ashleysommer commented 3 months ago

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.

gaggle commented 3 months ago

It LGTM too!

colmben commented 2 months ago

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

noizu commented 2 months ago

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

jameskbride commented 2 months ago

@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.

ashleysommer commented 2 months ago

@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 commented 2 months ago

@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.

szymon-jez commented 2 months ago

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.

ashleysommer commented 2 months ago

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.

szymon-jez commented 2 months ago

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.

vkuprin commented 2 months ago

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

jmSfernandes commented 1 month ago

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 🤔

gaggle commented 1 month ago

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.

allenwyma commented 1 month ago

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.

noizu commented 1 month ago

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 commented 1 month ago

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

iampeter commented 1 month ago

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

iampeter commented 1 month ago

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

Askath commented 1 month ago

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

iampeter commented 1 month ago

I also encourage everyone interested to visit

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

nulian commented 3 weeks ago

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

drl123 commented 3 weeks ago

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.

alexnogueirasilva commented 1 week ago

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

joshuataylor commented 1 week ago

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: @.***>

billylaing commented 1 week ago

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.

alexnogueirasilva commented 1 week ago

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.

billylaing commented 1 week ago

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.

You could try building from source!

https://zed.dev/docs/development/linux

joze144 commented 1 week ago

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.

I too migrated to Zed for now. It's fast and just works. Can also keep pretty much the same key bindings. But I do miss a lot of features that Jetbrains IDEs offer

Bishwas-py commented 1 week ago

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.

I too migrated to Zed for now. It's fast and just works. Can also keep pretty much the same key bindings. But I do miss a lot of features that Jetbrains IDEs offer

Thanks for suggestion boss. Will be trying zed...