File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -50,9 +50,8 @@ main = withTelemetryLogger $ \telemetryLogger -> do
5050 if argsVersion then ghcideVersion >>= putStrLn >> exitSuccess
5151 else hPutStrLn stderr {- see WARNING above -} =<< ghcideVersion
5252
53- -- getHieDbLoc takes a directory path (the project root) and hashes it to find the location of the hiedb
54- -- when running commands directly from GHCIDE we need to provide the ABSOLUTE path to the project root (that's what HLS uses)
55- argsCwd <- case argsCwd of
53+ -- if user uses --cwd option we need to make this path absolute (and set the current directory to it)
54+ argsCwd <- case argsCwd of
5655 Nothing -> IO. getCurrentDirectory
5756 Just root -> IO. setCurrentDirectory root >> IO. getCurrentDirectory
5857
Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ defaultMain Arguments{..} = flip withHeapStats fun =<< argsLogger
319319 hieChan
320320 dumpSTMStats
321321 Check argFiles -> do
322- dir <- IO. getCurrentDirectory
322+ dir <- maybe IO. getCurrentDirectory return argsProjectRoot
323323 dbLoc <- getHieDbLoc dir
324324 runWithDb logger dbLoc $ \ hiedb hieChan -> do
325325 -- GHC produces messages with UTF8 in them, so make sure the terminal doesn't error
You can’t perform that action at this time.
0 commit comments