rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.31k stars 96 forks source link

No documentation available as Hoogle (database) isn't available #659

Closed mhusmann closed 2 years ago

mhusmann commented 3 years ago

Installed intellij-haskell unfortunately getting above error message and I don't find a way to get hoogle running hoogle runs perfectly in a shell window.

Running idea 2021.1.1 Community Edition on Arch Linux

alleksandrgall commented 3 years ago

Did you try building your project with haddock? stack build --haddock

mhusmann commented 3 years ago

I just run stack build --haddock Now it works.

Thank you for the advice Michael

Am Do., 3. Juni 2021 um 15:09 Uhr schrieb alleksandrgall < @.***>:

Did you try building your project with haddock? stack build --haddock

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rikvdkleij/intellij-haskell/issues/659#issuecomment-853856449, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAWNTNPFELMZVIT5UV4O4HDTQ55KBANCNFSM46ACMMTQ .

marcozucchi commented 2 years ago

I am citing this issue, since I keep having this problem with IntelliJ's Haskell plugin

Problem

Hoogle Documentation is not available for me out-of-the-box

Explanation of the problem

Activating the Haskell logs and having a look at them, shows that the plugin executes a command similar to the following

/home/{username}/.cache/intellij-haskell/lts-18/bin/hoogle generate --local=/tmp/{project name}/.stack-work/install/x86_64-linux-tinfo6/c133d91acae5e16553a0fed130e42febc6425489b117552f09e66cb9be01b797/8.10.7/doc --local=/home/{username}/.stack/snapshots/x86_64-linux-tinfo6/c133d91acae5e16553a0fed130e42febc6425489b117552f09e66cb9be01b797/8.10.7/doc --database=/home/{username}/.cache/intellij-haskell/{projectName}/hoogle

The above script executes and tries to build the Hoogle database but at some point the build fails with the following message:

[70/155] hoogle...
hoogle: hseToItem failed, Add mode = embed support

Nevertheless, the plugin doesn't warn the user, that the build has failed (in fact, according to IntelliJ the plugin hasn't failed, you can only see the failed build status if you go to the Build tab). However, quick-documentation is unavailable as shown in the following screenshot:

image

Haskell Event Log shows that it can't access the Hoogle database since it's been trucated.

Haskell Event Log

224de1867a06ea1059bc17a3165e0d6a

Temporal fix

I tried to fix this problem and I found out that when the database is manually generated where the plugin expects it, it works fine. To achieve this, I removed both --local parameters from the hoogle command executed by the plugin:

/home/{USER}/.cache/intellij-haskell/lts-18/bin/hoogle generate --database=/home/{USER}/.cache/intellij-haskell/ProgramaTutorial/hoogle

The "hoogle generate" command will pull the whole Hoogle database from the Internet and Quick-Documentation (Ctrl+Q) will work as expected:

image

amryounis commented 1 year ago

hi, i am running on windows. stack build --haddock did not work

image

marcozucchi commented 1 year ago

@amryounis try following the temporal fix I describe above your reply in CMD or Powershell

amryounis commented 1 year ago

thanks @marcozucchi . May I ask you to show the syntax for Windows?