Skip to content

Commit 4cc1c37

Browse files
committed
Refactor comments for clarity and update rule usage in needsCompilationRule
1 parent 824c508 commit 4cc1c37

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ type instance RuleResult GetParsedModuleWithComments = ParsedModule
7474

7575
type instance RuleResult GetModuleGraph = DependencyInformation
7676

77-
-- same as DependencyInformation but only rebuilds if the target file deps changes
77+
-- same as GetModuleGraph but only rebuilds if the target file deps changes
7878
type instance RuleResult GetFileModuleGraph = DependencyInformation
7979

8080
data GetKnownTargets = GetKnownTargets

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ needsCompilationRule file
11451145
| "boot" `isSuffixOf` fromNormalizedFilePath file =
11461146
pure (Just $ encodeLinkableType Nothing, Just Nothing)
11471147
needsCompilationRule file = do
1148-
graph <- useNoFile GetModuleGraph
1148+
graph <- use GetFileModuleGraph file
11491149
res <- case graph of
11501150
-- Treat as False if some reverse dependency header fails to parse
11511151
Nothing -> pure Nothing

ghcide/src/Development/IDE/Import/DependencyInformation.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,8 @@ instance NFData NamedModuleDep where
411411
instance Show NamedModuleDep where
412412
show NamedModuleDep{..} = show nmdFilePath
413413

414-
-- | Build a map from file path to fingerprint. The fingerprint is built
415-
-- from the fingerprints of the file and all its dependencies.
414+
-- | Build a map from file path to its full fingerprint.
415+
-- The fingerprint is depend on both the fingerprints of the file and all its dependencies.
416416
-- This is used to determine if a file has changed and needs to be reloaded.
417417
buildAccFingerFilePathIdMap :: FilePathIdMap FilePathIdSet -> FilePathIdMap Fingerprint -> FilePathIdMap Fingerprint
418418
buildAccFingerFilePathIdMap modulesDeps shallowFingers = go keys IntMap.empty

0 commit comments

Comments
 (0)