Skip to content

Commit eddd1c4

Browse files
committed
hnls: specify version in one place noci
1 parent 0feab68 commit eddd1c4

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

languages/haskell/language-server-hls/hnls.nix

+8-7
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ let
2525
# };
2626

2727
ghcVersionToHnls = let
28+
version = "0.3.1.0";
2829
prebuilt = src: stdenv.mkDerivation {
2930
pname = "haskell-notebook-language-server";
30-
version = "0.3.0.0";
31+
inherit version;
3132

3233
inherit src;
3334

@@ -40,27 +41,27 @@ let
4041
in
4142
{
4243
"v810" = prebuilt (fetchzip {
43-
url = "https://github.com/codedownio/haskell-notebook-language-server/releases/download/v0.3.0.0/haskell-notebook-language-server-0.3.0.0-ghc8107-x86_64-linux.tar.gz";
44+
url = "https://github.com/codedownio/haskell-notebook-language-server/releases/download/v${version}/haskell-notebook-language-server-${version}-ghc8107-x86_64-linux.tar.gz";
4445
sha256 = "1ci6zgxd4wqr7y6cw1kyd7pl8ssqxx9wlkj4a3rm3jrpwbiigbqg";
4546
});
4647
"v90" = prebuilt (fetchzip {
47-
url = "https://github.com/codedownio/haskell-notebook-language-server/releases/download/v0.3.0.0/haskell-notebook-language-server-0.3.0.0-ghc902-x86_64-linux.tar.gz";
48+
url = "https://github.com/codedownio/haskell-notebook-language-server/releases/download/v${version}/haskell-notebook-language-server-${version}-ghc902-x86_64-linux.tar.gz";
4849
sha256 = "02pzx0zcfifngfah5dfw7k7wan3486gqcigd4a6xg2zfj794qsar";
4950
});
5051
"v92" = prebuilt (fetchzip {
51-
url = "https://github.com/codedownio/haskell-notebook-language-server/releases/download/v0.3.0.0/haskell-notebook-language-server-0.3.0.0-ghc928-x86_64-linux.tar.gz";
52+
url = "https://github.com/codedownio/haskell-notebook-language-server/releases/download/v${version}/haskell-notebook-language-server-${version}-ghc928-x86_64-linux.tar.gz";
5253
sha256 = "sha256-A3ZZqkrpypcn4UhhqCjtSLfNj9wemH58OSpiknrRl0Q=";
5354
});
5455
"v94" = prebuilt (fetchzip {
55-
url = "https://github.com/codedownio/haskell-notebook-language-server/releases/download/v0.3.0.0/haskell-notebook-language-server-0.3.0.0-ghc948-x86_64-linux.tar.gz";
56+
url = "https://github.com/codedownio/haskell-notebook-language-server/releases/download/v${version}/haskell-notebook-language-server-${version}-ghc948-x86_64-linux.tar.gz";
5657
sha256 = "sha256-Uj+V5HKA0QtRrc/jodMtmo+33TodX4LxuTwCRydAUME=";
5758
});
5859
"v96" = prebuilt (fetchzip {
59-
url = "https://github.com/codedownio/haskell-notebook-language-server/releases/download/v0.3.0.0/haskell-notebook-language-server-0.3.0.0-ghc964-x86_64-linux.tar.gz";
60+
url = "https://github.com/codedownio/haskell-notebook-language-server/releases/download/v${version}/haskell-notebook-language-server-${version}-ghc964-x86_64-linux.tar.gz";
6061
sha256 = "sha256-ITQNjAv03Mpaq99Hct1idkQzNITidcdtWbG1MSYbM7w=";
6162
});
6263
"v98" = prebuilt (fetchzip {
63-
url = "https://github.com/codedownio/haskell-notebook-language-server/releases/download/v0.3.0.0/haskell-notebook-language-server-0.3.0.0-ghc982-x86_64-linux.tar.gz";
64+
url = "https://github.com/codedownio/haskell-notebook-language-server/releases/download/v${version}/haskell-notebook-language-server-${version}-ghc982-x86_64-linux.tar.gz";
6465
sha256 = "sha256-jwJd8IQHIeAI5igX0eilu2e0mDyGn0qPhBf9qnTtbro=";
6566
});
6667
};

tests/app/Spec/Tests/Haskell/CodeActions.hs

+12-10
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,31 @@ module Spec.Tests.Haskell.CodeActions where
44
import Control.Lens
55
import Data.String.Interpolate
66
import Data.Text
7-
import Language.LSP.Test hiding (message)
8-
import Language.LSP.Protocol.Types
97
import Language.LSP.Protocol.Lens hiding (actions)
8+
import Language.LSP.Protocol.Types
9+
import Language.LSP.Test hiding (message)
1010
import Spec.Tests.Haskell.Common
1111
import Test.Sandwich as Sandwich
1212
import TestLib.LSP
13+
import UnliftIO.Timeout
1314

1415

1516
codeActionsTests :: (LspContext context m) => SpecFree context m ()
1617
codeActionsTests = describe "Code actions" $ do
1718
it "gets no code actions for putStrLn" $ doNotebookSession lsName codeActionsCode $ \filename -> do
1819
ident <- openDoc filename "haskell"
19-
actions <- getCodeActions ident (Range (Position 1 0) (Position 1 8))
20-
actions `shouldBe` []
20+
actions <- timeout 60_000_000 $ getCodeActions ident (Range (Position 1 0) (Position 1 8))
21+
actions `shouldBe` (Just [])
2122

2223
it "gets code actions for foo" $ doNotebookSession lsName codeActionsCode $ \filename -> do
2324
ident <- openDoc filename "haskell"
24-
actions <- getCodeActions ident (Range (Position 0 0) (Position 0 3))
25-
fmap getTitle actions `shouldBe` ["Unfold foo"
26-
, "Unfold foo in current file"
27-
, "Fold foo"
28-
, "Fold foo in current file"
29-
]
25+
actions <- timeout 60_000_000 $ getCodeActions ident (Range (Position 0 0) (Position 0 3))
26+
fmap (fmap getTitle) actions `shouldBe` (
27+
Just ["Unfold foo"
28+
, "Unfold foo in current file"
29+
, "Fold foo"
30+
, "Fold foo in current file"
31+
])
3032

3133
getTitle :: (HasTitle a Text, HasTitle b Text) => (a |? b) -> Text
3234
getTitle (InL x) = x ^. title

0 commit comments

Comments
 (0)