Skip to content

Commit 1edc757

Browse files
authored
Bump supported ormolu, allow for 9.6 (#3668)
* Bump supported versions of ormolu and allow for 9.6 * Update plugin support doc * Fix test workflow too
1 parent 53604eb commit 1edc757

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

Diff for: .github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ jobs:
166166
name: Test hls-stylish-haskell-plugin
167167
run: cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" || cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS"
168168

169-
- if: matrix.test && matrix.ghc != '9.6'
169+
- if: matrix.test
170170
name: Test hls-ormolu-plugin
171171
run: cabal test hls-ormolu-plugin --test-options="$TEST_OPTS" || cabal test hls-ormolu-plugin --test-options="$TEST_OPTS"
172172

173-
- if: matrix.test && matrix.ghc != '9.6'
173+
- if: matrix.test
174174
name: Test hls-fourmolu-plugin
175175
run: cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" || cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS"
176176

Diff for: docs/support/plugin-support.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ For example, a plugin to provide a formatter which has itself been abandoned has
5353
| `hls-explicit-fixity-plugin` | 2 | |
5454
| `hls-explicit-record-fields-plugin` | 2 | |
5555
| `hls-floskell-plugin` | 2 | 9.6 |
56-
| `hls-fourmolu-plugin` | 2 | 9.6 |
56+
| `hls-fourmolu-plugin` | 2 | |
5757
| `hls-gadt-plugin` | 2 | |
5858
| `hls-hlint-plugin` | 2 | 9.6 |
5959
| `hls-module-name-plugin` | 2 | |
6060
| `hls-qualify-imported-names-plugin` | 2 | |
61-
| `hls-ormolu-plugin` | 2 | 9.6 |
61+
| `hls-ormolu-plugin` | 2 | |
6262
| `hls-rename-plugin` | 2 | |
6363
| `hls-refine-imports-plugin` | 2 | |
6464
| `hls-stylish-haskell-plugin` | 2 | 9.6 |

Diff for: haskell-language-server.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ common fourmolu
349349
cpp-options: -Dhls_fourmolu
350350

351351
common ormolu
352-
if flag(ormolu) && impl(ghc < 9.5)
352+
if flag(ormolu) && impl(ghc < 9.7)
353353
build-depends: hls-ormolu-plugin == 2.1.0.0
354354
cpp-options: -Dhls_ormolu
355355

Diff for: plugins/hls-ormolu-plugin/hls-ormolu-plugin.cabal

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ source-repository head
2323
location: https://github.com/haskell/haskell-language-server.git
2424

2525
library
26-
if impl(ghc >= 9.5)
26+
if impl(ghc >= 9.7)
2727
buildable: False
2828
exposed-modules: Ide.Plugin.Ormolu
2929
hs-source-dirs: src
@@ -36,13 +36,13 @@ library
3636
, hls-plugin-api == 2.1.0.0
3737
, lens
3838
, lsp
39-
, ormolu ^>=0.1.2 || ^>= 0.2 || ^>= 0.3 || ^>= 0.5
39+
, ormolu ^>=0.1.2 || ^>= 0.2 || ^>= 0.3 || ^>= 0.5 || ^>= 0.6 || ^>= 0.7
4040
, text
4141

4242
default-language: Haskell2010
4343

4444
test-suite tests
45-
if impl(ghc >= 9.5)
45+
if impl(ghc >= 9.7)
4646
buildable: False
4747
type: exitcode-stdio-1.0
4848
default-language: Haskell2010

Diff for: plugins/hls-ormolu-plugin/src/Ide/Plugin/Ormolu.hs

+6-1
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,14 @@ provider ideState typ contents fp _ = withIndefiniteProgress title Cancellable $
5656
CabalNotFound -> Nothing
5757
CabalDidNotMention cabalInfo -> Just cabalInfo
5858
CabalFound cabalInfo -> Just cabalInfo
59+
#if MIN_VERSION_ormolu(0,7,0)
60+
(fixityOverrides, moduleReexports) <- getDotOrmoluForSourceFile fp'
61+
let conf' = refineConfig ModuleSource cabalInfo (Just fixityOverrides) (Just moduleReexports) conf
62+
#else
5963
fixityOverrides <- traverse getFixityOverridesForSourceFile cabalInfo
6064
let conf' = refineConfig ModuleSource cabalInfo fixityOverrides conf
61-
cont' = cont
65+
#endif
66+
let cont' = cont
6267
#else
6368
let conf' = conf
6469
cont' = T.unpack cont

0 commit comments

Comments
 (0)