Skip to content

Commit 75a6dd7

Browse files
fendorVeryMilkyJoe
andauthored
Enhance formatting of the cabal-version error message (#4436)
* Fix formatting of the `cabal-version` error message Add docs for `cabal-add` based CodeAction * Apply suggestions from code review Co-authored-by: VeryMilkyJoe <[email protected]> --------- Co-authored-by: VeryMilkyJoe <[email protected]>
1 parent 3591109 commit 75a6dd7

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

docs/features.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,14 @@ Code action kind: `quickfix`
316316

317317
Correct common misspelling of SPDX Licenses such as `BSD-3-Clause`.
318318

319+
### Add dependency to `cabal` file
320+
321+
Provided by: `hls-cabal-plugin`
322+
323+
Code action kind: `quickfix`
324+
325+
Add a missing package dependency to your `.cabal` file.
326+
319327
## Code lenses
320328

321329
### Add type signature

plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,10 @@ cabalRules recorder plId = do
254254
-- user did not do anything wrong. Instead we cast it to a warning
255255
regex = "Unsupported cabal-version [0-9]+.[0-9]*"
256256
unsupportedCabalHelpText = unlines
257-
[ "The used cabal version is not fully supported by HLS. This means that some functionality might not work as expected."
258-
, "If you face any issues try to downgrade to a supported cabal version."
257+
[ "The used `cabal-version` is not fully supported by this `HLS` binary."
258+
, "Either the `cabal-version` is unknown, or too new for this executable."
259+
, "This means that some functionality might not work as expected."
260+
, "If you face any issues, try downgrading to a supported `cabal-version` or upgrading `HLS` if possible."
259261
, ""
260262
, "Supported versions are: " <>
261263
List.intercalate ", "

0 commit comments

Comments
 (0)