Skip to content

Commit 2aecda9

Browse files
joyfulmantisfendor
andauthored
Update to latest lsp packages (#3747)
Co-authored-by: fendor <[email protected]>
1 parent 6444903 commit 2aecda9

File tree

22 files changed

+66
-115
lines changed

22 files changed

+66
-115
lines changed

cabal.project

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

5656
write-ghc-environment-files: never
5757

58-
index-state: 2023-08-05T06:03:58Z
58+
index-state: 2023-08-06T10:37:15Z
5959

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

flake.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,15 @@
5151

5252
# not sure if this is the correct way to get lsp* packages in
5353
lsp = {
54-
url = "https://hackage.haskell.org/package/lsp-2.0.0.0/lsp-2.0.0.0.tar.gz";
54+
url = "https://hackage.haskell.org/package/lsp-2.1.0.0/lsp-2.1.0.0.tar.gz";
5555
flake = false;
5656
};
5757
lsp-types = {
58-
url = "https://hackage.haskell.org/package/lsp-types-2.0.0.1/lsp-types-2.0.0.1.tar.gz";
58+
url = "https://hackage.haskell.org/package/lsp-types-2.0.1.0/lsp-types-2.0.1.0.tar.gz";
5959
flake = false;
6060
};
6161
lsp-test = {
62-
url = "https://hackage.haskell.org/package/lsp-test-0.15.0.0/lsp-test-0.15.0.0.tar.gz";
62+
url = "https://hackage.haskell.org/package/lsp-test-0.15.0.1/lsp-test-0.15.0.1.tar.gz";
6363
flake = false;
6464
};
6565

ghcide-bench/ghcide-bench.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ test-suite test
119119
base,
120120
extra,
121121
ghcide-bench,
122-
lsp-test ^>= 0.15,
122+
lsp-test ^>= 0.15.0.1,
123123
tasty,
124124
tasty-hunit >= 0.10,
125125
tasty-rerun,

ghcide/ghcide.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ library
6969
lens,
7070
list-t,
7171
hiedb == 0.4.3.*,
72-
lsp-types ^>= 2.0.0.1,
73-
lsp ^>= 2.0.0.0 ,
72+
lsp-types ^>= 2.0.1.0,
73+
lsp ^>= 2.1.0.0 ,
7474
mtl,
7575
optparse-applicative,
7676
parallel,
@@ -346,7 +346,7 @@ test-suite ghcide-tests
346346
hls-plugin-api,
347347
lens,
348348
list-t,
349-
lsp-test ^>= 0.15,
349+
lsp-test ^>= 0.15.0.1,
350350
mtl,
351351
monoid-subclasses,
352352
network-uri,

ghcide/src/Development/IDE/LSP/LanguageServer.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ runLanguageServer recorder options inH outH defaultConfig onConfigurationChange
107107
{ LSP.onConfigurationChange = onConfigurationChange
108108
, LSP.defaultConfig = defaultConfig
109109
, LSP.doInitialize = doInitialize
110-
, LSP.staticHandlers = staticHandlers
110+
, LSP.staticHandlers = (const staticHandlers)
111111
, LSP.interpretHandler = interpretHandler
112112
, LSP.options = modifyOptions options
113113
}

ghcide/test/exe/CompletionTests.hs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,13 @@ completionTest :: HasCallStack => String -> [T.Text] -> Position -> [(T.Text, Co
4848
completionTest name src pos expected = testSessionWait name $ do
4949
docId <- createDoc "A.hs" "haskell" (T.unlines src)
5050
_ <- waitForDiagnostics
51-
compls <- getCompletions docId pos
51+
compls <- getAndResolveCompletions docId pos
5252
let compls' = [ (_label, _kind, _insertText, _additionalTextEdits) | CompletionItem{..} <- compls]
5353
let emptyToMaybe x = if T.null x then Nothing else Just x
5454
liftIO $ sortOn (Lens.view Lens._1) (take (length expected) compls') @?=
5555
sortOn (Lens.view Lens._1)
5656
[ (l, Just k, emptyToMaybe t, at) | (l,k,t,_,_,at) <- expected]
57-
forM_ (zip compls expected) $ \(item, (_,_,_,expectedSig, expectedDocs, _)) -> do
58-
CompletionItem{..} <-
59-
if (expectedSig || expectedDocs) && isJust (item ^. L.data_)
60-
then do
61-
rsp <- request SMethod_CompletionItemResolve item
62-
case rsp ^. L.result of
63-
Left err -> liftIO $ assertFailure ("completionItem/resolve failed with: " <> show err)
64-
Right x -> pure x
65-
else pure item
57+
forM_ (zip compls expected) $ \(CompletionItem{..}, (_,_,_,expectedSig, expectedDocs, _)) -> do
6658
when expectedSig $
6759
liftIO $ assertBool ("Missing type signature: " <> T.unpack _label) (isJust _detail)
6860
when expectedDocs $

ghcide/test/ghcide-test-utils.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ library
3535
lsp-types,
3636
hls-plugin-api,
3737
lens,
38-
lsp-test ^>= 0.15,
38+
lsp-test ^>= 0.15.0.1,
3939
tasty-hunit >= 0.10,
4040
text,
4141
row-types,

haskell-language-server.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ library
407407
, ghc
408408
, ghcide == 2.1.0.0
409409
, githash >=0.1.6.1
410-
, lsp >= 2.0.0.0
410+
, lsp >= 2.1.0.0
411411
, hie-bios
412412
, hiedb
413413
, hls-plugin-api == 2.1.0.0

hls-plugin-api/hls-plugin-api.cabal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ library
6262
, hls-graph == 2.1.0.0
6363
, lens
6464
, lens-aeson
65-
, lsp ^>=2.0.0.0
65+
, lsp ^>=2.1.0.0
6666
, mtl
6767
, opentelemetry >=0.4
6868
, optparse-applicative

hls-test-utils/hls-test-utils.cabal

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ library
4545
, hls-graph
4646
, hls-plugin-api == 2.1.0.0
4747
, lens
48-
, lsp ^>=2.0.0.0
49-
, lsp-test ^>=0.15
50-
, lsp-types ^>=2.0.0.1
48+
, lsp ^>=2.1.0.0
49+
, lsp-test ^>=0.15.0.1
50+
, lsp-types ^>=2.0.1.0
5151
, tasty
5252
, tasty-expected-failure
5353
, tasty-golden

0 commit comments

Comments
 (0)