You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Clicking "Source" to open haddock source on hackage opens invalid URL #520
Execute in the root of your project the command haskell-language-server-wrapper --debug . and paste the logs here:
(if you are using the vscode extension check the executable location here)
Debug output:
<paste your logs here>
Paste the logs from the lsp-client, you can check instructions about for VS Code here
For reference here's a related upstream issue in haddock : haskell/haddock#1447
My understanding of why the source links are broken: some time ago there was a change in haddock in how the html files with hyperlinked source are named.
In more recent versions of haddock, the hyperlinked source code files contain - as module separator(e.g. Control-Monad.html), in older version of haddock they contain . as module separator (Control.Monad.html). The code linked above always assumes . is used as module name separator which is where you get "Page Not Found" error when you click on Source link in vscode, but if you fix the URL manually by replacing . with - you'll see the hyperlinked source code.
I'm not sure what's the best way to fix this - someone COULD go and fix the haddock logic upstream so it always uses '.' as separator. But then you'd still have tons of haddocks generated on hackage which still use '-' as separator, for which the link would still be broken.
Another option would be to fix the typescript logic in vscode-haskell - but since it doesn't know what version of haddock was used to generate the docs, it doesn't know whether it should use '-' or '.'. Not sure how this could be improved :(
Thanks for the investigation here @jhrcek. My recommendation would be the extension should either:
Prefer the most recent format. Sounds like the -, this is because HLS and thereby the extension really only work with the 3 most recent GHC versions and will continue to leave older GHC/Stackage LTS/etc behind. It would certainly be better I think to continue supporting the latest especially since it doesn't sound like it will be reverted.
Another option would be to support both, and add a config parameter to the extension so people can tweak it to their needs. Seems like a good bit more work without a clear benefit
Activity
jhrcek commentedon Dec 19, 2021
This seems to be problem in vscode-haskell, which is replacing
-s with.s here:vscode-haskell/src/docsBrowser.ts
Lines 160 to 163 in 7eb6a48
The logic replacing -s with .s was introduced in this PR: #452
jneira commentedon Dec 19, 2021
Yeah, thanks for the report and the further investigation, moving to the extension repo
jhrcek commentedon May 28, 2022
For reference here's a related upstream issue in haddock : haskell/haddock#1447
My understanding of why the source links are broken: some time ago there was a change in haddock in how the html files with hyperlinked source are named.
In more recent versions of haddock, the hyperlinked source code files contain
-as module separator(e.g. Control-Monad.html), in older version of haddock they contain.as module separator (Control.Monad.html). The code linked above always assumes.is used as module name separator which is where you get "Page Not Found" error when you click on Source link in vscode, but if you fix the URL manually by replacing . with - you'll see the hyperlinked source code.I'm not sure what's the best way to fix this - someone COULD go and fix the haddock logic upstream so it always uses '.' as separator. But then you'd still have tons of haddocks generated on hackage which still use '-' as separator, for which the link would still be broken.
Another option would be to fix the typescript logic in vscode-haskell - but since it doesn't know what version of haddock was used to generate the docs, it doesn't know whether it should use '-' or '.'. Not sure how this could be improved :(
mjrussell commentedon Jun 1, 2022
Thanks for the investigation here @jhrcek. My recommendation would be the extension should either:
Prefer the most recent format. Sounds like the
-, this is because HLS and thereby the extension really only work with the 3 most recent GHC versions and will continue to leave older GHC/Stackage LTS/etc behind. It would certainly be better I think to continue supporting the latest especially since it doesn't sound like it will be reverted.Another option would be to support both, and add a config parameter to the extension so people can tweak it to their needs. Seems like a good bit more work without a clear benefit
alexfmpe commentedon May 27, 2024
Might be worthwhile instead grabbing the URLs that HLS already produces: haskell/haskell-language-server#3475 (comment)