xxpxxxxp / intellij-plugin-golangci-lint

GolangCI-Lint integration for IDEA
GNU General Public License v3.0
223 stars 14 forks source link

Class initialization must not depend on services #164

Open bdeb1337 opened 2 months ago

bdeb1337 commented 2 months ago

When starting up IDEA Ultimate, I get the following error immediately:

java.lang.Throwable: com.ypwang.plugin.UtilitiesKt <clinit> requests com.intellij.notification.NotificationGroupManager instance. Class initialization must not depend on services. Consider using instance of the service on-demand instead.
    at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
    at com.intellij.serviceContainer.ComponentManagerImplKt.checkOutsideClassInitializer(ComponentManagerImpl.kt:1588)
    at com.intellij.serviceContainer.ComponentManagerImplKt.getOrCreateInstanceBlocking(ComponentManagerImpl.kt:1557)
    at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:746)
    at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:690)
    at com.intellij.notification.NotificationGroupManager.getInstance(NotificationGroupManager.java:19)
    at com.ypwang.plugin.UtilitiesKt.<clinit>(Utilities.kt:28)
    at com.ypwang.plugin.platform.Platform.runProcess(Platform.kt:155)
    at com.ypwang.plugin.platform.Platform.runProcess$default(Platform.kt:154)
    at com.ypwang.plugin.GoLinterSettingsTracker$runActivity$1.run(GoLinterSettingsTracker.kt:35)
    at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:477)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:133)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:528)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:249)
    at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:96)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$1(CoreProgressManager.java:221)
    at com.intellij.platform.diagnostic.telemetry.helpers.TraceKt.use(trace.kt:49)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:220)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
    at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202)
    at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:96)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:249)
    at com.intellij.openapi.progress.impl.ProgressRunner$ProgressRunnable.run(ProgressRunner.java:501)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:466)
    at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92)
    at com.intellij.util.concurrency.ChildContext$runAsCoroutine$1.invoke(propagation.kt:92)
    at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:97)
    at com.intellij.util.concurrency.ChildContext.runAsCoroutine(propagation.kt:92)
    at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$19(ProgressRunner.java:464)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
    at java.base/java.lang.Thread.run(Thread.java:1583)
ywanbing commented 1 month ago

me too

straiway commented 1 month ago

This is what the author said in the README:

I'm in touch with jetbrains they are willing to take over the plugin development to officially support golangci-lint in IDE. I will no longer adding new features from now on. Cheers! Let's hope jetbrains makes it better.

sergunya commented 4 weeks ago

Hi, everyone!

As you may have already read on the main page of this project, the GoLand team will take care of the plugin and its further development from now on. For convenience and consistency, we have moved all open tickets for this plugin from GitHub to the open bug tracker of the GoLand product (here is a link to the ticket)

We will provide the fix as soon as possible! Feel free to open a new ticket or leave comments on existing ones.