Skip to content

Commit 3668683

Browse files
authored
Remove dead code in ghcide and hls-graph for priority (#4151)
1 parent e9ee544 commit 3668683

File tree

4 files changed

+1
-29
lines changed

4 files changed

+1
-29
lines changed

Diff for: ghcide/src/Development/IDE/Core/Rules.hs

+1-15
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@
1111
module Development.IDE.Core.Rules(
1212
-- * Types
1313
IdeState, GetParsedModule(..), TransitiveDependencies(..),
14-
Priority(..), GhcSessionIO(..), GetClientSettings(..),
14+
GhcSessionIO(..), GetClientSettings(..),
1515
-- * Functions
16-
priorityTypeCheck,
17-
priorityGenerateCore,
18-
priorityFilesOfInterest,
1916
runAction,
2017
toIdeResult,
2118
defineNoFile,
@@ -250,15 +247,6 @@ getParsedModuleWithComments = use GetParsedModuleWithComments
250247
-- Rules
251248
-- These typically go from key to value and are oracles.
252249

253-
priorityTypeCheck :: Priority
254-
priorityTypeCheck = Priority 0
255-
256-
priorityGenerateCore :: Priority
257-
priorityGenerateCore = Priority (-1)
258-
259-
priorityFilesOfInterest :: Priority
260-
priorityFilesOfInterest = Priority (-2)
261-
262250
-- | WARNING:
263251
-- We currently parse the module both with and without Opt_Haddock, and
264252
-- return the one with Haddocks if it -- succeeds. However, this may not work
@@ -682,7 +670,6 @@ typeCheckRuleDefinition
682670
-> ParsedModule
683671
-> Action (IdeResult TcModuleResult)
684672
typeCheckRuleDefinition hsc pm = do
685-
setPriority priorityTypeCheck
686673
IdeOptions { optDefer = defer } <- getIdeOptions
687674

688675
unlift <- askUnliftIO
@@ -936,7 +923,6 @@ generateCore :: RunSimplifier -> NormalizedFilePath -> Action (IdeResult ModGuts
936923
generateCore runSimplifier file = do
937924
packageState <- hscEnv <$> use_ GhcSessionDeps file
938925
tm <- use_ TypeCheck file
939-
setPriority priorityGenerateCore
940926
liftIO $ compileModule runSimplifier packageState (tmrModSummary tm) (tmrTypechecked tm)
941927

942928
generateCoreRule :: Recorder (WithPriority Log) -> Rules ()

Diff for: ghcide/src/Development/IDE/Core/Shake.hs

-7
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,10 @@ module Development.IDE.Core.Shake(
5151
HLS.getClientConfig,
5252
getPluginConfigAction,
5353
knownTargets,
54-
setPriority,
5554
ideLogger,
5655
actionLogger,
5756
getVirtualFile,
5857
FileVersion(..),
59-
Priority(..),
6058
updatePositionMapping,
6159
updatePositionMappingHelper,
6260
deleteValue, recordDirtyKeys,
@@ -1307,11 +1305,6 @@ updateFileDiagnostics recorder fp ver k ShakeExtras{diagnostics, hiddenDiagnosti
13071305
| otherwise = c
13081306

13091307

1310-
newtype Priority = Priority Double
1311-
1312-
setPriority :: Priority -> Action ()
1313-
setPriority (Priority p) = reschedule p
1314-
13151308
ideLogger :: IdeState -> Logger
13161309
ideLogger IdeState{shakeExtras=ShakeExtras{logger}} = logger
13171310

Diff for: hls-graph/src/Development/IDE/Graph.hs

-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ module Development.IDE.Graph(
1515
ShakeValue, RuleResult,
1616
-- * Special rules
1717
alwaysRerun,
18-
-- * Batching
19-
reschedule,
2018
-- * Actions for inspecting the keys in the database
2119
getDirtySet,
2220
getKeysAndVisitedAge,

Diff for: hls-graph/src/Development/IDE/Graph/Internal/Action.hs

-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module Development.IDE.Graph.Internal.Action
1111
, apply
1212
, applyWithoutDependency
1313
, parallel
14-
, reschedule
1514
, runActions
1615
, Development.IDE.Graph.Internal.Action.getDirtySet
1716
, getKeysAndVisitedAge
@@ -41,10 +40,6 @@ alwaysRerun = do
4140
ref <- Action $ asks actionDeps
4241
liftIO $ modifyIORef' ref (AlwaysRerunDeps mempty <>)
4342

44-
-- No-op for now
45-
reschedule :: Double -> Action ()
46-
reschedule _ = pure ()
47-
4843
parallel :: [Action a] -> Action [a]
4944
parallel [] = pure []
5045
parallel [x] = fmap (:[]) x

0 commit comments

Comments
 (0)