From bafc9fc8ea159e9c0aee95662dde73a035724e64 Mon Sep 17 00:00:00 2001 From: fendor Date: Wed, 26 Nov 2025 09:51:19 +0100 Subject: [PATCH] Disable the hlint plugin for GHC 9.10, for good --- docs/support/plugin-support.md | 4 +++- haskell-language-server.cabal | 16 ++++++++++++---- .../schema/ghc910/default-config.golden.json | 7 ------- .../schema/ghc910/markdown-reference.md | 5 ----- .../ghc910/vscode-extension-schema.golden.json | 18 ------------------ 5 files changed, 15 insertions(+), 35 deletions(-) diff --git a/docs/support/plugin-support.md b/docs/support/plugin-support.md index 724ca99da0..e69c783267 100644 --- a/docs/support/plugin-support.md +++ b/docs/support/plugin-support.md @@ -56,7 +56,7 @@ For example, a plugin to provide a formatter which has itself been abandoned has | `hls-explicit-record-fields-plugin` | 2 | | | `hls-fourmolu-plugin` | 2 | | | `hls-gadt-plugin` | 2 | | -| `hls-hlint-plugin` | 2 | | +| `hls-hlint-plugin` | 2 | 9.10 [1] | | `hls-module-name-plugin` | 2 | | | `hls-notes-plugin` | 2 | | | `hls-qualify-imported-names-plugin` | 2 | | @@ -69,3 +69,5 @@ For example, a plugin to provide a formatter which has itself been abandoned has | `hls-stan-plugin` | 3 | 9.12.2 | | `hls-retrie-plugin` | 3 | 9.10.1, 9.12.2 | | `hls-splice-plugin` | 3 | 9.10.1, 9.12.2 | + +[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. diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index c24b1869ba..23260a5393 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -709,14 +709,19 @@ flag hlint manual: True common hlint - if flag(hlint) + -- Hlint isn't compatible with GHC 9.10, and crashes in subtle ways. + -- See https://github.com/haskell/haskell-language-server/issues/4674 + -- for its wake of destruction. + if flag(hlint) && !impl(ghc ==9.10.*) build-depends: haskell-language-server:hls-hlint-plugin cpp-options: -Dhls_hlint library hls-hlint-plugin import: defaults, pedantic, warnings - -- https://github.com/ndmitchell/hlint/pull/1594 - if !flag(hlint) + -- Hlint isn't compatible with GHC 9.10, and crashes in subtle ways. + -- See https://github.com/haskell/haskell-language-server/issues/4674 + -- for its wake of destruction. + if !flag(hlint) || impl(ghc ==9.10.*) buildable: False exposed-modules: Ide.Plugin.Hlint hs-source-dirs: plugins/hls-hlint-plugin/src @@ -763,7 +768,10 @@ library hls-hlint-plugin test-suite hls-hlint-plugin-tests import: defaults, pedantic, test-defaults, warnings - if !flag(hlint) + -- Hlint isn't compatible with GHC 9.10, and crashes in subtle ways. + -- See https://github.com/haskell/haskell-language-server/issues/4674 + -- for its wake of destruction. + if !flag(hlint) || impl(ghc ==9.10.*) buildable: False type: exitcode-stdio-1.0 hs-source-dirs: plugins/hls-hlint-plugin/test diff --git a/test/testdata/schema/ghc910/default-config.golden.json b/test/testdata/schema/ghc910/default-config.golden.json index 81b63dc6e4..efc5309a4d 100644 --- a/test/testdata/schema/ghc910/default-config.golden.json +++ b/test/testdata/schema/ghc910/default-config.golden.json @@ -91,13 +91,6 @@ }, "globalOn": true }, - "hlint": { - "codeActionsOn": true, - "config": { - "flags": [] - }, - "diagnosticsOn": true - }, "importLens": { "codeActionsOn": true, "codeLensOn": true, diff --git a/test/testdata/schema/ghc910/markdown-reference.md b/test/testdata/schema/ghc910/markdown-reference.md index 668323ce66..af81ddaf3b 100644 --- a/test/testdata/schema/ghc910/markdown-reference.md +++ b/test/testdata/schema/ghc910/markdown-reference.md @@ -1,8 +1,3 @@ -## hlint -| Property | Description | Default | Allowed values | -| --- | --- | --- | --- | -| `flags` | Flags used by hlint | `TODO: Array values` |   | - ## cabal-fmt | Property | Description | Default | Allowed values | | --- | --- | --- | --- | diff --git a/test/testdata/schema/ghc910/vscode-extension-schema.golden.json b/test/testdata/schema/ghc910/vscode-extension-schema.golden.json index ba79ee22c7..a78cb9e147 100644 --- a/test/testdata/schema/ghc910/vscode-extension-schema.golden.json +++ b/test/testdata/schema/ghc910/vscode-extension-schema.golden.json @@ -213,24 +213,6 @@ "scope": "resource", "type": "boolean" }, - "haskell.plugin.hlint.codeActionsOn": { - "default": true, - "description": "Enables hlint code actions", - "scope": "resource", - "type": "boolean" - }, - "haskell.plugin.hlint.config.flags": { - "default": [], - "markdownDescription": "Flags used by hlint", - "scope": "resource", - "type": "array" - }, - "haskell.plugin.hlint.diagnosticsOn": { - "default": true, - "description": "Enables hlint diagnostics", - "scope": "resource", - "type": "boolean" - }, "haskell.plugin.importLens.codeActionsOn": { "default": true, "description": "Enables importLens code actions",