Open georgefst opened 2 years ago
So does this mean we're doing something wrong at Haskell/Cabal level with our dependencies, or is this purely an HLS issue?
So does this mean we're doing something wrong at Haskell/Cabal level with our dependencies, or is this purely an HLS issue?
I'm pretty certain this is purely an HLS issue. Although I wasn't sure when I started investigating. Given there's nothing we can actually do on our end, would you prefer this closed? It would still serve as a useful record.
Nah, let's track the upstream issue. It turns out that GitHub recently added a feature that does it automatically, so long as you format it something like this:
(Actually it seems the automatic tracking label on the upstream repo only works if you put the checkbox + link in the original post? ~Can you put it there and see?~ edit heh, you beat me to it :) )
That's pretty cool. I've edited the OP.
Unfortunately, #625 has made us considerably more vulnerable to this. Fix is essentially the same - load a module from primer-hedgehog
(e.g. TestM
) in to the editor if seeing these sorts of errors in primer-test
.
For the record, until this is fixed upstream, my fix is to load one file from each component in to VSCode:
code \
primer/src/Primer/Core.hs \
primer/gen/Primer/Gen/Core/Raw.hs \
primer/testlib/Primer/Test/Util.hs \
primer/test/Test.hs \
primer-api/src/Primer/API.hs \
primer-api/gen/Primer/Gen/API.hs \
primer-api/testlib/Primer/API/Test/Util.hs \
primer-api/test/Test.hs \
primer-service/src/Primer/Server.hs \
primer-service/exe-server/Main.hs \
primer-service/exe-client/Main.hs \
primer-service/exe-openapi/Main.hs \
primer-service/test/Tests/OpenAPI.hs \
primer-selda/src/Primer/Database/Selda.hs \
primer-selda/testlib/Primer/Database/Selda/Test/Util.hs \
primer-selda/test/Test.hs \
primer-benchmark/src/Benchmarks.hs \
primer-benchmark/test/Main.hs \
primer-benchmark/bench/Main.hs \
I'm sure this can be adapted for other editors.
(Just tracking this here in case anyone bumps in to it, and so that I've got a record of what the issue is for when I inevitably hit it again.)
If we load
primer/primer-service/exe-server/Main.hs
in to an editor running Haskell Language Server, we'll see a bizarre error inrunDB
:This is an instance of https://github.com/haskell/haskell-language-server/issues/1370.
Workaround: load some module from
lib:primer-service
in to the editor. e.g.primer-service/src/Primer/Server.hs
(EDIT: and one fromprimer-selda
e.g.primer-selda/src/Primer/Database/Selda.hs
). This may take a few seconds for HLS to re-initialise with the new component, but it should resolve the error.