From 5b7e2efcfae478557c01bd205bc5736a2cd81589 Mon Sep 17 00:00:00 2001 From: George Thomas Date: Mon, 10 Jan 2022 17:11:22 +0000 Subject: [PATCH 1/7] Bump Ormolu and Fourmolu to latest versions (resp. 0.4 and 0.5) --- plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal | 2 +- plugins/hls-ormolu-plugin/hls-ormolu-plugin.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal b/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal index cd853c71ce..c5b87367b2 100644 --- a/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal +++ b/plugins/hls-fourmolu-plugin/hls-fourmolu-plugin.cabal @@ -23,7 +23,7 @@ library build-depends: , base >=4.12 && <5 , filepath - , fourmolu ^>=0.3 || ^>=0.4 + , fourmolu ^>=0.3 || ^>=0.4 || ^>= 0.5 , ghc , ghc-boot-th , ghcide ^>=1.5.0 diff --git a/plugins/hls-ormolu-plugin/hls-ormolu-plugin.cabal b/plugins/hls-ormolu-plugin/hls-ormolu-plugin.cabal index 99e0184fbb..a1e743e296 100644 --- a/plugins/hls-ormolu-plugin/hls-ormolu-plugin.cabal +++ b/plugins/hls-ormolu-plugin/hls-ormolu-plugin.cabal @@ -28,7 +28,7 @@ library , hls-plugin-api >=1.1 && <1.3 , lens , lsp - , ormolu ^>=0.1.2 || ^>= 0.2 || ^>= 0.3 + , ormolu ^>=0.1.2 || ^>= 0.2 || ^>= 0.3 || ^>= 0.4 , text default-language: Haskell2010 From fbf556e5cc5d00d464fc29fb46b2e7fcaa5b9791 Mon Sep 17 00:00:00 2001 From: George Thomas Date: Mon, 10 Jan 2022 17:41:59 +0000 Subject: [PATCH 2/7] Enable Ormolu and Fourmolu on GHC 9.2 --- cabal-ghc921.project | 4 ++-- haskell-language-server.cabal | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cabal-ghc921.project b/cabal-ghc921.project index fe534c783c..cf877a5adc 100644 --- a/cabal-ghc921.project +++ b/cabal-ghc921.project @@ -9,7 +9,7 @@ packages: -- ./plugins/hls-tactics-plugin -- ./plugins/hls-brittany-plugin -- ./plugins/hls-stylish-haskell-plugin - -- ./plugins/hls-fourmolu-plugin + ./plugins/hls-fourmolu-plugin ./plugins/hls-class-plugin ./plugins/hls-eval-plugin ./plugins/hls-explicit-imports-plugin @@ -40,7 +40,7 @@ index-state: 2021-12-29T12:30:08Z constraints: -- These plugins doesn't work on GHC92 yet - haskell-language-server +ignore-plugins-ghc-bounds -brittany -class -fourmolu -splice -stylishhaskell -tactic -refineImports -callhierarchy -retrie + haskell-language-server +ignore-plugins-ghc-bounds -brittany -class -splice -stylishhaskell -tactic -refineImports -callhierarchy -retrie allow-newer: Cabal, diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index c35e8c0a37..72e8e1fb87 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -288,7 +288,7 @@ common floskell cpp-options: -Dfloskell common fourmolu - if flag(fourmolu) && (impl(ghc < 9.2.1) || flag(ignore-plugins-ghc-bounds)) + if flag(fourmolu) && flag(ignore-plugins-ghc-bounds) build-depends: hls-fourmolu-plugin ^>=1.0.0.0 cpp-options: -Dfourmolu @@ -474,7 +474,7 @@ test-suite func-test -- formatters if flag(floskell) && (impl(ghc < 9.0.1) || flag(ignore-plugins-ghc-bounds)) cpp-options: -Dfloskell - if flag(fourmolu) && (impl(ghc < 9.2.1) || flag(ignore-plugins-ghc-bounds)) + if flag(fourmolu) && flag(ignore-plugins-ghc-bounds) cpp-options: -Dfourmolu if flag(ormolu) cpp-options: -Dormolu From 71ae3e0225fa17b5f7b6a2632fd582c6da88e727 Mon Sep 17 00:00:00 2001 From: George Thomas Date: Mon, 10 Jan 2022 17:58:21 +0000 Subject: [PATCH 3/7] Bump index-state --- cabal-ghc901.project | 2 +- cabal-ghc921.project | 2 +- cabal.project | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cabal-ghc901.project b/cabal-ghc901.project index f813020ae7..63ae5aed8a 100644 --- a/cabal-ghc901.project +++ b/cabal-ghc901.project @@ -37,7 +37,7 @@ package * write-ghc-environment-files: never -index-state: 2021-12-29T12:30:08Z +index-state: 2022-01-10T17:57:05Z constraints: -- These plugins don't work on GHC9 yet diff --git a/cabal-ghc921.project b/cabal-ghc921.project index cf877a5adc..2edbcf2b5d 100644 --- a/cabal-ghc921.project +++ b/cabal-ghc921.project @@ -36,7 +36,7 @@ package * write-ghc-environment-files: never -index-state: 2021-12-29T12:30:08Z +index-state: 2022-01-10T17:57:05Z constraints: -- These plugins doesn't work on GHC92 yet diff --git a/cabal.project b/cabal.project index 01730a4d87..ab23e1f453 100644 --- a/cabal.project +++ b/cabal.project @@ -40,7 +40,7 @@ package * write-ghc-environment-files: never -index-state: 2021-12-29T12:30:08Z +index-state: 2022-01-10T17:57:05Z constraints: hyphenation +embed From 2f095250a050974dfea04746f03544c4a0885c68 Mon Sep 17 00:00:00 2001 From: Javier Neira Date: Thu, 13 Jan 2022 06:46:16 +0100 Subject: [PATCH 4/7] enable tests for ghc-9.2.1 --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7442eb41ae..296961123b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -178,11 +178,11 @@ jobs: name: Test hls-stylish-haskell-plugin run: cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" || cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-stylish-haskell-plugin --test-options="$TEST_OPTS" - - if: matrix.test && matrix.ghc != '9.2.1' + - if: matrix.test name: Test hls-ormolu-plugin run: cabal test hls-ormolu-plugin --test-options="$TEST_OPTS" || cabal test hls-ormolu-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-ormolu-plugin --test-options="$TEST_OPTS" - - if: matrix.test && matrix.ghc != '9.2.1' + - if: matrix.test name: Test hls-fourmolu-plugin run: cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" || cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-fourmolu-plugin --test-options="$TEST_OPTS" From 6136b79e27cfd9c2ccfb0a780a1f58ea6f2fe05c Mon Sep 17 00:00:00 2001 From: Javier Neira Date: Thu, 13 Jan 2022 07:21:13 +0100 Subject: [PATCH 5/7] enable fourmolu and ormolu --- cabal-ghc921.project | 2 -- 1 file changed, 2 deletions(-) diff --git a/cabal-ghc921.project b/cabal-ghc921.project index c18b4ff811..a16663aab9 100644 --- a/cabal-ghc921.project +++ b/cabal-ghc921.project @@ -67,11 +67,9 @@ constraints: -class -eval -floskell - -fourmolu -haddockComments -hlint -moduleName - -ormolu -qualifyImportedNames -refineImports -retrie From eccde13f3df8fcdbfde9303bd692f0144218cd2e Mon Sep 17 00:00:00 2001 From: Javier Neira Date: Thu, 13 Jan 2022 08:30:17 +0100 Subject: [PATCH 6/7] Allow newer ghc-lib-parser for *molu --- cabal-ghc921.project | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cabal-ghc921.project b/cabal-ghc921.project index a16663aab9..3089cee7f4 100644 --- a/cabal-ghc921.project +++ b/cabal-ghc921.project @@ -111,7 +111,11 @@ allow-newer: SVGFonts:diagrams-core, -- for head.hackage - primitive-unlifted:base + primitive-unlifted:base, + + ormolu:ghc-lib-parser, + + fourmolu:ghc-lib-parser allow-older: primitive-extras:primitive-unlifted From e1e47dcffe39725f4a9537084d02d2a588fa592e Mon Sep 17 00:00:00 2001 From: George Thomas Date: Thu, 13 Jan 2022 09:45:54 +0000 Subject: [PATCH 7/7] Fix ormolu --- cabal-ghc921.project | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cabal-ghc921.project b/cabal-ghc921.project index 3089cee7f4..494cbf9401 100644 --- a/cabal-ghc921.project +++ b/cabal-ghc921.project @@ -23,7 +23,7 @@ packages: -- ./plugins/hls-floskell-plugin ./plugins/hls-pragmas-plugin ./plugins/hls-module-name-plugin - -- ./plugins/hls-ormolu-plugin + ./plugins/hls-ormolu-plugin ./plugins/hls-call-hierarchy-plugin -- ./plugins/hls-alternate-number-format-plugin @@ -112,10 +112,6 @@ allow-newer: -- for head.hackage primitive-unlifted:base, - - ormolu:ghc-lib-parser, - - fourmolu:ghc-lib-parser allow-older: primitive-extras:primitive-unlifted