Type class instances not picked up on reload #3812
Labels
component: ghcide
multi-component
Issues relating to multi-component support
type: bug
Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
When I make an edit to a cabal file, and HLS thus reloads the session, I often see spurious type class instance errors.
See here for a minimal example, where an instance
C Bool
inLib.hs
is used inMain.hs
. If for example I remove-Wall
from the cabal file (just saving it without editing is not enough), and only haveMain.hs
open in VSCode, I seeNo instance for (C Bool)
once HLS is done reloading. It can take some serious kicking to get HLS to pick up the instance. Sometimes it's enough to make some non-trivial edit toLib.hs
, but other times I've had to delete the contents ofLib.hs
, editMain.hs
, then restoreLib.hs
to get the errors to go away. This has become quite painful in a larger project.Note that this doesn't happen on initial load. I can restart the LSP server, only load
Main.hs
and get no error. Even with a completely fresh load, i.e. no entry in~/.cache/hie-bios
.I haven't bisected, but I'm pretty sure this is a recent regression (2.1 or 2.2).
The text was updated successfully, but these errors were encountered: