Skip to content

Commit

Permalink
perform unsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
soulomoon committed Aug 19, 2024
1 parent 6f6f75b commit ac76ca9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ghcide/src/Development/IDE/Core/OfInterest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ deleteFileOfInterest state f = do
scheduleGarbageCollection :: IdeState -> IO ()
scheduleGarbageCollection state = do
GarbageCollectVar var <- getIdeGlobalState state
writeVar var True
writeVar var False

-- | Typecheck all the files of interest.
-- Could be improved
Expand Down
3 changes: 2 additions & 1 deletion ghcide/src/Development/IDE/LSP/LanguageServer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import Development.IDE.Core.WorkerThread (withWorkerQueue)
import qualified Development.IDE.Session as Session
import Development.IDE.Types.Shake (WithHieDb,
WithHieDbShield (..))
import GHC.IO (unsafeInterleaveIO)
import Ide.Logger
import Language.LSP.Server (LanguageContextEnv,
LspServerLog,
Expand Down Expand Up @@ -249,7 +250,7 @@ handleInit recorder defaultRoot getHieDbLoc getIdeState lifetime exitClientMsg c
ReactorRequest _id act k -> void $ async $ checkCancelled _id act k
logWith recorder Info LogReactorThreadStopped

(WithHieDbShield withHieDb, threadQueue) <- takeMVar dbMVar
(WithHieDbShield withHieDb, threadQueue) <- unsafeInterleaveIO $ takeMVar dbMVar
ide <- getIdeState env root withHieDb threadQueue
registerIdeConfiguration (shakeExtras ide) initConfig
pure $ Right (env,ide)
Expand Down

0 comments on commit ac76ca9

Please sign in to comment.