Open lucalabs-de opened 1 month ago
Discussing the feature with @wz1000, HLS knows the exact package versions as it intercepts the cabal build
requests containing the ghc-options -package-id base-4... -package-id aeson-2.2...
.
That means, given the HscEnv
a particular .cabal
version belongs to, we should be able to consult the UnitState
and UnitInfoMap
in particular to find the exact version dependencies without resorting to reading plan.json
.
If you are interested in implementing this feature based on the ghc-options
, I can try to write it down how I think it should work, or we can pair a little bit some time in the future?
That certainly seems like a more sensible approach. I'm definitely interested in implementing it. You can explain it here or we can pair, whatever works best for you.
Implements #4416. Shows installed versions of cabal dependencies as inlay hints, or alternatively as code lenses when inlay hints are not supported.
Code Lenses are currently always displayed at the beginning of the line, I'm not sure if this is an error on my part or a VSCode thing. Depending on how the cabal file is formatted, this can look unpleasant:
I don't yet show the version information in the hover overlay as mentioned in the issue, since I was not sure how it should interplay with #4417. However, it should be a quick change to show it there as well.