Skip to content

Commit 8cef7a4

Browse files
authored
Support ghc 9.4 for hls-class-plugin (#3258)
* Support ghc 9.4 for hls-class-plugin * Update support table * Update test description * Update nix dependency
1 parent e36208b commit 8cef7a4

File tree

8 files changed

+14
-18
lines changed

8 files changed

+14
-18
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ jobs:
169169
name: Test hls-floskell-plugin
170170
run: cabal test hls-floskell-plugin --test-options="$TEST_OPTS" || cabal test hls-floskell-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-floskell-plugin --test-options="$TEST_OPTS"
171171

172-
- if: matrix.test && matrix.ghc != '9.4.2'
172+
- if: matrix.test
173173
name: Test hls-class-plugin
174174
run: cabal test hls-class-plugin --test-options="$TEST_OPTS" || cabal test hls-class-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-class-plugin --test-options="$TEST_OPTS"
175175

cabal.project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ package *
4848

4949
write-ghc-environment-files: never
5050

51-
index-state: 2022-09-14T16:53:13Z
51+
index-state: 2022-10-07T12:19:15Z
5252

5353
constraints:
5454
-- For GHC 9.4, older versions of entropy fail to build on Windows

configuration-ghc-94.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ let
2525
ptr-poker = hself.callCabal2nix "ptr-poker" inputs.ptr-poker { };
2626

2727
ghc-exactprint =
28-
hself.callCabal2nix "ghc-exactprint" inputs.ghc-exactprint-150 { };
28+
hself.callCabal2nix "ghc-exactprint" inputs.ghc-exactprint-160 { };
2929
# Hlint is still broken
3030
hlint = doJailbreak (hself.callCabal2nix "hlint" inputs.hlint { });
3131

docs/support/plugin-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ For example, a plugin to provide a formatter which has itself been abandoned has
4646
| `hls-pragmas-plugin` | 1 | |
4747
| `hls-refactor-plugin` | 1 | 9.4 |
4848
| `hls-alternate-number-plugin` | 2 | |
49-
| `hls-class-plugin` | 2 | 9.4 |
49+
| `hls-class-plugin` | 2 | |
5050
| `hls-change-type-signature-plugin` | 2 | |
5151
| `hls-eval-plugin` | 2 | 9.4 |
5252
| `hls-explicit-fixity-plugin` | 2 | |

flake.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
url = "https://hackage.haskell.org/package/lsp-test-0.14.1.0/lsp-test-0.14.1.0.tar.gz";
4040
flake = false;
4141
};
42+
ghc-exactprint-160 = {
43+
url = "https://hackage.haskell.org/package/ghc-exactprint-1.6.0/ghc-exactprint-1.6.0.tar.gz";
44+
flake = false;
45+
};
4246
ghc-exactprint-150 = {
4347
url = "https://hackage.haskell.org/package/ghc-exactprint-1.5.0/ghc-exactprint-1.5.0.tar.gz";
4448
flake = false;

haskell-language-server.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ flag dynamic
201201
manual: True
202202

203203
common class
204-
if flag(class) && (impl(ghc < 9.4.1) || flag(ignore-plugins-ghc-bounds))
204+
if flag(class)
205205
build-depends: hls-class-plugin ^>= 1.1
206206
cpp-options: -Dhls_class
207207

@@ -271,7 +271,7 @@ common splice
271271
cpp-options: -Dhls_splice
272272

273273
common alternateNumberFormat
274-
if flag(alternateNumberFormat)
274+
if flag(alternateNumberFormat)
275275
build-depends: hls-alternate-number-format-plugin ^>= 1.2
276276
cpp-options: -Dhls_alternateNumberFormat
277277

plugins/hls-class-plugin/hls-class-plugin.cabal

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ source-repository head
2525
location: https://github.com/haskell/haskell-language-server.git
2626

2727
library
28-
if impl(ghc >= 9.3)
29-
buildable: False
30-
else
31-
buildable: True
3228
exposed-modules: Ide.Plugin.Class
3329
other-modules: Ide.Plugin.Class.CodeAction
3430
, Ide.Plugin.Class.CodeLens
@@ -53,9 +49,9 @@ library
5349
, transformers
5450

5551
if impl(ghc >=9.2.1)
56-
build-depends: ghc-exactprint ^>= 1.5
52+
build-depends: ghc-exactprint >= 1.5
5753
else
58-
build-depends: ghc-exactprint >= 0.6.4 && <1.1
54+
build-depends: ghc-exactprint >= 0.6.4 && <1.1
5955

6056
default-language: Haskell2010
6157
default-extensions:
@@ -66,10 +62,6 @@ library
6662
ghc-options: -Wall -Wno-unticked-promoted-constructors -Wno-name-shadowing
6763

6864
test-suite tests
69-
if impl(ghc >= 9.3)
70-
buildable: False
71-
else
72-
buildable: True
7365
type: exitcode-stdio-1.0
7466
default-language: Haskell2010
7567
hs-source-dirs: test

plugins/hls-class-plugin/test/Main.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ codeActionTests recorder = testGroup
6969
executeCodeAction gAction
7070
, goldenWithClass recorder "Creates a placeholder for other two methods" "T6" "2" $ \(_:_:ghAction:_) -> do
7171
executeCodeAction ghAction
72-
, onlyRunForGhcVersions [GHC92] "Only ghc-9.2 enabled GHC2021 implicitly" $
72+
, onlyRunForGhcVersions [GHC92, GHC94] "Only ghc-9.2+ enabled GHC2021 implicitly" $
7373
goldenWithClass recorder "Don't insert pragma with GHC2021" "InsertWithGHC2021Enabled" "" $ \(_:eqWithSig:_) -> do
7474
executeCodeAction eqWithSig
7575
, goldenWithClass recorder "Insert pragma if not exist" "InsertWithoutPragma" "" $ \(_:eqWithSig:_) -> do
@@ -96,7 +96,7 @@ codeLensTests recorder = testGroup
9696
, goldenCodeLens recorder "Apply code lens for local class" "LocalClassDefine" 0
9797
, goldenCodeLens recorder "Apply code lens on the same line" "Inline" 0
9898
, goldenCodeLens recorder "Don't insert pragma while existing" "CodeLensWithPragma" 0
99-
, onlyRunForGhcVersions [GHC92] "Only ghc-9.2 enabled GHC2021 implicitly" $
99+
, onlyRunForGhcVersions [GHC92, GHC94] "Only ghc-9.2+ enabled GHC2021 implicitly" $
100100
goldenCodeLens recorder "Don't insert pragma while GHC2021 enabled" "CodeLensWithGHC2021" 0
101101
, goldenCodeLens recorder "Qualified name" "Qualified" 0
102102
, goldenCodeLens recorder "Type family" "TypeFamily" 0

0 commit comments

Comments
 (0)