Skip to content
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

Show package description on hover for package dependencies #4417

Open
VeryMilkyJoe opened this issue Oct 10, 2024 · 2 comments
Open

Show package description on hover for package dependencies #4417

VeryMilkyJoe opened this issue Oct 10, 2024 · 2 comments
Labels
component: hls-cabal-plugin Issues related to the hls-cabal-plugin type: enhancement New feature or request

Comments

@VeryMilkyJoe
Copy link
Collaborator

It would be nice to be able to see a description of a dependency when hovering over that dependency in a cabal file.

Packages already have such a description field, the tricky part of this issue is to extract a given package's description from the correct package database.
We should already have access to the package database, but we would need to be able to decide which package database corresponds to the current cabal file.

@VeryMilkyJoe VeryMilkyJoe added type: enhancement New feature or request component: hls-cabal-plugin Issues related to the hls-cabal-plugin labels Oct 10, 2024
@pbrinkmeier
Copy link
Contributor

I am currently working on this and #4416. As a first approximation we are going to call out to cabal info <package> when hovering a dependency. In the future we might be able to coax Cabal to provide this information through its API.

As a reference for the cabal info output format, I'll be using the implementation in cabal-install.

@pbrinkmeier
Copy link
Contributor

pbrinkmeier commented Oct 12, 2024

image

My current impl simply dumps the cabal info output into the tooltip

Example output for cabal info text:

* text             (library)
    Synopsis:      An efficient packed Unicode text type.
    Versions available: 0.11.3.1, 1.1.1.4, 1.2.4.1, 1.2.5.0, 2.0, 2.0.1, 2.0.2,
                        2.1, 2.1.1 (and 70 others)
    Versions installed: 2.0.2
    Homepage:      https://github.com/haskell/text
    Bug reports:   https://github.com/haskell/text/issues
    Description:   An efficient packed, immutable Unicode text type (both strict
                   and lazy).
               The 'Text' type represents Unicode character strings, in a
               time and space-efficient manner. This package provides text
               processing capabilities that are optimized for performance
               critical use, both in terms of large data quantities and high
               speed.
               
               The 'Text' type provides character-encoding, type-safe case
               conversion via whole-string case conversion functions (see
               "Data.Text"). It also provides a range of functions for
               converting 'Text' values to and from 'ByteStrings', using
               several standard encodings (see "Data.Text.Encoding").
               
               Efficient locale-sensitive support for text IO is also
               supported (see "Data.Text.IO").
               
               These modules are intended to be imported qualified, to avoid
               name clashes with Prelude functions, e.g.
               
               > import qualified Data.Text as T
               
               == ICU Support
               
               To use an extended and very rich family of functions for
               working with Unicode text (including normalization, regular
               expressions, non-standard encodings, text breaking, and
               locales), see the [text-icu
               package](https://hackage.haskell.org/package/text-icu) based
               on the well-respected and liberally licensed [ICU
               library](http://site.icu-project.org/).
Category:      Data, Text
License:       BSD-2-Clause
Author:        Bryan O'Sullivan <[email protected]>
Maintainer:    Haskell Text Team <[email protected]>, Core Libraries Committee
Source repo:   https://github.com/haskell/text
Flags:         developer, simdutf, pure-haskell
Dependencies:  array >=0.3 && <0.6, base >=4.10 && <5, binary >=0.5 && <0.9,
               bytestring >=0.10.4 && <0.13, deepseq >=1.1 && <1.6,
               ghc-prim >=0.2 && <0.12, template-haskell >=2.5 && <2.23,
               system-cxx-std-lib ==1.0, base <0,
               data-array-byte >=0.1 && <0.2, QuickCheck >=2.12.6 && <2.15,
               base <5, bytestring, deepseq, directory, ghc-prim, tasty,
               tasty-hunit, tasty-quickcheck, template-haskell,
               transformers, text, data-array-byte >=0.1 && <0.2,
               tasty-inspection-testing, base, bytestring >=0.10.4,
               containers, deepseq, directory, filepath, tasty-bench >=0.2,
               text, transformers
Documentation: [ Not installed ]
Cached:        No
Modules:
    Data.Text
    Data.Text.Array
    Data.Text.Encoding
    Data.Text.Encoding.Error
    Data.Text.Foreign
    Data.Text.IO
    Data.Text.Internal
    Data.Text.Internal.Builder
    Data.Text.Internal.Builder.Functions
    Data.Text.Internal.Builder.Int.Digits
    Data.Text.Internal.Builder.RealFloat.Functions
    Data.Text.Internal.ByteStringCompat
    Data.Text.Internal.Encoding
    Data.Text.Internal.Encoding.Fusion
    Data.Text.Internal.Encoding.Fusion.Common
    Data.Text.Internal.Encoding.Utf16
    Data.Text.Internal.Encoding.Utf32
    Data.Text.Internal.Encoding.Utf8
    Data.Text.Internal.Fusion
    Data.Text.Internal.Fusion.CaseMapping
    Data.Text.Internal.Fusion.Common
    Data.Text.Internal.Fusion.Size
    Data.Text.Internal.Fusion.Types
    Data.Text.Internal.IO
    Data.Text.Internal.Lazy
    Data.Text.Internal.Lazy.Encoding.Fusion
    Data.Text.Internal.Lazy.Fusion
    Data.Text.Internal.Lazy.Search
    Data.Text.Internal.PrimCompat
    Data.Text.Internal.Private
    Data.Text.Internal.Read
    Data.Text.Internal.Search
    Data.Text.Internal.StrictBuilder
    Data.Text.Internal.Unsafe
    Data.Text.Internal.Unsafe.Char
    Data.Text.Lazy
    Data.Text.Lazy.Builder
    Data.Text.Lazy.Builder.Int
    Data.Text.Lazy.Builder.RealFloat
    Data.Text.Lazy.Encoding
    Data.Text.Lazy.IO
    Data.Text.Lazy.Internal
    Data.Text.Lazy.Read
    Data.Text.Read
    Data.Text.Unsafe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: hls-cabal-plugin Issues related to the hls-cabal-plugin type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants