@@ -233,7 +233,12 @@ runGhcSession IdeOptions{..} modu env act = runGhcEnv env $ do
233233moduleImportPaths :: GHC.ParsedModule -> Maybe FilePath
234234moduleImportPaths pm
235235 | rootModDir == "." = Just rootPathDir
236− | otherwise = dropTrailingPathSeparator <$> stripSuffix rootModDir rootPathDir
236+ | otherwise =
237+ -- TODO (MK) stripSuffix (normalise rootModDir) (normalise rootPathDir)
238+ -- would be a better choice but at the moment we do not consistently
239+ -- normalize file paths in the Shake graph so we can end up with the
240+ -- same module being represented twice in the Shake graph.
241+ Just $ dropTrailingPathSeparator $ dropEnd (length rootModDir) rootPathDir
237242 where
238243 ms = GHC.pm_mod_summary pm
239244 file = GHC.ms_hspp_file ms