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

Documentation URLs are broken

Open svenpanne opened this issue 8 months ago • 7 comments

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.

svenpanne avatar May 04 '25 19:05 svenpanne

Thanks for pointing this out!

I think the initial link is generated by HLS, so this repo sounds like the right location.

fendor avatar May 05 '25 08:05 fendor

I could not reproduce this on linux.

VeryMilkyJoe avatar Jun 08 '25 15:06 VeryMilkyJoe

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.

svenpanne avatar Jun 13 '25 21:06 svenpanne

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:

Image

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 ?

LCamel avatar Jun 27 '25 12:06 LCamel

(hacking)

I just create a Chrome extension to remove the trailing hex characters.

  1. Create a directory and download the two files.
  2. In the "Extensions" page, open "Developer Mode" and "Load unpacked" the directory.

manifest.json rules.json

LCamel avatar Sep 09 '25 02:09 LCamel

related to: https://github.com/haskell/haskell-language-server/issues/2542 ?

theGhostJW avatar Dec 05 '25 20:12 theGhostJW

In Emacs, the same issue persists but for some reason, the url is prefixed with 'file:///' instead of 'https://' Is this Eglot issue ?

dawkrish avatar Dec 08 '25 03:12 dawkrish