File tree 2 files changed +3
-4
lines changed
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
50
50
if argsVersion then ghcideVersion >>= putStrLn >> exitSuccess
51
51
else hPutStrLn stderr {- see WARNING above -} =<< ghcideVersion
52
52
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
56
55
Nothing -> IO. getCurrentDirectory
57
56
Just root -> IO. setCurrentDirectory root >> IO. getCurrentDirectory
58
57
Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ defaultMain Arguments{..} = flip withHeapStats fun =<< argsLogger
319
319
hieChan
320
320
dumpSTMStats
321
321
Check argFiles -> do
322
- dir <- IO. getCurrentDirectory
322
+ dir <- maybe IO. getCurrentDirectory return argsProjectRoot
323
323
dbLoc <- getHieDbLoc dir
324
324
runWithDb logger dbLoc $ \ hiedb hieChan -> do
325
325
-- 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