Haskell-language-server: Wrong `could not execute: tasty-discover`

Created on 25 Jun 2020  路  4Comments  路  Source: haskell/haskell-language-server

When using a preprocessor (tasty-discover) for our tests, we get a wrong error from HLS, while compilation is fine.

See minimal repo to reproduce the issue: https://github.com/Sir4ur0n/hls-bug-preprocessor

  • stack test works fine
  • haskell-language-server returns an error:
File:     /home/sir4ur0n/sandbox/hls-bug-preprocessor/test/Spec.hs
Hidden:   no
Range:    1:0-2:0
Source:   compiler
Severity: DsError
Message:  haskell-language-server: could not execute: tasty-discover
Files that failed:
[INFO] finish: User TypeCheck (took 0.57s) * /home/sir4ur0n/sandbox/hls-bug-preprocessor/test/Spec.hs

While we might tell hie.yaml to ignore (cradle none) the Spec.hs file in particular, I don't see a reason why this even fails. HLS should support such files.

Thank you!

can-workaround hie-bios blocked upstream bug

Most helpful comment

I just tested by adding haskell.packages.${ghcCompiler}.tasty-discover in my shell.nix and indeed, HLS no longer complains about Spec.hs, thank you @fendor , I appreciate the help and quick response time!

Let's use this issue to document this limitation, as well as link to upstream issue in hie-bios.

I'll try to propose a PR some time this week

All 4 comments

Hi, thank you for the bug report!
The same issue exists in hie: https://github.com/haskell/haskell-ide-engine/issues/1500
And the upstream issue is in hie-bios: https://github.com/mpickering/hie-bios/issues/125

Work-around: make tasty-discover available in your path.

I just tested by adding haskell.packages.${ghcCompiler}.tasty-discover in my shell.nix and indeed, HLS no longer complains about Spec.hs, thank you @fendor , I appreciate the help and quick response time!

Let's use this issue to document this limitation, as well as link to upstream issue in hie-bios.

I'll try to propose a PR some time this week

I have opened #177 to document this limitation.

Should we keep this issue open to track the original issue?

Yeah, I think that is good idea.

Was this page helpful?
0 / 5 - 0 ratings