Skip to content

Commit 3e688d9

Browse files
authored
avoid modifying the current directory (#326)
1 parent 802d807 commit 3e688d9

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

lsp/src/Language/LSP/Server/Processing.hs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,6 @@ initializeRequestHandler ServerDefinition{..} vfs sendFunc req = do
8787
rootDir = getFirst $ foldMap First [ params ^. LSP.rootUri >>= uriToFilePath
8888
, params ^. LSP.rootPath <&> T.unpack ]
8989

90-
liftIO $ case rootDir of
91-
Nothing -> return ()
92-
Just dir -> do
93-
debugM "lsp.initializeRequestHandler" $ "Setting current dir to project root:" ++ dir
94-
unless (null dir) $ setCurrentDirectory dir
95-
9690
let initialWfs = case params ^. LSP.workspaceFolders of
9791
Just (List xs) -> xs
9892
Nothing -> []
@@ -128,7 +122,7 @@ initializeRequestHandler ServerDefinition{..} vfs sendFunc req = do
128122
where
129123
makeResponseMessage rid result = ResponseMessage "2.0" (Just rid) (Right result)
130124
makeResponseError origId err = ResponseMessage "2.0" (Just origId) (Left err)
131-
125+
132126
initializeErrorHandler :: (ResponseError -> IO ()) -> E.SomeException -> IO (Maybe a)
133127
initializeErrorHandler sendResp e = do
134128
sendResp $ ResponseError InternalError msg Nothing

0 commit comments

Comments
 (0)