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

Documentation for build-depends on hover

Open VenInf opened this issue 1 year ago • 0 comments

Documentation for build-depends on hover.

If you hover over the field under build-depends it will give Documentation with a hackage link to a package.

Video with an example:

https://github.com/user-attachments/assets/2b20354c-3fc9-4bbf-89ec-e0a61e07b47c

Implementation details

This is a naive solution for this problem, hovered text is filtered using a regex and compared to found dependencies from PackageDescription. If it was found, then the Documentation message is added, otherwise left as is.

This approach assumes, that if a package is mentioned in a cabal file, there should be a link with the same name. In this implementation there are no spelling checks.

VenInf avatar Aug 19 '24 23:08 VenInf