From 3fc8bf9f37487afa66ce19a2bd7cd393f8831806 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 25 Mar 2024 19:34:42 +0800 Subject: [PATCH 1/2] remove priority --- ghcide/src/Development/IDE/Core/Shake.hs | 5 ----- hls-graph/src/Development/IDE/Graph.hs | 2 -- hls-graph/src/Development/IDE/Graph/Internal/Action.hs | 5 ----- 3 files changed, 12 deletions(-) diff --git a/ghcide/src/Development/IDE/Core/Shake.hs b/ghcide/src/Development/IDE/Core/Shake.hs index 2791dcfc2d..51e191e25b 100644 --- a/ghcide/src/Development/IDE/Core/Shake.hs +++ b/ghcide/src/Development/IDE/Core/Shake.hs @@ -1307,11 +1307,6 @@ updateFileDiagnostics recorder fp ver k ShakeExtras{diagnostics, hiddenDiagnosti | otherwise = c -newtype Priority = Priority Double - -setPriority :: Priority -> Action () -setPriority (Priority p) = reschedule p - ideLogger :: IdeState -> Logger ideLogger IdeState{shakeExtras=ShakeExtras{logger}} = logger diff --git a/hls-graph/src/Development/IDE/Graph.hs b/hls-graph/src/Development/IDE/Graph.hs index e787fa024b..81ad3b3dfd 100644 --- a/hls-graph/src/Development/IDE/Graph.hs +++ b/hls-graph/src/Development/IDE/Graph.hs @@ -15,8 +15,6 @@ module Development.IDE.Graph( ShakeValue, RuleResult, -- * Special rules alwaysRerun, - -- * Batching - reschedule, -- * Actions for inspecting the keys in the database getDirtySet, getKeysAndVisitedAge, diff --git a/hls-graph/src/Development/IDE/Graph/Internal/Action.hs b/hls-graph/src/Development/IDE/Graph/Internal/Action.hs index 6c26e9c024..6d47d9b511 100644 --- a/hls-graph/src/Development/IDE/Graph/Internal/Action.hs +++ b/hls-graph/src/Development/IDE/Graph/Internal/Action.hs @@ -11,7 +11,6 @@ module Development.IDE.Graph.Internal.Action , apply , applyWithoutDependency , parallel -, reschedule , runActions , Development.IDE.Graph.Internal.Action.getDirtySet , getKeysAndVisitedAge @@ -41,10 +40,6 @@ alwaysRerun = do ref <- Action $ asks actionDeps liftIO $ modifyIORef' ref (AlwaysRerunDeps mempty <>) --- No-op for now -reschedule :: Double -> Action () -reschedule _ = pure () - parallel :: [Action a] -> Action [a] parallel [] = pure [] parallel [x] = fmap (:[]) x From 693f2a13fdc9319ed4f85d1ac7e2c45548888a29 Mon Sep 17 00:00:00 2001 From: Patrick Date: Mon, 25 Mar 2024 19:43:48 +0800 Subject: [PATCH 2/2] remove priority --- ghcide/src/Development/IDE/Core/Rules.hs | 16 +--------------- ghcide/src/Development/IDE/Core/Shake.hs | 2 -- 2 files changed, 1 insertion(+), 17 deletions(-) diff --git a/ghcide/src/Development/IDE/Core/Rules.hs b/ghcide/src/Development/IDE/Core/Rules.hs index 0f4430e6af..6242ccff50 100644 --- a/ghcide/src/Development/IDE/Core/Rules.hs +++ b/ghcide/src/Development/IDE/Core/Rules.hs @@ -11,11 +11,8 @@ module Development.IDE.Core.Rules( -- * Types IdeState, GetParsedModule(..), TransitiveDependencies(..), - Priority(..), GhcSessionIO(..), GetClientSettings(..), + GhcSessionIO(..), GetClientSettings(..), -- * Functions - priorityTypeCheck, - priorityGenerateCore, - priorityFilesOfInterest, runAction, toIdeResult, defineNoFile, @@ -250,15 +247,6 @@ getParsedModuleWithComments = use GetParsedModuleWithComments -- Rules -- These typically go from key to value and are oracles. -priorityTypeCheck :: Priority -priorityTypeCheck = Priority 0 - -priorityGenerateCore :: Priority -priorityGenerateCore = Priority (-1) - -priorityFilesOfInterest :: Priority -priorityFilesOfInterest = Priority (-2) - -- | WARNING: -- We currently parse the module both with and without Opt_Haddock, and -- return the one with Haddocks if it -- succeeds. However, this may not work @@ -682,7 +670,6 @@ typeCheckRuleDefinition -> ParsedModule -> Action (IdeResult TcModuleResult) typeCheckRuleDefinition hsc pm = do - setPriority priorityTypeCheck IdeOptions { optDefer = defer } <- getIdeOptions unlift <- askUnliftIO @@ -936,7 +923,6 @@ generateCore :: RunSimplifier -> NormalizedFilePath -> Action (IdeResult ModGuts generateCore runSimplifier file = do packageState <- hscEnv <$> use_ GhcSessionDeps file tm <- use_ TypeCheck file - setPriority priorityGenerateCore liftIO $ compileModule runSimplifier packageState (tmrModSummary tm) (tmrTypechecked tm) generateCoreRule :: Recorder (WithPriority Log) -> Rules () diff --git a/ghcide/src/Development/IDE/Core/Shake.hs b/ghcide/src/Development/IDE/Core/Shake.hs index 51e191e25b..5d5eb511d2 100644 --- a/ghcide/src/Development/IDE/Core/Shake.hs +++ b/ghcide/src/Development/IDE/Core/Shake.hs @@ -51,12 +51,10 @@ module Development.IDE.Core.Shake( HLS.getClientConfig, getPluginConfigAction, knownTargets, - setPriority, ideLogger, actionLogger, getVirtualFile, FileVersion(..), - Priority(..), updatePositionMapping, updatePositionMappingHelper, deleteValue, recordDirtyKeys,