lipiridi / spotless-applier

An IntelliJ plugin that allows running the spotless Gradle and Maven tasks from within the IDE, either on the current file selected in the editor or for the whole project.
MIT License
19 stars 2 forks source link

Plugin hangs indefinitely on IDEA 2024.2 #23

Closed dicedpixels closed 1 month ago

dicedpixels commented 1 month ago

Ever since I updated to 2024.2, the Spotless Applier plugin hangs indefinitely. I cannot even cancel the popup dialog.

IntelliJ IDEA 2024.2 (Community Edition)
Build #IC-242.20224.300, built on August 7, 2024
Runtime version: 21.0.3+13-b509.4 amd64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.awt.windows.WToolkit
Windows 11.0
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2048M
Cores: 20
Registry:
  ide.experimental.ui=true
Non-Bundled Plugins:
  com.github.lipiridi.spotless-applier (1.1.1)
Kotlin: 242.20224.300-IJ

I tried on a basic Java project with the following Spotless configuration.

plugins {
    id 'java'
    id "com.diffplug.spotless" version "7+"
}

group = 'org.example'
version = '1.0-SNAPSHOT'

repositories {
    mavenCentral()
}

dependencies {
    testImplementation platform('org.junit:junit-bom:5.10.0')
    testImplementation 'org.junit.jupiter:junit-jupiter'
}

test {
    useJUnitPlatform()
}

spotless {
    java {
        toggleOffOn()
        palantirJavaFormat()
        removeUnusedImports()
        importOrder("java", "javax", "", "net.minecraft", "com.mojang", "net.fabricmc", "xyz.dicedpixels")
    }

    json {
        target "src/**/*.json"
        gson()
    }
}

Gradle info:

------------------------------------------------------------
Gradle 8.9
------------------------------------------------------------

Build time:    2024-07-11 14:37:41 UTC
Revision:      d536ef36a19186ccc596d8817123e5445f30fef8

Kotlin:        1.9.23
Groovy:        3.0.21
Ant:           Apache Ant(TM) version 1.10.13 compiled on January 4 2023
Launcher JVM:  21.0.4 (Azul Systems, Inc. 21.0.4+7-LTS)
Daemon JVM:    C:\Users\dicedpixels\scoop\apps\zulufx21-jdk\current (no JDK specified, using current Java home)
OS:            Windows 11 10.0 amd64

This happens with both the plugin from the marketplace and the one from GitHub releases. Oddly enough, https://github.com/ragurney/spotless-intellij-gradle doesn't work either.

I'm not sure if this is a Plugin/Spotless/Gradle issue or something with my system. So, please let me know if you need more information.

lipiridi commented 1 month ago

Hello! I got the same issue with 2024.2. I assume the issue with modal gradle tasks is present again https://youtrack.jetbrains.com/issue/IDEA-327879/Executing-Gradle-task-in-ProgressExecutionMode.MODALSYNC-hangs-the-IDE I changed the plugin compatibility back to 2024.1 for now. Need some time to figure out what happened..

dicedpixels commented 1 month ago

Great! I won't downgrade IDEA since I can manage with running the Gradle task, so if you need any testing done/need info, let me know.

lipiridi commented 1 month ago

So, I was trying to find a workaround, but all my attempts failed. To be honest, I don't know what to do. If I make the gradle task back asynchronous, it'll break the pre-commit hook, which is already being used by developers. On the other hand, I also cannot leave the modality for gradle because it makes the plugin incompatible with versions 2024.2.*

Bug on YouTrack has been open for over a year, and there is still no solution.

dicedpixels commented 1 month ago

That sucks, hopefully they will look into this soon. On the other hand, the latest update is working as expected. You can close this issue. Thanks for looking into this.

lipiridi commented 1 month ago

Yeah, I made the Gradle task asynchronous again. I also added a warning about the pre-commit check in the plugin's description