-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
Hover docs including links for dependencies #208
Comments
A possible workaround is to active documentation generation for all dependant packages adding in the cabal.project:
(tip credits for @fendor) The hoogle plugin would add docs for dependent packages included in its default set. In the practice they are quite used so you would cover docs for many deps. |
Ignoring the hoogle plugin, currently hls/ghcide glean Haddocks from interface files. For interface files to contain Haddocks, ghc must be called with the Unfortunately, I don't believe Cabal currently knows about this ghc flag, regardless of the For Nix, I have sent a PR [2] to add a setting for this, although it will not be the default until 8.12 [1] - haskell/cabal#6825 |
There is a open issue about implementing the plugin, maybe we should closing it with a note. |
Thanks @pepeiborra, I didn't know about that flag! Not sure what the long-term solution is here then, but for now it seems like it might be worth mentioning in the README that this can be worked around with something like |
@georgefst better documentation would help, but at the moment my setup is Nix based and I don't use either stack or |
@pepeiborra thanks for the clarification about how hls/ghcide hover works. I think we should update hls itself I've tested locally that using |
As hie-bios can use a specific |
(See this issue: haskell/haskell-language-server#208) Adding -haddock gives doc-on-hover for 3rd party libraries like megaparsec. I tested this on a big codebase (>20k SLOC) and compile times stayed the same.
As well as #209, we ought to document that Should we keep things simple and just tell users to enable it globally in addition to |
I think we should add a note about @georgefst would you like and have time to open a pr adding it? |
@jneira I'm sure it's a fairly quick change but I'm pretty swamped at the moment. I also don't know the stack syntax off-hand, and there are probably caveats to mention (increased compile times? I'm not sure whether this is negligible in practice). |
dont worry will try myself, thanks anyways! |
I don't know if it's related or not, but u/2435191 and I have encountered this strange behavior of
@jneira Do you happen to have any clue on this one? |
@rami3l Looks like it's on ghc-9.0, docs is known missing, see https://gitlab.haskell.org/ghc/ghc/-/issues/20903. |
@July541 After upgrading the compiler to GHC 9.2.2 (or more precisely, after using stack snapshot VSCode on my Ubuntu box gives me this, which is expected: However, my Mac gives me this: ... and I have no idea how to fix this. If you need more info on this, please feel free to ask me! |
@rami3l That's amazing, I always thought that only ghc-9.0 had this problem, but I found both ghc-9.2.2 and 9.2.3 are also not shipping the docs. Worth raising a ticket for ghc devs. Update: |
@July541 |
Yes I think. |
@July541 |
@rami3l Many thanks for your timely reminder :) |
@July541 |
GHC devs are slow to respond to some low-priority jobs I think. And thanks to ghcup, compiling ghc from source is much easier than before, I've turned to build ghc from source to make docs available. |
Update: This is indeed an issue with prebuilt GHC releases from ghcup. I don't know about newer GHC 9.2.x versions, but updating to GHC 9.4.4 works for me on macOS. Many thanks to all of you! |
As it stands, it seems that Haddock docs show up for boot libraries, and the project being developed, but not for third party libraries from Hackage.
I would guess (without really knowing anything about the current implementation) that if the dependencies have been installed with documentation (e.g.
documentation: True
in the global cabal config file), then the logic wouldn't be that different to the way it currently works for boot libraries - i.e. HLS just needs some way to know the path to the.haddock
files.I'd be keen to take a look into this if no one currently is. But I would need some pointers.
The text was updated successfully, but these errors were encountered: