Open noughtmare opened 2 years ago
Yes, this seems hard -- but a great suggestion. With today's infrastructure, you'd likely need to invent a new flag for GHC for cabal to use to pass in the info, just so GHC could present it to users in this error message. Once we have the new error infrastructure, though, it would be possible to imagine HLS inserting the info itself.
A recent question on stackoverflow concerns adding dependencies to the cabal file. The error suggests adding a dependency to the
build-depends
field:However, the .cabal file could contain multiple
build-depends
fields, so it would be useful if the error message could include slightly more information about the build component and perhaps even a line number in the .cabal file.That does seem to require some coordination between GHC and Cabal. Maybe with structured error messages GHC could provide a generic "package not found" error and then cabal could intercept that and provide detailed information on how to solve that. That seems like quite a big change, so maybe there is an easier solution?