projects
/
lsp-test.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update tests for lsp-1.0.0.0
[lsp-test.git]
/
src
/
Language
/
Haskell
/
LSP
/
Test.hs
diff --git
a/src/Language/Haskell/LSP/Test.hs
b/src/Language/Haskell/LSP/Test.hs
index 430ac5b9153df91469590b6f772b14b2aaf6ccc9..1ed07d5e06211ed583251cd066271385d2310565 100644
(file)
--- a/
src/Language/Haskell/LSP/Test.hs
+++ b/
src/Language/Haskell/LSP/Test.hs
@@
-496,8
+496,8
@@
getDocumentSymbols :: TextDocumentIdentifier -> Session (Either [DocumentSymbol]
getDocumentSymbols doc = do
ResponseMessage _ rspLid res <- request STextDocumentDocumentSymbol (DocumentSymbolParams Nothing Nothing doc) :: Session DocumentSymbolsResponse
case res of
getDocumentSymbols doc = do
ResponseMessage _ rspLid res <- request STextDocumentDocumentSymbol (DocumentSymbolParams Nothing Nothing doc) :: Session DocumentSymbolsResponse
case res of
- Right (L (List xs)) -> return (Left xs)
- Right (R (List xs)) -> return (Right xs)
+ Right (
In
L (List xs)) -> return (Left xs)
+ Right (
In
R (List xs)) -> return (Right xs)
Left err -> throw (UnexpectedResponseError (SomeLspId $ fromJust rspLid) err)
-- | Returns the code actions in the specified range.
Left err -> throw (UnexpectedResponseError (SomeLspId $ fromJust rspLid) err)
-- | Returns the code actions in the specified range.
@@
-543,7
+543,7
@@
executeCommand :: Command -> Session ()
executeCommand cmd = do
let args = decode $ encode $ fromJust $ cmd ^. arguments
execParams = ExecuteCommandParams Nothing (cmd ^. command) args
executeCommand cmd = do
let args = decode $ encode $ fromJust $ cmd ^. arguments
execParams = ExecuteCommandParams Nothing (cmd ^. command) args
-
request_
SWorkspaceExecuteCommand execParams
+
void $ sendRequest
SWorkspaceExecuteCommand execParams
-- | Executes a code action.
-- Matching with the specification, if a code action
-- | Executes a code action.
-- Matching with the specification, if a code action
@@
-604,8
+604,8
@@
getCompletions doc pos = do
rsp <- request STextDocumentCompletion (CompletionParams doc pos Nothing Nothing Nothing)
case getResponseResult rsp of
rsp <- request STextDocumentCompletion (CompletionParams doc pos Nothing Nothing Nothing)
case getResponseResult rsp of
- L (List items) -> return items
- R (CompletionList _ (List items)) -> return items
+
In
L (List items) -> return items
+
In
R (CompletionList _ (List items)) -> return items
-- | Returns the references for the position in the document.
getReferences :: TextDocumentIdentifier -- ^ The document to lookup in.
-- | Returns the references for the position in the document.
getReferences :: TextDocumentIdentifier -- ^ The document to lookup in.
@@
-656,9
+656,9
@@
getDeclarationyRequest method paramCons doc pos = do
let params = paramCons doc pos Nothing Nothing
rsp <- request method params
case getResponseResult rsp of
let params = paramCons doc pos Nothing Nothing
rsp <- request method params
case getResponseResult rsp of
-
L loc -> pure (
L [loc])
-
R (L (List locs)) -> pure (
L locs)
-
R (R (List locLinks)) -> pure (
R locLinks)
+
InL loc -> pure (In
L [loc])
+
InR (InL (List locs)) -> pure (In
L locs)
+
InR (InR (List locLinks)) -> pure (In
R locLinks)
-- | Renames the term at the specified position.
rename :: TextDocumentIdentifier -> Position -> String -> Session ()
-- | Renames the term at the specified position.
rename :: TextDocumentIdentifier -> Position -> String -> Session ()
@@
-670,7
+670,7
@@
rename doc pos newName = do
updateState (FromServerMess SWorkspaceApplyEdit req)
-- | Returns the hover information at the specified position.
updateState (FromServerMess SWorkspaceApplyEdit req)
-- | Returns the hover information at the specified position.
-getHover :: TextDocumentIdentifier -> Position -> Session
Hover
+getHover :: TextDocumentIdentifier -> Position -> Session
(Maybe Hover)
getHover doc pos =
let params = HoverParams doc pos Nothing
in getResponseResult <$> request STextDocumentHover params
getHover doc pos =
let params = HoverParams doc pos Nothing
in getResponseResult <$> request STextDocumentHover params