Reload .cabal files when they are modified
Partially addresses #4236
It doesn't work with sessionLoading multipleComponents because hie-bios doesn't give us the correct cradle dependencies.
A workaround is to declare the cradle dependencies in the hie.yaml. We need to fix this in hie-bios proper, but it is no longer an HLS bug.
Just some more interesting thoughts, do you think we can make GetModificationTime rule use GetPhysicalModificationTime rule in the end to remove some duplicated file time query?
I am not sure, maybe. The whole file watcher architecture requires a thorough overhaul, it feels very brittle.
The whole file watcher architecture requires a thorough overhaul, it feels very brittle.
Indeed, are you planning to do it in this PR or open a seperate one for it?
I am not sure :sweat_smile:
Probably in a follow-up, maybe we should merge this as is and hope for the best.
Finally with a regression test! This was a pain to write and I think I discovered another bug. Should be good to merge now.
EDIT: strictly speaking, I still need to add a test that the reload-logic works even when the .cabal file is not open, and we are not using the hls-cabal-plugin... I manually tested that it works.