carymrobbins / intellij-haskforce

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

Plugin error in WebStorm #445

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hello, tried to add HaskForce plugin to WebStorm, as it's the only Haskell plugin available for this IDE. Got an error after restart: image

Are other than IDEA IDEs actually supported?

Not sure what additional information you might need to identify the issue. Here's my configuration: WebStorm 2020.3.2 Build #WS-203.7148.54, built on January 25, 2021 Runtime version: 11.0.9.1+11-b1145.77 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Linux 5.8.0-44-generic GC: ParNew, ConcurrentMarkSweep Memory: 8162M Cores: 4 Current Desktop: KDE OS: Kubuntu 20.10

ghost commented 3 years ago

Cloned the repository and tried to build the plugin myself with this small change to plugin.xml:

Added this line

 <depends>com.intellij.modules.lang</depends>

above this one

  <depends>org.jetbrains.plugins.yaml</depends>

Seems it kind of works. But yes, I am infinitely far from understanding the IDEA plugin system and just started learning Haskell :sweat_smile: Just wanted to share my findings. Anyways, planning to continue to use the build from source for now. Feel free to close this issue if there are no plans to support other IDEs. Thanks.

carymrobbins commented 3 years ago

I know it's a simple change, but would you mind submitting a PR? Would be nice to have multi IDE support and you deserve credit.

ghost commented 3 years ago

I don't mind at all and would love to submit the PR. The problem is, I am not sure this change is actually enough, I have never written any plugins for Intellij platform. Any tips on how to test it more thoroughly? Currently I was able to open *.hs files, syntax highlight works, autocomplete and goto declaration works as well (at least in a single file). I don't have much expertise in Haskell. Maybe there is some test project which I should try to open/run using this plugin before submitting PR?

carymrobbins commented 3 years ago

If you submit the PR, CI will run on it. Also, I can try to test it out myself. Also, I can cut a pre release for others to test as well. If we don't get bad reports, I can merge it.

ghost commented 3 years ago

Spent some more time on the plugin. Seems like the line from above is not enough actually. IDE crashes on any Stack project (don't know how to get logs without exposing my system data, sorry can't attach them). And there is no project wizard, this exception appears:

Cannot process toolwindow Haskell Tools Console

com.intellij.diagnostic.PluginException: While loading class com.haskforce.HaskellModuleBuilder: com/intellij/ide/util/projectWizard/SourcePathsBuilder [Plugin: com.haskforce] [Plugin: com.haskforce]
    at com.intellij.serviceContainer.ComponentManagerImpl.instantiateExtensionWithPicoContainerOnlyIfNeeded(ComponentManagerImpl.kt:750)
    at com.intellij.serviceContainer.LazyExtensionInstance.createInstance(LazyExtensionInstance.java:43)
    at com.intellij.serviceContainer.LazyExtensionInstance.getInstance(LazyExtensionInstance.java:36)
    at com.intellij.openapi.module.ModuleTypeEP.getModuleType(ModuleTypeEP.java:31)
    at com.intellij.openapi.module.impl.ModuleTypeManagerImpl.findByID(ModuleTypeManagerImpl.java:80)
    at com.haskforce.HaskellModuleType$.getInstance(HaskellModuleType.scala:12)
    at com.haskforce.ui.tools.HaskellToolsConsoleWindowFactory.value(HaskellToolsConsole.scala:212)
    at com.haskforce.ui.tools.HaskellToolsConsoleWindowFactory.value(HaskellToolsConsole.scala:192)
    ...

Quick googling showed that this plugin actually depends on com.intellij.java functionality, which is available only in IntelliJ IDEA and Android Studio (link) if I haven't got that wrong.

So I decided to just use the plugin with Intellij IDEA CE. Thanks for your time and great plugin!