haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

Reload .cabal files when they are modified

Open fendor opened this issue 7 months ago • 4 comments

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.

fendor avatar Jun 09 '25 10:06 fendor

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?

soulomoon avatar Jun 13 '25 10:06 soulomoon

I am not sure, maybe. The whole file watcher architecture requires a thorough overhaul, it feels very brittle.

fendor avatar Jun 13 '25 10:06 fendor

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?

soulomoon avatar Jun 16 '25 13:06 soulomoon

I am not sure :sweat_smile:

Probably in a follow-up, maybe we should merge this as is and hope for the best.

fendor avatar Jun 16 '25 14:06 fendor

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.

fendor avatar Aug 08 '25 15:08 fendor