-
-
Notifications
You must be signed in to change notification settings - Fork 412
Description
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 in Lib.hs is used in Main.hs. If for example I remove -Wall from the cabal file (just saving it without editing is not enough), and only have Main.hs open in VSCode, I see No 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 to Lib.hs, but other times I've had to delete the contents of Lib.hs, edit Main.hs, then restore Lib.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).