Skip to content

Commit

Permalink
Enhance formatting of the cabal-version error message (#4436)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
fendor and VeryMilkyJoe authored Oct 22, 2024
1 parent 3591109 commit 75a6dd7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 8 additions & 0 deletions docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,14 @@ Code action kind: `quickfix`

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

### Add dependency to `cabal` file

Provided by: `hls-cabal-plugin`

Code action kind: `quickfix`

Add a missing package dependency to your `.cabal` file.

## Code lenses

### Add type signature
Expand Down
6 changes: 4 additions & 2 deletions plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,10 @@ cabalRules recorder plId = do
-- user did not do anything wrong. Instead we cast it to a warning
regex = "Unsupported cabal-version [0-9]+.[0-9]*"
unsupportedCabalHelpText = unlines
[ "The used cabal version is not fully supported by HLS. This means that some functionality might not work as expected."
, "If you face any issues try to downgrade to a supported cabal version."
[ "The used `cabal-version` is not fully supported by this `HLS` binary."
, "Either the `cabal-version` is unknown, or too new for this executable."
, "This means that some functionality might not work as expected."
, "If you face any issues, try downgrading to a supported `cabal-version` or upgrading `HLS` if possible."
, ""
, "Supported versions are: " <>
List.intercalate ", "
Expand Down

0 comments on commit 75a6dd7

Please sign in to comment.