Skip to content

Broken links for haddock docs #2194

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

Open
georgefst opened this issue Sep 14, 2021 · 5 comments
Open

Broken links for haddock docs #2194

georgefst opened this issue Sep 14, 2021 · 5 comments
Labels
type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@georgefst
Copy link
Collaborator

georgefst commented Sep 14, 2021

HLS 1.6.1, GHC 8.10.4, Cabal 3.4.0.0, MacOS.

HTML documentation seems to be totally broken for third-party dependencies. Perhaps nobody is using this feature since it's undocumented.

The Documentation link beneath the hover info leads to an almost blank page, with only the Open on Hackage link. This URL erroneously refers to the html library (which isn't even a dependency of my project) instead of the one we want to browse: e.g. https://hackage.haskell.org/package/html-1.0.1.2/docs/Data-List-Extra.html#v:splitOn instead of https://hackage.haskell.org/package/extra-1.7.10/docs/Data-List-Extra.html#v:splitOn.

@jneira jneira added the type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. label Sep 14, 2021
@DunetsNM
Copy link
Contributor

Doc links generation is imprecise, it uses a heuristic that sometimes results in a wrong location. The ultimate fix for it is to parse .haddock files. This would provides far better doc-on-hover experience with more accurate and exhaustive documentation

The bug & PR that I offered to fix it about a year ago:
haskell/ghcide#861
#731

unfortunately it didn't proceed because haddock-api simply fails to compile off hackage for some GHC versions, and it was (probably still is) against HLS policy to supply dependencies outside of hackage / for a specific git revision of haddock-api

I tried to raise and fix it upstream in haddock, afaik it's not fixed. I'm happy to contribute this PR again when haddock is fixed, or when HLS deprecates old GHC versions with broken haddock-api (whatever comes first).

@jneira
Copy link
Member

jneira commented Oct 21, 2021

@DunetsNM how interacts this (afaiu server specific) with the vscode specific open documentation hooks?

Recently that vscode feature got a partial fix: haskell/vscode-haskell#452. It opens directly the docs in hackage or show in a panel but with broken links

@jneira
Copy link
Member

jneira commented Oct 21, 2021

I tried to raise and fix it upstream in haddock, afaik it's not fixed. I'm happy to contribute this PR again when haddock is fixed, or when HLS deprecates old GHC versions with broken haddock-api (whatever comes first).

Could we link the issue/pr upstream here? thanks!

@DunetsNM
Copy link
Contributor

@jneira oh I see, I guess you right ,this particular bug is in VSCode extension not the actual doc html file lookup.

the upstream haddock issue is haskell/haddock#1246

@georgefst
Copy link
Collaborator Author

Yep, this looks like a bug in with the haskell.openDocumentationInHackage option. When that's off (and docs are built, e.g. with cabal configure --enable-documentation), the local docs work correctly.

Tbh, I think rather than having haskell.openDocumentationInHackage exist at all, both options should be available, with the links to local docs only showing when they exist. Just because local docs are built doesn't mean I definitely don't want to open docs in a web browser anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

3 participants