Haskell-ide-engine: Hoogle lookups not working on local db

Created on 8 Dec 2017  Â·  17Comments  Â·  Source: haskell/haskell-ide-engine

As per the README I've tried:

$ hoogle generate
$ stack exec hoogle generate

I've enabled logging but it (unhelpfully) shows the same information as in the popup in VSCode:

2017-12-07 18:35:02.397034 [ThreadId 12] - <--2--{"jsonrpc":"2.0","method":"window/showMessage","params":{"type":2,"message":"No hoogle db found. Check the README for instructions to generate one"}}

Then on trying

$ stack hoogle
$ stack build

I get

2017-12-07 18:49:35.225028 [ThreadId 12] - <--2--{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"Using hoogle db at: /Users/berserk/Source/dhall-haskell/.stack-work/hoogle/x86_64-osx/lts-9.6/8.0.2/database.hoo"}}

which makes sense. It's using the local db. However on opening https://github.com/dhall-lang/dhall-haskell/blob/master/src/Dhall.hs and trying to get the type for Control.Applicative doesn't work.

hoogle --version returns 5.0.14. Is it possible that version isn't looked for? I've installed 5.0.13 as per #285 and it finds the database. However as with the local database it still doesn't find type definitions for Control.Applicative. Doing hoogle Control.Applicative on the cmdline works fine.

bug

Most helpful comment

I've got hoogle working with async on my branch now!

https://github.com/wz1000/haskell-ide-engine

It will be merged into this repo in a couple of days.

All 17 comments

Also hovering on atomically on src/Haskell/Ide/Engine doesn't return documentation like in the gif in the README.

@alanz changed the hover request to immediately respond even if a recompile
is in progress. However this meant disabling documentation lookup due to
some technical issues. I am working on getting this re-enabled ASAP.

On 08-Dec-2017 05:12, "Alejandro Hernandez" notifications@github.com
wrote:

As per the README I've tried all possibilities:

$ hoogle generate
$ stack exec hoogle generate
$ stack hoogle
$ stack build

Then on opening https://github.com/dhall-lang/
dhall-haskell/blob/master/src/Dhall.hs and trying to get the type for
Control.Applicative doesn't work. I've enabled logging but it
(unhelpfully) shows the same information as in the popup in VSCode:

2017-12-07 18:35:02.397034 [ThreadId 12] - <--2--{"jsonrpc":"2.0","method":"window/showMessage","params":{"type":2,"message":"No hoogle db found. Check the README for instructions to generate one"}}

hoogle --version returns 5.0.14. Is it possible that version isn't looked
for? From #285 https://github.com/haskell/haskell-ide-engine/issues/285
I can see that it works with 5.0.13
Any ideas?

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/haskell/haskell-ide-engine/issues/393, or mute the
thread
https://github.com/notifications/unsubscribe-auth/AElu0laqYBu3bmS80-rywUXTAPHO_T02ks5s-Hf6gaJpZM4Q6Xfo
.

Speed, accuracy. Choose one :)

Speed, accuracy. Choose one :)

  1. Make it work
  2. Make it beautiful
  3. Make it fast

;)

Actually the docs are always accurate, it is just where they come from, whether a bigger or smaller db is consulted.

I've got hoogle working with async on my branch now!

https://github.com/wz1000/haskell-ide-engine

It will be merged into this repo in a couple of days.

@wz1000 Does it have a way of getting the fully qualified name of the identifier? It'd be great if I could go straight into hoogle --info instead of getting a list of candidates.

@stellarhoof it does tell you the package and module the symbol comes from.

@stellarhoof Does this problem still happen after the fixes?

Worse, now it's just stuck on Loading.... I cannot get any type/docs information whatsoever. Not even for my own project (using VSCode btw). Checking the logs I see hie: /Users/berserk/.stack/snapshots/x86_64-osx/lts-9.17/8.0.2/pkgdb/package.cache: GHC.PackageDb.readPackageDb: inappropriate type (not enough bytes).
Is it relevant that I compiled hie with GHC 8.2.2 and it's looking at the pkgdb for 8.0.2? I don't know much about these issues.

I compile hie with GHC 8.0.2 and there is no problem in Dhall (or other projects I work with):

dhall

Perhaps the fact that you use hie compiled with a different version of GHC causes the problem.

It would be nice if we could have different executables, like hie-8.0 and hie-8.2 and the plugin could "automatically" choose which one to use... But I guess it is another story.

Is it relevant that I compiled hie with GHC 8.2.2 and it's looking at the pkgdb for 8.0.2? I don't know much about these issues.

Yes, hie requires GHC version to be the same but doesn't warn about mismatches, see #414. So rebuild hie with --stack-yaml=stack-8.0.2 and retry

It would be nice if we could have different executables, like hie-8.0 and hie-8.2 and the plugin could "automatically" choose which one to use... But I guess it is another story.

Yes, the issue is already open. See the discussion at https://github.com/alanz/vscode-hie-server/issues/31

I built my project with 8.2.2 and I got mixed results:
If using a global hoogle db:

2017-12-19 13:37:35.082145 [ThreadId 5] - <--2--{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"Using hoogle db at: /Users/berserk/.hoogle/default-haskell-5.0.14.hoo"}}

I can get info for all the symbols in scope but not for modules such as Control.Monad, whereas hoogle --info Control.Monad works fine.

However if using a local hoogle db:

2017-12-19 13:52:43.977174 [ThreadId 5] - <--2--{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":4,"message":"Using hoogle db at: /Users/berserk/Source/scheme-parser/.stack-work/hoogle/x86_64-osx/nightly-2017-12-15/8.2.2/database.hoo"}}

I still get Loading...

@AlexeyRaga Your screencast doesn't attempt to hover over module names. You only hover over symbols.

@stellarhoof I think this issue should focus on "broken" local db (we still need @alanz and/or @wz1000 to confirm) and hovering over module names should be a separate feature request

@stellarhoof great!

@wz1000 to your knowledge, is this still a problem?

I don't think so.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

awave1 picture awave1  Â·  4Comments

flip111 picture flip111  Â·  4Comments

JorisBlanken picture JorisBlanken  Â·  4Comments

xgrommx picture xgrommx  Â·  4Comments

alanz picture alanz  Â·  4Comments