Closed
Description
When HLS gets an error "module Bla.Bla.Bla
is a member of a hidden package bla
" it should suggest a quick fix to insert the dependency on bla
into Cabal file using https://github.com/Bodigrim/cabal-add and carry on.
cabal-add
draft API can be examined here: https://hackage.haskell.org/package/cabal-add-0.1/candidate/docs/Distribution-Client-Add.html. My impression is that HLS should be very much capable to create Config
and write the result of executeConfig
to the disk.
CC @VeryMilkyJoe on behalf of hls-cabal-plugin
.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
georgefst commentedon Oct 27, 2023
This has been on the todo list for a long time: #155 (but maybe
cabal-add
is the solution!).Bodigrim commentedon Oct 27, 2023
cabal-add
preserves the formatting of the original file. I tested it on complete set of Cabal files from Hackage.fendor commentedon Oct 28, 2023
Adding
cabal-add
should be a matter of parsing the error message, guessing the relevant.cabal
file and then runningcabal-add
on it. #3778 can be used as an inspiration for this particular code action.Nothing difficult about it, just someone needs to take the time to implement it!
fendor commentedon Aug 21, 2024
Implemented by #4360