Skip to content

Commit 88ccebe

Browse files
authored
Disable the hlint plugin for GHC 9.10, for good (#4767)
1 parent 1078d4b commit 88ccebe

File tree

5 files changed

+15
-35
lines changed

5 files changed

+15
-35
lines changed

docs/support/plugin-support.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ For example, a plugin to provide a formatter which has itself been abandoned has
5656
| `hls-explicit-record-fields-plugin` | 2 | |
5757
| `hls-fourmolu-plugin` | 2 | |
5858
| `hls-gadt-plugin` | 2 | |
59-
| `hls-hlint-plugin` | 2 | |
59+
| `hls-hlint-plugin` | 2 | 9.10 [1] |
6060
| `hls-module-name-plugin` | 2 | |
6161
| `hls-notes-plugin` | 2 | |
6262
| `hls-qualify-imported-names-plugin` | 2 | |
@@ -69,3 +69,5 @@ For example, a plugin to provide a formatter which has itself been abandoned has
6969
| `hls-stan-plugin` | 3 | 9.12.2 |
7070
| `hls-retrie-plugin` | 3 | 9.10.1, 9.12.2 |
7171
| `hls-splice-plugin` | 3 | 9.10.1, 9.12.2 |
72+
73+
[1]: HLint is incompatible with GHC 9.10 series. See the issue [#4674](https://github.com/haskell/haskell-language-server/issues/4674) for discussion and explanation.

haskell-language-server.cabal

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -709,14 +709,19 @@ flag hlint
709709
manual: True
710710

711711
common hlint
712-
if flag(hlint)
712+
-- Hlint isn't compatible with GHC 9.10, and crashes in subtle ways.
713+
-- See https://github.com/haskell/haskell-language-server/issues/4674
714+
-- for its wake of destruction.
715+
if flag(hlint) && !impl(ghc ==9.10.*)
713716
build-depends: haskell-language-server:hls-hlint-plugin
714717
cpp-options: -Dhls_hlint
715718

716719
library hls-hlint-plugin
717720
import: defaults, pedantic, warnings
718-
-- https://github.com/ndmitchell/hlint/pull/1594
719-
if !flag(hlint)
721+
-- Hlint isn't compatible with GHC 9.10, and crashes in subtle ways.
722+
-- See https://github.com/haskell/haskell-language-server/issues/4674
723+
-- for its wake of destruction.
724+
if !flag(hlint) || impl(ghc ==9.10.*)
720725
buildable: False
721726
exposed-modules: Ide.Plugin.Hlint
722727
hs-source-dirs: plugins/hls-hlint-plugin/src
@@ -763,7 +768,10 @@ library hls-hlint-plugin
763768

764769
test-suite hls-hlint-plugin-tests
765770
import: defaults, pedantic, test-defaults, warnings
766-
if !flag(hlint)
771+
-- Hlint isn't compatible with GHC 9.10, and crashes in subtle ways.
772+
-- See https://github.com/haskell/haskell-language-server/issues/4674
773+
-- for its wake of destruction.
774+
if !flag(hlint) || impl(ghc ==9.10.*)
767775
buildable: False
768776
type: exitcode-stdio-1.0
769777
hs-source-dirs: plugins/hls-hlint-plugin/test

test/testdata/schema/ghc910/default-config.golden.json

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,6 @@
9191
},
9292
"globalOn": true
9393
},
94-
"hlint": {
95-
"codeActionsOn": true,
96-
"config": {
97-
"flags": []
98-
},
99-
"diagnosticsOn": true
100-
},
10194
"importLens": {
10295
"codeActionsOn": true,
10396
"codeLensOn": true,

test/testdata/schema/ghc910/markdown-reference.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
## hlint
2-
| Property | Description | Default | Allowed values |
3-
| --- | --- | --- | --- |
4-
| `flags` | Flags used by hlint | `TODO: Array values` |   |
5-
61
## cabal-fmt
72
| Property | Description | Default | Allowed values |
83
| --- | --- | --- | --- |

test/testdata/schema/ghc910/vscode-extension-schema.golden.json

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -213,24 +213,6 @@
213213
"scope": "resource",
214214
"type": "boolean"
215215
},
216-
"haskell.plugin.hlint.codeActionsOn": {
217-
"default": true,
218-
"description": "Enables hlint code actions",
219-
"scope": "resource",
220-
"type": "boolean"
221-
},
222-
"haskell.plugin.hlint.config.flags": {
223-
"default": [],
224-
"markdownDescription": "Flags used by hlint",
225-
"scope": "resource",
226-
"type": "array"
227-
},
228-
"haskell.plugin.hlint.diagnosticsOn": {
229-
"default": true,
230-
"description": "Enables hlint diagnostics",
231-
"scope": "resource",
232-
"type": "boolean"
233-
},
234216
"haskell.plugin.importLens.codeActionsOn": {
235217
"default": true,
236218
"description": "Enables importLens code actions",

0 commit comments

Comments
 (0)