Skip to content

Commit 61b4808

Browse files
committed
remove unsafeInterleaveIO
1 parent 7dc82ce commit 61b4808

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

ghcide/src/Development/IDE/LSP/LanguageServer.hs

+5-8
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,6 @@ handleInit recorder getHieDbLoc getIdeState lifetime exitClientMsg clearReqId wa
202202
-- The database needs to be open for the duration of the reactor thread, but we need to pass in a reference
203203
-- to 'getIdeState', so we use this dirty trick
204204
dbMVar <- newEmptyMVar
205-
~(WithHieDbShield withHieDb,hieChan) <- unsafeInterleaveIO $ takeMVar dbMVar
206-
207-
ide <- getIdeState env root withHieDb hieChan
208-
209-
let initConfig = parseConfiguration params
210-
211-
logWith recorder Info $ LogRegisteringIdeConfig initConfig
212-
registerIdeConfiguration (shakeExtras ide) initConfig
213205

214206
let handleServerException (Left e) = do
215207
logWith recorder Error $ LogReactorThreadException e
@@ -246,6 +238,11 @@ handleInit recorder getHieDbLoc getIdeState lifetime exitClientMsg clearReqId wa
246238
ReactorNotification act -> handle exceptionInHandler act
247239
ReactorRequest _id act k -> void $ async $ checkCancelled _id act k
248240
logWith recorder Info LogReactorThreadStopped
241+
(WithHieDbShield withHieDb,hieChan) <- takeMVar dbMVar
242+
ide <- getIdeState env root withHieDb hieChan
243+
let initConfig = parseConfiguration params
244+
logWith recorder Info $ LogRegisteringIdeConfig initConfig
245+
registerIdeConfiguration (shakeExtras ide) initConfig
249246
pure $ Right (env,ide)
250247

251248

0 commit comments

Comments
 (0)