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 3 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
1 change: 0 additions & 1 deletion ghcide/ghcide.cabal
Expand Up @@ -117,7 +117,6 @@ library
unix

default-extensions:
ApplicativeDo
BangPatterns
DeriveFunctor
DeriveGeneric
Expand Down
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
1 change: 0 additions & 1 deletion ghcide/src/Development/IDE/Core/Actions.hs
@@ -1,4 +1,3 @@
{-# LANGUAGE NoApplicativeDo #-}
{-# LANGUAGE TypeFamilies #-}
module Development.IDE.Core.Actions
( getAtPoint
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
2 changes: 1 addition & 1 deletion ghcide/src/Development/IDE/Core/Shake.hs
Expand Up @@ -526,7 +526,7 @@ shakeOpen lspEnv defaultConfig logger debouncer
_ <- async $ do
logDebug logger "Initializing exports map from hiedb"
em <- createExportsMapHieDb hiedb
modifyVar' exportsMap (<> em)
_ <- modifyVar' exportsMap (<> em)
logDebug logger $ "Done initializing exports map from hiedb (" <> pack(show (ExportsMap.size em)) <> ")"

progress <- do
Expand Down
1 change: 0 additions & 1 deletion ghcide/src/Development/IDE/Core/Tracing.hs
@@ -1,5 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE NoApplicativeDo #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE PatternSynonyms #-}
{-# HLINT ignore #-}
Expand Down