+ case decode (head newMsgs) :: Maybe InitializeRequest of
+ -- If there is an initialize request we will need to swap
+ -- the rootUri and rootPath
+ Just req -> do
+ cd <- getCurrentDirectory
+ let newRoot = cd </> curBaseDir
+ newRootUri = params . rootUri .~ Just (filePathToUri newRoot) $ req
+ newRootPath = params . rootPath .~ Just (T.pack newRoot) $ newRootUri
+ newReq = encode newRootPath
+ return (newReq:(tail newMsgs), newMap)
+
+ Nothing -> return (newMsgs, newMap)