-
-
Notifications
You must be signed in to change notification settings - Fork 368
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
Documentation for build-depends on hover #4385
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.