Skip to content

Commit d35e346

Browse files
enable stylish-haskell for ghc-9.10
1 parent 9127381 commit d35e346

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

Diff for: .github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ jobs:
164164
name: Test hls-stan-plugin
165165
run: cabal test hls-stan-plugin-tests || cabal test hls-stan-plugin-tests
166166

167-
# TODO enable when it supports 9.10
168-
- if: matrix.test && matrix.ghc != '9.10' && matrix.ghc != '9.12'
167+
# TODO enable when it supports 9.12
168+
- if: matrix.test && matrix.ghc != '9.12'
169169
name: Test hls-stylish-haskell-plugin
170170
run: cabal test hls-stylish-haskell-plugin-tests || cabal test hls-stylish-haskell-plugin-tests
171171

Diff for: haskell-language-server.cabal

+4-4
Original file line numberDiff line numberDiff line change
@@ -1551,14 +1551,14 @@ flag stylishHaskell
15511551
manual: True
15521552

15531553
common stylishHaskell
1554-
if flag(stylishHaskell) && (impl(ghc < 9.10) || flag(ignore-plugins-ghc-bounds))
1554+
if flag(stylishHaskell) && (impl(ghc < 9.11) || flag(ignore-plugins-ghc-bounds))
15551555
build-depends: haskell-language-server:hls-stylish-haskell-plugin
15561556
cpp-options: -Dhls_stylishHaskell
15571557

15581558
library hls-stylish-haskell-plugin
15591559
import: defaults, pedantic, warnings
15601560
-- https://github.com/haskell/stylish-haskell/issues/479
1561-
if !(flag(stylishHaskell) && (impl(ghc < 9.10) || flag(ignore-plugins-ghc-bounds)))
1561+
if !flag(stylishHaskell) || (impl(ghc > 9.11) && !flag(ignore-plugins-ghc-bounds))
15621562
buildable: False
15631563
exposed-modules: Ide.Plugin.StylishHaskell
15641564
hs-source-dirs: plugins/hls-stylish-haskell-plugin/src
@@ -1570,13 +1570,13 @@ library hls-stylish-haskell-plugin
15701570
, hls-plugin-api == 2.10.0.0
15711571
, lsp-types
15721572
, mtl
1573-
, stylish-haskell ^>=0.12 || ^>=0.13 || ^>=0.14
1573+
, stylish-haskell ^>=0.12 || ^>=0.13 || ^>=0.14 || ^>=0.15
15741574
, text
15751575

15761576

15771577
test-suite hls-stylish-haskell-plugin-tests
15781578
import: defaults, pedantic, test-defaults, warnings
1579-
if !(flag(stylishHaskell) && (impl(ghc < 9.10) || flag(ignore-plugins-ghc-bounds)))
1579+
if !flag(stylishHaskell) || (impl(ghc > 9.11) && !flag(ignore-plugins-ghc-bounds))
15801580
buildable: False
15811581
type: exitcode-stdio-1.0
15821582
hs-source-dirs: plugins/hls-stylish-haskell-plugin/test

Diff for: plugins/hls-stylish-haskell-plugin/src/Ide/Plugin/StylishHaskell.hs

+4
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ loadConfigFrom :: FilePath -> IO Config
8181
loadConfigFrom file = do
8282
currDir <- getCurrentDirectory
8383
setCurrentDirectory (takeDirectory file)
84+
#if MIN_VERSION_stylish_haskell(0,15,0)
85+
config <- loadConfig (makeVerbose False) SearchFromCurrentDirectory
86+
#else
8487
config <- loadConfig (makeVerbose False) Nothing
88+
#endif
8589
setCurrentDirectory currDir
8690
pure config
8791

0 commit comments

Comments
 (0)