Documentation URLs are broken
Your environment
Which OS do you use? Windows
Which version of GHC do you use and how did you install it?
GHC 9.10.1 from ghcup
Which LSP client (editor/plugin) do you use? VS Code + Haskell plugin
Which version of HLS do you use and how did you install it?
HLS 2.10.0.0 from ghcup
Steps to reproduce
Install HLS 2.10.0.0 and GHC 9.10.0 via ghcup. Install Haskell extension in VS Code. Write tiny "Hello, world!" program. Hover over e.g. putStrLn and click on the "Documentation" link.
Expected behaviour
The link should point to https://hackage.haskell.org/package/ghc-internal-9.1001.0/docs/GHC-Internal-System-IO.html#v:putStrLn.
Actual behaviour
The broken link points to https://hackage.haskell.org/package/ghc-internal-9.1001.0-9d27/docs/GHC-Internal-System-IO.html#v:putStrLn. Note the -9d27 in the URL, which is wrong. Basically the same happens for the "Source" link in the hover window.
I've got no idea if this is a problem with the VS Code plugin, the HLS, Haddock or something else, so I'll try here first. If this is wrong, it would be great to know where to create this issue.
Thanks for pointing this out!
I think the initial link is generated by HLS, so this repo sounds like the right location.
I could not reproduce this on linux.
I just tried it again with HLS 2.11.0.0 and GHC 9.12.2 (Windows, VS Code + Haskell plugin), but the strange suffixes are still there.
I encounter the same issue.
$ haskell-language-server-wrapper --version
haskell-language-server version: 2.10.0.0 (GHC: 9.10.1) (PATH: /home/vscode/.ghcup/hls/2.10.0.0/lib/haskell-language-server-2.10.0.0/bin/haskell-language-server-wrapper)
$ stack exec -- ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.8.4
$ uname -a
Linux codespaces-ccb522 6.8.0-1027-azure #32~22.04.1-Ubuntu SMP Thu Apr 3 20:26:27 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
Here is my configuration: https://github.com/LCamel/haskell-devcontainer/blob/main/install-ghcup-and-stack.sh
VS Code Extension: haskell.haskell Version 2.6.0
There is an extra suffix in the package name:
The markdown string passed to transform() looks like this:
...
[Documentation](file:///home/vscode/.ghcup/ghc/9.8.4/share/doc/ghc-9.8.4/html/libraries/base-4.19.2.0-9fbd/System-IO.html#v:putStrLn)
[Source](file:///home/vscode/.ghcup/ghc/9.8.4/share/doc/ghc-9.8.4/html/libraries/base-4.19.2.0-9fbd/src/System.IO.html#putStrLn)
, which already have unnecessary suffix in the package name. ("base-4.19.2.0-9fbd")
Could this be related to unitHaddockInterfaces ?
(hacking)
I just create a Chrome extension to remove the trailing hex characters.
- Create a directory and download the two files.
- In the "Extensions" page, open "Developer Mode" and "Load unpacked" the directory.
related to: https://github.com/haskell/haskell-language-server/issues/2542 ?
In Emacs, the same issue persists but for some reason, the url is prefixed with 'file:///' instead of 'https://' Is this Eglot issue ?