Skip to content

Commit b8d9edd

Browse files
committed
Bump supported versions of ormolu and allow for 9.6
1 parent e3beaa0 commit b8d9edd

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

haskell-language-server.cabal

Lines changed: 1 addition & 1 deletion
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

plugins/hls-ormolu-plugin/hls-ormolu-plugin.cabal

Lines changed: 3 additions & 3 deletions
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

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

Lines changed: 6 additions & 1 deletion
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)