Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Join nested IO actions of the form IO (IO ()) #2459

Merged
merged 4 commits into from Dec 10, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions ghcide/session-loader/Development/IDE/Session.hs
Expand Up @@ -245,9 +245,10 @@ loadSessionWithOptions SessionLoadingOptions{..} dir = do
return $ do
extras@ShakeExtras{logger, restartShakeSession, ideNc, knownTargetsVar, lspEnv
} <- getShakeExtras
let invalidateShakeCache = do
let invalidateShakeCache :: IO ()
invalidateShakeCache = do
void $ modifyVar' version succ
atomically $ recordDirtyKeys extras GhcSessionIO [emptyFilePath]
join $ atomically $ recordDirtyKeys extras GhcSessionIO [emptyFilePath]

IdeOptions{ optTesting = IdeTesting optTesting
, optCheckProject = getCheckProject
Expand All @@ -264,7 +265,7 @@ loadSessionWithOptions SessionLoadingOptions{..} dir = do
TargetModule _ -> do
found <- filterM (IO.doesFileExist . fromNormalizedFilePath) targetLocations
return (targetTarget, found)
atomically $ recordDirtyKeys extras GetKnownTargets [emptyFilePath]
join $ atomically $ recordDirtyKeys extras GetKnownTargets [emptyFilePath]
modifyVarIO' knownTargetsVar $ traverseHashed $ \known -> do
let known' = HM.unionWith (<>) known $ HM.fromList $ map (second Set.fromList) knownTargets
when (known /= known') $
Expand Down
2 changes: 1 addition & 1 deletion ghcide/src/Development/IDE/Core/FileStore.hs
Expand Up @@ -263,7 +263,7 @@ setFileModified state saved nfp = do
VFSHandle{..} <- getIdeGlobalState state
when (isJust setVirtualFileContents) $
fail "setFileModified can't be called on this type of VFSHandle"
atomically $ recordDirtyKeys (shakeExtras state) GetModificationTime [nfp]
join $ atomically $ recordDirtyKeys (shakeExtras state) GetModificationTime [nfp]
restartShakeSession (shakeExtras state) (fromNormalizedFilePath nfp ++ " (modified)") []
when checkParents $
typecheckParents state nfp
Expand Down