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

Show package descriptions in Cabal plugin

Open pbrinkmeier opened this issue 1 year ago • 4 comments

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 avatar Oct 13 '24 09:10 pbrinkmeier

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

pbrinkmeier avatar Oct 13 '24 10:10 pbrinkmeier

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 :)

fendor avatar Oct 20 '24 18:10 fendor

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

pbrinkmeier avatar Oct 20 '24 19:10 pbrinkmeier

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

fendor avatar Oct 20 '24 20:10 fendor