mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-17 23:22:04 +03:00
Fix an issue in module chasing caused by unnormalized file paths (#1303)
On Windows we can end up with rootModDir having / in the filepath while rootPathDir uses \ so stripSuffix didn’t work. This fixes #1284
This commit is contained in:
parent
a290aab694
commit
1fa783b876
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user