diff --git a/src/Development/IDE/Functions/Compile.hs b/src/Development/IDE/Functions/Compile.hs index 1613df85..ca0cacb9 100644 --- a/src/Development/IDE/Functions/Compile.hs +++ b/src/Development/IDE/Functions/Compile.hs @@ -233,7 +233,12 @@ runGhcSession IdeOptions{..} modu env act = runGhcEnv env $ do moduleImportPaths :: GHC.ParsedModule -> Maybe FilePath moduleImportPaths pm | rootModDir == "." = Just rootPathDir - | otherwise = dropTrailingPathSeparator <$> stripSuffix rootModDir rootPathDir + | otherwise = + -- TODO (MK) stripSuffix (normalise rootModDir) (normalise rootPathDir) + -- would be a better choice but at the moment we do not consistently + -- normalize file paths in the Shake graph so we can end up with the + -- same module being represented twice in the Shake graph. + Just $ dropTrailingPathSeparator $ dropEnd (length rootModDir) rootPathDir where ms = GHC.pm_mod_summary pm file = GHC.ms_hspp_file ms