File tree 1 file changed +4
-2
lines changed
ghcide/src/Development/IDE/LSP
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -197,7 +197,9 @@ handleInit
197
197
-> LSP. LanguageContextEnv config -> TRequestMessage Method_Initialize -> IO (Either err (LSP. LanguageContextEnv config , IdeState ))
198
198
handleInit rootDir recorder getHieDbLoc getIdeState lifetime exitClientMsg clearReqId waitForCancel clientMsgChan env (TRequestMessage _ _ m params) = otTracedHandler " Initialize" (show m) $ \ sp -> do
199
199
traceWithSpan sp params
200
- dbLoc <- getHieDbLoc rootDir
200
+ let rootMaybe = LSP. resRootPath env
201
+ let root = fromMaybe rootDir rootMaybe
202
+ dbLoc <- getHieDbLoc root
201
203
let initConfig = parseConfiguration params
202
204
logWith recorder Info $ LogRegisteringIdeConfig initConfig
203
205
dbMVar <- newEmptyMVar
@@ -240,7 +242,7 @@ handleInit rootDir recorder getHieDbLoc getIdeState lifetime exitClientMsg clear
240
242
logWith recorder Info LogReactorThreadStopped
241
243
242
244
(WithHieDbShield withHieDb,hieChan) <- takeMVar dbMVar
243
- ide <- getIdeState env rootDir withHieDb hieChan
245
+ ide <- getIdeState env root withHieDb hieChan
244
246
registerIdeConfiguration (shakeExtras ide) initConfig
245
247
pure $ Right (env,ide)
246
248
You can’t perform that action at this time.
0 commit comments