Skip to content

Commit 1c89ec4

Browse files
Remove some obsolete hackage-quirks (#1813)
* Remove some obsolete hackage-quirks The `stlylish-haskell` plugin is updated and there was a `retrie` release. * hls 1.8 workarounds that still seem to be needed. * Use hls 1.9 on GHC 9.0 and 9.2 Co-authored-by: Hamish Mackenzie <Hamish.K.Mackenzie@gmail.com>
1 parent e83ef3d commit 1c89ec4

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

build.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ in rec {
4444
hls-latest = tool compiler-nix-name "haskell-language-server" {
4545
inherit evalPackages;
4646
version =
47-
if __compareVersions haskell.compiler.${compiler-nix-name}.version "9.4" < 0
47+
if __compareVersions haskell.compiler.${compiler-nix-name}.version "9.0" < 0
4848
then "1.8.0.0"
4949
else "latest";
5050
};

modules/hackage-quirks.nix

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,34 +41,31 @@ in [
4141
}
4242
)
4343

44-
# TODO remove this when `dependent-sum-0.7.1.0` constraint on `some` has been updated.
45-
# See https://github.com/haskell/haskell-language-server/issues/2969
46-
# and https://github.com/obsidiansystems/dependent-sum/issues/71
4744
({config, lib, pkgs, ...}:
4845
{ _file = "haskell.nix/overlays/hackage-quirks.nix#haskell-language-server"; } //
4946
lib.mkIf (config.name == "haskell-language-server") {
47+
# TODO remove this when `dependent-sum-0.7.1.0` constraint on `some` has been updated.
48+
# See https://github.com/haskell/haskell-language-server/issues/2969
49+
# and https://github.com/obsidiansystems/dependent-sum/issues/71
5050
cabalProject = lib.mkDefault (''
5151
packages: .
5252
constraints: dependent-sum >=0.7.1.0
5353
''
54-
# TODO remove once these two plugins have been updated in hackage
54+
# TODO remove once these the plugins have been updated in hackage
5555
+ lib.optionalString (config.version == "1.8.0.0") ''
5656
package haskell-language-server
57-
flags: -qualifyimportednames -stylishhaskell${lib.optionalString (config.compiler-nix-name != "ghc902") " -hlint"}
57+
flags: -qualifyimportednames${
58+
# Stylish haskell is broken for GHC 9.2
59+
lib.optionalString (__elem config.compiler-nix-name ["ghc921" "ghc922" "ghc923" "ghc924" "ghc925"]) " -stylishhaskell"
60+
# Hlint with this HLS only compiles for GHC 9.0
61+
+ lib.optionalString (!__elem config.compiler-nix-name ["ghc901" "ghc902"]) " -hlint"
62+
}
5863
constraints: hls-fourmolu-plugin <1.1.1.0, hls-rename-plugin <1.0.2.0, hls-stan-plugin <1.0.1.0
5964
''
60-
+ lib.optionalString (config.version == "1.9.0.0") ''
61-
allow-newer: hls-call-hierarchy-plugin:ghcide, hls-call-hierarchy-plugin:hls-plugin-api
62-
''
6365
# TODO Remove this flag once the hls-haddock-comments-plugin is updated in hackage to work with ghc 9.2
6466
+ lib.optionalString (__elem config.compiler-nix-name ["ghc921" "ghc922" "ghc923" "ghc924" "ghc925"]) ''
6567
package haskell-language-server
6668
flags: -haddockcomments
67-
''
68-
# Exclude `retrie` that does not actually work with older versions of GHC.
69-
# TODO Remove this once https://github.com/facebookincubator/retrie/pull/51 is fixed somehow
70-
+ lib.optionalString (__elem config.compiler-nix-name ["ghc865" "ghc884" "ghc8105" "ghc8106" "ghc8107" "ghc901" "ghc902"]) ''
71-
constraints: retrie <1.2.1
7269
'');
7370
}
7471
)

test/haskell-language-server/cabal.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
let
33
inherit (haskell-nix.tool compiler-nix-name "haskell-language-server" {
44
version =
5-
if __compareVersions haskell-nix.compiler.${compiler-nix-name}.version "9.4" < 0
5+
if __compareVersions haskell-nix.compiler.${compiler-nix-name}.version "9.0" < 0
66
then "1.8.0.0"
77
else "latest";
88
inherit evalPackages; }) project;

0 commit comments

Comments
 (0)