Skip to content

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

Merged
merged 19 commits into from
Sep 8, 2024

Conversation

VenInf
Copy link
Contributor

@VenInf VenInf commented Aug 19, 2024

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.

@VenInf VenInf requested review from fendor and wz1000 as code owners August 19, 2024 23:38
@fendor fendor requested a review from VeryMilkyJoe August 20, 2024 07:53
Copy link
Collaborator

@fendor fendor left a 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!

Copy link
Collaborator

@fendor fendor left a 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>
Copy link
Collaborator

@VeryMilkyJoe VeryMilkyJoe left a 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!

@fendor fendor merged commit 96c3aa7 into haskell:master Sep 8, 2024
33 of 34 checks passed
soulomoon pushed a commit to soulomoon/haskell-language-server that referenced this pull request Sep 23, 2024
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>
soulomoon pushed a commit to soulomoon/haskell-language-server that referenced this pull request Oct 24, 2024
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>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants