From 3e688d99218889cc17aaf43337ad9902aed321f5 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sun, 18 Apr 2021 20:09:34 +0100 Subject: [PATCH] avoid modifying the current directory (#326) --- lsp/src/Language/LSP/Server/Processing.hs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lsp/src/Language/LSP/Server/Processing.hs b/lsp/src/Language/LSP/Server/Processing.hs index 164f57e3a..bbddbd81d 100644 --- a/lsp/src/Language/LSP/Server/Processing.hs +++ b/lsp/src/Language/LSP/Server/Processing.hs @@ -87,12 +87,6 @@ initializeRequestHandler ServerDefinition{..} vfs sendFunc req = do rootDir = getFirst $ foldMap First [ params ^. LSP.rootUri >>= uriToFilePath , params ^. LSP.rootPath <&> T.unpack ] - liftIO $ case rootDir of - Nothing -> return () - Just dir -> do - debugM "lsp.initializeRequestHandler" $ "Setting current dir to project root:" ++ dir - unless (null dir) $ setCurrentDirectory dir - let initialWfs = case params ^. LSP.workspaceFolders of Just (List xs) -> xs Nothing -> [] @@ -128,7 +122,7 @@ initializeRequestHandler ServerDefinition{..} vfs sendFunc req = do where makeResponseMessage rid result = ResponseMessage "2.0" (Just rid) (Right result) makeResponseError origId err = ResponseMessage "2.0" (Just origId) (Left err) - + initializeErrorHandler :: (ResponseError -> IO ()) -> E.SomeException -> IO (Maybe a) initializeErrorHandler sendResp e = do sendResp $ ResponseError InternalError msg Nothing