@@ -48,7 +48,7 @@ codeAction
4848 -> TextDocumentIdentifier
4949 -> Range
5050 -> CodeActionContext
51− -> IO [CAResult]
51+ -> IO (Either ResponseError [CAResult])
5252codeAction lsp state (TextDocumentIdentifier uri) _range CodeActionContext{_diagnostics=List xs} = do
5353 -- disable logging as its quite verbose
5454 -- logInfo (ideLogger ide) $ T.pack $ "Code action req: " ++ show arg
@@ -57,7 +57,7 @@ codeAction lsp state (TextDocumentIdentifier uri) _range CodeActionContext{_diag
5757 (ideOptions, parsedModule) <- runAction state $
5858 (,) <$> getIdeOptions
5959 <*> (getParsedModule . toNormalizedFilePath) `traverse` uriToFilePath uri
60− pure
60+ pure $ Right
6161 [ CACodeAction $ CodeAction title (Just CodeActionQuickFix) (Just $ List [x]) (Just edit) Nothing
6262 | x <- xs, (title, tedit) <- suggestAction ideOptions ( join parsedModule ) text x
6363 , let edit = WorkspaceEdit (Just $ Map.singleton uri $ List tedit) Nothing
@@ -68,21 +68,21 @@ codeLens
6868 :: LSP.LspFuncs ()
6969 -> IdeState
7070 -> CodeLensParams
71− -> IO (List CodeLens)
71+ -> IO (Either ResponseError (List CodeLens))
7272codeLens _lsp ideState CodeLensParams{_textDocument=TextDocumentIdentifier uri} = do
73− case uriToFilePath' uri of
73+ fmap (Right . List) $ case uriToFilePath' uri of
7474 Just (toNormalizedFilePath -> filePath) -> do
7575 _ <- runAction ideState $ runMaybeT $ useE TypeCheck filePath
7676 diag <- getDiagnostics ideState
7777 hDiag <- getHiddenDiagnostics ideState
78− pure $ List
78+ pure
7979 [ CodeLens _range (Just (Command title "typesignature.add" (Just $ List [toJSON edit]))) Nothing
8080 | (dFile, _, dDiag@Diagnostic{_range=_range@Range{..},..}) <- diag ++ hDiag
8181 , dFile == filePath
8282 , (title, tedit) <- suggestSignature False dDiag
8383 , let edit = WorkspaceEdit (Just $ Map.singleton uri $ List tedit) Nothing
8484 ]
85− Nothing -> pure $ List []
85+ Nothing -> pure []
8686
8787-- | Execute the "typesignature.add" command.
8888executeAddSignatureCommand
@@ -93,7 +93,7 @@ executeAddSignatureCommand
9393executeAddSignatureCommand _lsp _ideState ExecuteCommandParams{..}
9494 | _command == "typesignature.add"
9595 , Just (List [edit]) <- _arguments
96− , Success wedit <- fromJSON edit
96+ , Success wedit <- fromJSON edit
9797 = return (Null, Just (WorkspaceApplyEdit, ApplyWorkspaceEditParams wedit))
9898 | otherwise
9999 = return (Null, Nothing)