Skip to content

Documentation and Source links for local dependencies #1866

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
eirikm opened this issue May 25, 2021 · 8 comments
Open

Documentation and Source links for local dependencies #1866

eirikm opened this issue May 25, 2021 · 8 comments
Labels
build tool: stack status: needs info Not actionable, because there's missing information type: enhancement New feature or request

Comments

@eirikm
Copy link

eirikm commented May 25, 2021

Hi, today I get a Documentation and a Source link when hovering functions in packages published on hackage.

Screenshot 2021-05-25 at 09 23 16

Is it possible to get these links for functions in private libraries?

I have tried stack haddock which generates the html documentation and source needed but it doesn't look like the haskell-plugin is aware of this.

@jneira
Copy link
Member

jneira commented May 25, 2021

Hi, thanks for opening the issue, to get docs on hover it is needed to build them with the -haddock ghc flag as described here: https://github.com/haskell/haskell-language-server#features

@jneira jneira transferred this issue from haskell/vscode-haskell May 25, 2021
@jneira jneira added the type: support User support tickets, questions, help with setup etc. label May 25, 2021
@eirikm
Copy link
Author

eirikm commented May 27, 2021

By adding the flag I get the haddock documentation in the popup, but not the links to Documentation and Source.

Mac OS 10.15.7
VSCode 1.56.2
haskell-language-server-1.1.0-darwin-8.10.4
haskell.haskell v1.4.0
stack 2.7.1 x86_64 hpack-0.34.4

@jneira jneira added status: needs repro type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels May 27, 2021
@eirikm
Copy link
Author

eirikm commented Jun 4, 2021

https://github.com/eirikm/hls-testcase/tree/reproduce_1866_take_1

Hover on putStrLn is displayed fine with both haddock and Documentation-link
Screenshot 2021-06-04 at 14 22 04

Hover on LocalLib.someFunc displays haddock but not Documentation- and Source-link (I guess this is intentionally)
Screenshot 2021-06-04 at 14 18 58

Hover on PackagesLib.someFunc displays everything fine!
Screenshot 2021-06-04 at 14 19 17

Hover on ExtraDepsLib.someFunc is missing haddock documentation.
Screenshot 2021-06-04 at 14 19 34

@georgefst
Copy link
Collaborator

georgefst commented Sep 14, 2021

Just to check this is consistent with #208, I assume you've enabled --enable-documentation?

Also this should probably be renamed to "Documentation and Source links for local dependencies" or similar, so it isn't conflated with #208.

@georgefst
Copy link
Collaborator

Just to check this is consistent with #208, I assume you've enabled --enable-documentation?

Ah, I see you're using Stack. Is there a Stack equivalent? Or is the functionality enabled by default?

@eirikm eirikm changed the title Documentation and Source links Documentation and Source links for local dependencies Sep 14, 2021
@eirikm
Copy link
Author

eirikm commented Sep 14, 2021

I thought that this would do the trick:
https://github.com/eirikm/hls-testcase/blob/2f276e4a4f8a2fac6b41e8abf8a0aca182868040/app/stack.yaml#L70

but apparently it doesn't in my case.

@jneira
Copy link
Member

jneira commented Oct 21, 2021

I thought that this would do the trick: https://github.com/eirikm/hls-testcase/blob/2f276e4a4f8a2fac6b41e8abf8a0aca182868040/app/stack.yaml#L70

but apparently it doesn't in my case.

@eirikm what about add

build:
  haddock: true

to try make links be shown?

also did not

ghc-options:
  '$everything': -haddock

fix the haddock docs for extra deps?

@hasufell hasufell added status: needs info Not actionable, because there's missing information and removed old_status: needs repro labels Jul 13, 2022
@michaelpj michaelpj added type: enhancement New feature or request and removed type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. type: support User support tickets, questions, help with setup etc. labels Mar 22, 2023
@michaelpj
Copy link
Collaborator

I don't think we will easily get the "Documentation" link, since that jumps to the Haddock HTML on Hackage. For local dependencies there is no way to get cabal to build the haddock HTML for dependencies that I know of, so we have nowhere to link to. Maybe with some more hacking around with cabal we could get this.

For the "Source" link I think the fundamental issue is #708.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build tool: stack status: needs info Not actionable, because there's missing information type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants