-
-
Notifications
You must be signed in to change notification settings - Fork 397
Avoid unnecessary recompilation due to -haddock #4596
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
I would love to implement a regression test for this, but I am currently unsure how. |
3f84a3d
to
16d4457
Compare
16d4457
to
2606976
Compare
I manually tested it on GHC and think I can confirm this fixes the recompilation issue but I struggle to come up with a test case in HLS itself. |
possible issue with this PR -- the haddocks for definitions in the local module don't appear to be available in the completion details. I instead see:
in the lsp server's log output. non-local details DO appear to be resolvable, however, and that warning isn't printed. if I just use master instead of applying this PR, this warning is never printed for either local or non-local bindings. |
Thank you for testing this change! I will look into it. |
af7a56d
to
e66c922
Compare
e66c922
to
c8ac7f8
Compare
Due to unprincipled adding and removing the `-haddock` flag during compilation and recompilation checking, we were performing more work than necessary. We avoid this by compiling everything with `-haddock` by default. This is safe nowadays, we have essentially been doing this for many releases, and know this is fine. For the occasion where we actually want to parse without the `-haddock` flag, we keep explicitly disabling it. We enable `-haddock` flag during session loading, since we already perform a number of DynFlags tweaks. This behaviour is dependent on the `OptHaddockParse` opton, which can, currently, only be modified at compile-time.
fd3ee2d
to
d3d1869
Compare
Due to unprincipled adding and removing the
-haddock
flag during compilation and recompilation checking, we were performing more work than necessary.We avoid this by compiling everything with
-haddock
by default. This is safe nowadays, we have essentially been doing this for many releases, and know this is fine.For the occasion where we actually want to parse without the
-haddock
flag, we keep explicitly disabling it.We enable
-haddock
flag during session loading, since we already perform a number of DynFlags tweaks.This behaviour is dependent on the
OptHaddockParse
option, which can, currently, only be modified at compile-time.Closes #4511