Skip to content

Commit af47b30

Browse files
committed
Fix Shake.hs
1 parent bafb42a commit af47b30

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

ghcide/src/Development/IDE/Core/RuleTypes.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ instance Hashable GetClientSettings
514514
instance NFData GetClientSettings
515515

516516
type instance RuleResult GetClientSettings = Hashed (Maybe Value)
517-
type instance RuleInput GetClientSettings = '[ProjectHaskellFile]
517+
type instance RuleInput GetClientSettings = '[NoFile]
518518

519519
data AddWatchedFile = AddWatchedFile deriving (Eq, Show, Typeable, Generic)
520520
instance Hashable AddWatchedFile

ghcide/src/Development/IDE/Core/Shake.hs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -517,10 +517,14 @@ mappingForVersion allMappings file (Just (VFSVersion ver)) = do
517517
mappingForVersion _ _ _ = pure zeroMapping
518518

519519
type IdeRule k i is v =
520-
( Shake.RuleResult k ~ v
521-
, Shake.ShakeValue k
520+
( IdeValueRule k v
522521
, RuleInput k ~ is
523522
, HasInput i is
523+
)
524+
525+
type IdeValueRule k v =
526+
( Shake.RuleResult k ~ v
527+
, Shake.ShakeValue k
524528
, Show v
525529
, Typeable v
526530
, NFData v
@@ -1156,9 +1160,9 @@ usesWithStale key files = do
11561160
-- whether the rule succeeded or not.
11571161
traverse (lastValue key) files
11581162

1159-
useWithoutDependency :: IdeRule k i is v
1160-
=> k -> InputPath i -> Action (Maybe v)
1161-
useWithoutDependency key (InputPath file) =
1163+
useWithoutDependency :: IdeValueRule k v
1164+
=> k -> NormalizedFilePath -> Action (Maybe v)
1165+
useWithoutDependency key file =
11621166
(\(Identity (A value)) -> currentValue value) <$> applyWithoutDependency (Identity (Q (key, file)))
11631167

11641168
data RuleBody k i v
@@ -1288,8 +1292,8 @@ defineEarlyCutoff' doDiagnostics cmp key file mbOld mode action = do
12881292
-> Maybe v
12891293
-> InputPath i
12901294
-> Action (Maybe FileVersion)
1291-
estimateFileVersionUnsafely _k v fp
1292-
| unInputPath fp == emptyFilePath = pure Nothing
1295+
estimateFileVersionUnsafely _k v (InputPath fp)
1296+
| fp == emptyFilePath = pure Nothing
12931297
| Just Refl <- eqT @k @GetModificationTime = pure v
12941298
-- GetModificationTime depends on these rules, so avoid creating a cycle
12951299
| Just Refl <- eqT @k @AddWatchedFile = pure Nothing

0 commit comments

Comments
 (0)