Skip to content

Commit c873852

Browse files
authored
Revert mkHomeModLocation changes
1 parent b27f3d2 commit c873852

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,11 @@ getModSummaryFromImports env fp _modTime mContents = do
11201120
liftIO $ evaluate $ rnf textualImports
11211121

11221122

1123-
modLoc <- liftIO $ mkHomeModLocation dflags mod fp
1123+
modLoc <- liftIO $ if mod == mAIN_NAME
1124+
-- specially in tests it's common to have lots of nameless modules
1125+
-- mkHomeModLocation will map them to the same hi/hie locations
1126+
then mkHomeModLocation dflags (pathToModuleName fp) fp
1127+
else mkHomeModLocation dflags mod fp
11241128

11251129
let modl = mkHomeModule (hscHomeUnit ppEnv) mod
11261130
sourceType = if "-boot" `isSuffixOf` takeExtension fp then HsBootFile else HsSrcFile

0 commit comments

Comments
 (0)