diff --git a/ghcide/src/Development/IDE/Core/Compile.hs b/ghcide/src/Development/IDE/Core/Compile.hs index ee59909ef5..cbfcb5c087 100644 --- a/ghcide/src/Development/IDE/Core/Compile.hs +++ b/ghcide/src/Development/IDE/Core/Compile.hs @@ -986,7 +986,7 @@ loadModulesHome -> HscEnv loadModulesHome mod_infos e = #if MIN_VERSION_ghc(9,3,0) - hscUpdateHUG (\hug -> foldr addHomeModInfoToHug hug mod_infos) (e { hsc_type_env_vars = emptyKnotVars }) + hscUpdateHUG (\hug -> foldl' (flip addHomeModInfoToHug) hug mod_infos) (e { hsc_type_env_vars = emptyKnotVars }) #else let !new_modules = addListToHpt (hsc_HPT e) [(mod_name x, x) | x <- mod_infos] in e { hsc_HPT = new_modules @@ -1454,18 +1454,6 @@ loadInterface session ms linkableNeeded RecompilationInfo{..} = do case (mb_checked_iface, recomp_iface_reqd) of (Just iface, UpToDate) -> do - -- If we have an old value, just return it - case old_value of - Just (old_hir, _) - | isNothing linkableNeeded || isJust (hirCoreFp old_hir) - -> do - -- Perform the fine grained recompilation check for TH - maybe_recomp <- checkLinkableDependencies get_linkable_hashes (hsc_mod_graph sessionWithMsDynFlags) (hirRuntimeModules old_hir) - case maybe_recomp of - Just msg -> do_regenerate msg - Nothing -> return ([], Just old_hir) - -- Otherwise use the value from disk, provided the core file is up to date if required - _ -> do details <- liftIO $ mkDetailsFromIface sessionWithMsDynFlags iface -- parse the runtime dependencies from the annotations let runtime_deps @@ -1552,7 +1540,7 @@ showReason (RecompBecause s) = s mkDetailsFromIface :: HscEnv -> ModIface -> IO ModDetails mkDetailsFromIface session iface = do fixIO $ \details -> do - let hsc' = hscUpdateHPT (\hpt -> addToHpt hpt (moduleName $ mi_module iface) (HomeModInfo iface details Nothing)) session + let !hsc' = hscUpdateHPT (\hpt -> addToHpt hpt (moduleName $ mi_module iface) (HomeModInfo iface details Nothing)) session initIfaceLoad hsc' (typecheckIface iface) coreFileToCgGuts :: HscEnv -> ModIface -> ModDetails -> CoreFile -> IO CgGuts diff --git a/ghcide/src/Development/IDE/GHC/Compat.hs b/ghcide/src/Development/IDE/GHC/Compat.hs index 5983936fdd..83195acd2a 100644 --- a/ghcide/src/Development/IDE/GHC/Compat.hs +++ b/ghcide/src/Development/IDE/GHC/Compat.hs @@ -503,7 +503,7 @@ getModuleHash = mi_mod_hash . mi_final_exts disableWarningsAsErrors :: DynFlags -> DynFlags disableWarningsAsErrors df = - flip gopt_unset Opt_WarnIsError $ foldl' wopt_unset_fatal df [toEnum 0 ..] + flip gopt_unset Opt_WarnIsError $! foldl' wopt_unset_fatal df [toEnum 0 ..] isQualifiedImport :: ImportDecl a -> Bool isQualifiedImport ImportDecl{ideclQualified = NotQualified} = False diff --git a/ghcide/src/Development/IDE/Types/Action.hs b/ghcide/src/Development/IDE/Types/Action.hs index 4507f39825..462bdc901b 100644 --- a/ghcide/src/Development/IDE/Types/Action.hs +++ b/ghcide/src/Development/IDE/Types/Action.hs @@ -69,13 +69,13 @@ abortQueue :: DelayedActionInternal -> ActionQueue -> STM () abortQueue x ActionQueue {..} = do qq <- flushTQueue newActions mapM_ (writeTQueue newActions) (filter (/= x) qq) - modifyTVar inProgress (Set.delete x) + modifyTVar' inProgress (Set.delete x) -- | Mark an action as complete when called after 'popQueue'. -- Has no effect otherwise doneQueue :: DelayedActionInternal -> ActionQueue -> STM () doneQueue x ActionQueue {..} = do - modifyTVar inProgress (Set.delete x) + modifyTVar' inProgress (Set.delete x) countQueue :: ActionQueue -> STM Natural countQueue ActionQueue{..} = do diff --git a/plugins/hls-class-plugin/src/Ide/Plugin/Class/Types.hs b/plugins/hls-class-plugin/src/Ide/Plugin/Class/Types.hs index 95579a7cdc..8530b0f18f 100644 --- a/plugins/hls-class-plugin/src/Ide/Plugin/Class/Types.hs +++ b/plugins/hls-class-plugin/src/Ide/Plugin/Class/Types.hs @@ -4,6 +4,7 @@ {-# LANGUAGE LambdaCase #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ViewPatterns #-} +{-# LANGUAGE BangPatterns #-} module Ide.Plugin.Class.Types where @@ -45,7 +46,7 @@ data GetInstanceBindTypeSigs = GetInstanceBindTypeSigs data InstanceBindTypeSig = InstanceBindTypeSig { bindName :: Name - , bindRendered :: T.Text + , bindRendered :: !T.Text , bindDefSpan :: Maybe SrcSpan -- ^SrcSpan for the bind definition }