-
-
Notifications
You must be signed in to change notification settings - Fork 396
Documentation for build-depends on hover #4385
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of nitpicks, otherwise good to go!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just needs to be rebased or merge changes from upstream!
Co-authored-by: fendor <fendor@users.noreply.github.com>
Co-authored-by: fendor <fendor@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you!
If you hover over the field under `build-depends` it will give Documentation with a hackage link to a package. Video with an example: * + hover * + hover handler * working prototype * bugfix * rm TODO * + tests * docs * requested changes * - Debug.Trace * schema * Apply suggestions from code review Co-authored-by: fendor <fendor@users.noreply.github.com> * resolve merge issues * runActionE -> runAction * revert prev, useWithStaleE -> useE * Update plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs Co-authored-by: fendor <fendor@users.noreply.github.com> * + documentation --------- Co-authored-by: fendor <fendor@users.noreply.github.com>
If you hover over the field under `build-depends` it will give Documentation with a hackage link to a package. Video with an example: * + hover * + hover handler * working prototype * bugfix * rm TODO * + tests * docs * requested changes * - Debug.Trace * schema * Apply suggestions from code review Co-authored-by: fendor <fendor@users.noreply.github.com> * resolve merge issues * runActionE -> runAction * revert prev, useWithStaleE -> useE * Update plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs Co-authored-by: fendor <fendor@users.noreply.github.com> * + documentation --------- Co-authored-by: fendor <fendor@users.noreply.github.com>
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:
cabal-hover-cut.mp4
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.