Skip to content

Commit 9953607

Browse files
committed
add doc
1 parent cb21b0a commit 9953607

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ghcide/src/Development/IDE/Main.hs

+4
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ defaultMain recorder Arguments{..} = withHeapStats (cmapWithPrio LogHeapStats re
314314
ioT <- offsetTime
315315
logWith recorder Info $ LogLspStart (pluginId <$> ipMap argsHlsPlugins)
316316

317+
-- Notice why we are using `ideStateVar`:
318+
-- 1. to pass the ide state to config update callback after the initialization
319+
-- 2. guard against the case when the server is still starting up and
320+
-- and after shutdown handler has been called(empty in this case).
317321
ideStateVar <- newEmptyMVar
318322
let getIdeState :: LSP.LanguageContextEnv Config -> Maybe FilePath -> WithHieDb -> IndexQueue -> IO IdeState
319323
getIdeState env rootPath withHieDb hieChan = do

0 commit comments

Comments
 (0)