carymrobbins / intellij-haskforce

Haskell plugin for IntelliJ IDEA
http://carymrobbins.github.io/intellij-haskforce/
Apache License 2.0
485 stars 41 forks source link

plugin 'com.haskforce' failed to initialize and will be disabled #452

Open proximacb opened 2 years ago

proximacb commented 2 years ago

IntelliJ IDEA 2021.2.1 (Ultimate Edition) Build #IU-212.5080.55, built on August 24, 2021 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 10.15.7

plugin 'com.haskforce' failed to initialize and will be disabled. Please restart IntelliJ IDEA.

java.lang.ClassNotFoundException: com.haskforce.codeInsight.HaskellCompletionCacheLoader

at com.intellij.util.lang.UrlClassLoader.findClass(UrlClassLoader.java:227)
at com.intellij.util.lang.PathClassLoader.findClass(PathClassLoader.java:65)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at com.intellij.serviceContainer.ComponentManagerImpl.registerComponent(ComponentManagerImpl.kt:441)
at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents(ComponentManagerImpl.kt:380)
at com.intellij.serviceContainer.ComponentManagerImpl.access$registerComponents(ComponentManagerImpl.kt:58)
at com.intellij.serviceContainer.ComponentManagerImpl.registerComponents(ComponentManagerImpl.kt:255)
at com.intellij.openapi.client.ClientAwareComponentManager.registerComponents(ClientAwareComponentManager.kt:63)
at com.intellij.openapi.project.impl.ProjectLoadHelper.registerComponents(projectLoader.kt:25)
at com.intellij.openapi.project.impl.ProjectManagerImpl.initProject(ProjectManagerImpl.java:176)
at com.intellij.openapi.project.impl.ProjectManagerExImpl.prepareProject(ProjectManagerExImpl.kt:270)
at com.intellij.openapi.project.impl.ProjectManagerExImpl.access$prepareProject(ProjectManagerExImpl.kt:57)
at com.intellij.openapi.project.impl.ProjectManagerExImpl$doOpenAsync$1.invoke(ProjectManagerExImpl.kt:119)
at com.intellij.openapi.project.impl.ProjectManagerExImpl$doOpenAsync$1.invoke(ProjectManagerExImpl.kt:57)
at com.intellij.openapi.project.impl.ProjectUiFrameAllocator$run$progressRunner$1.apply(ProjectFrameAllocator.kt:94)
at com.intellij.openapi.project.impl.ProjectUiFrameAllocator$run$progressRunner$1.apply(ProjectFrameAllocator.kt:71)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$3(ProgressRunner.java:243)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:183)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:705)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:647)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:63)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:170)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:243)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
avdv commented 2 years ago

I ran into the same problem. Could be a conflict with the Scala plugin perhaps, since this plugin is using Scala 2.12 and I suppose the Scala plugin is on 2.13 ?!

Clindbergh commented 2 years ago

Me too. Is there a workaround? Does it work with a previous IJ version?

avdv commented 2 years ago

@Clindbergh Try to disable the Scala plugin and restart the IDE. Does it work now?

Clindbergh commented 2 years ago

disable the Scala plugin and restart the IDE. Does it work now?

Unfortunately not.

Clindbergh commented 2 years ago

@avdv Can you tell me what IJ version and which plugins you're using so I can try to copy your environment?

image

avdv commented 2 years ago
IntelliJ IDEA 2021.3 (Community Edition)
Build #IC-213.5744.223, built on November 27, 2021
Runtime version: 11.0.11+0-adhoc..source amd64
VM: OpenJDK 64-Bit Server VM by Oracle Corporation
Linux 5.16.12
GC: G1 Young Generation, G1 Old Generation
Memory: 2048M
Cores: 8
Non-Bundled Plugins:
    google-java-format (1.15.0.0)
    HighlightBracketPair (1.3.2)
    org.intellij.scala (2021.3.20)
    com.google.idea.bazel.ijwb (2022.02.23.0.0-api-version-213)

Kotlin: 213-1.5.10-release-949-IJ5744.223
Current Desktop: sway

While reading through the logs, I noticed that the plugin version I have installed from the marketplace is version 0.3.42, whereas the latest release currently is 0.3.46. Downloading the zip file from the releases page and trying to install the plugin from disk shows an error though: image So, what I did:

  1. unpack the zip file
  2. unpack the META-INF/plugin.xml file from intellij-haskforce-0.3.46.jar
  3. change the line <idea-version since-build="211.6693" until-build="211.*"/> to <idea-version since-build="211.6693" until-build="213.*"/>
  4. update the entry of the jar file: zip -u intellij-haskforce-0.3.46.jar META-INF/plugin.xml
  5. create a zip file from all jars again: zip -r ../haskforce-0.3.46.zip HaskForce/
  6. install the modified zip file

This seems to work :tada: (correction: works better, but there are other errors)

Clindbergh commented 2 years ago

Thanks @avdv! While I was able to install even Release 0.3.45 this way, I wasn't able to setup the haskell SDK of stack. I am trying to select them in the Project Structure > Platform Settings > SDK > Haskell > Haskell SDK home path, but for both of these paths

$ which stack ghci
/c/Users/Me/AppData/Roaming/local/bin/stack
/c/ProgramData/chocolatey/lib/ghc/tools/ghc-8.10.2/bin/ghci

I receive an error message Cannot Detect SDK Version - Probably SDK installed in ... is corrupt. What path have you set there?

It is a project based on stack and I did try to import it as described in the Wiki.

avdv commented 2 years ago

I receive an error message Cannot Detect SDK Version - Probably SDK installed in ... is corrupt. What path have you set there?

For me, it is just /home/claudio -- but I am on NixOS, so that may be different.

Clindbergh commented 1 year ago

For me, it is just /home/claudio -- but I am on NixOS, so that may be different.

@avdv: I switched to NixOS a couple months ago. Do you mind sharing your Haskell environment setup or a simple flake of one of your projects? That would be awesome!

avdv commented 1 year ago

Hi @Clindbergh ,

I am using haskell-language-server with Emacs / VSCodium currently. So I don't have a setup using haskforce at the moment.