Skip to content
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

Show package descriptions in Cabal plugin #4428

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

pbrinkmeier
Copy link
Contributor

This PR adds a proof of concept for showing the description for a package when it's hovered in a .cabal file, e.g.:

image

This uses cabal info <package name> under the hood and parses its output.

@pbrinkmeier
Copy link
Contributor Author

Huh, apparently hoistMaybe was added only recently. It's trivial to add our own impl but probably not worth it for this poc.

@fendor
Copy link
Collaborator

fendor commented Oct 20, 2024

I discussed this feature with @wz1000 and GHC is aware of all the package databases in the current compiler session. The package database contains the relevant info (e.g. ghc-pkg --global describe base), so we should be able to read the package db somehow (maybe even via Cabal), and then look for the package with the given name.

In short, there should be a way forward for this feature, that avoids calling cabal info, which is great :)

@pbrinkmeier
Copy link
Contributor Author

Great news! I'll happily incorporate that. Do you have any specific ideas for a way forward?

@fendor
Copy link
Collaborator

fendor commented Oct 20, 2024

Not yet, I need to do some research, but Ill write it down and let you know once I have some idea :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants