We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
mkHomeModLocation
1 parent b27f3d2 commit c873852Copy full SHA for c873852
ghcide/src/Development/IDE/Core/Compile.hs
@@ -1120,7 +1120,11 @@ getModSummaryFromImports env fp _modTime mContents = do
1120
liftIO $ evaluate $ rnf textualImports
1121
1122
1123
- modLoc <- liftIO $ mkHomeModLocation dflags mod fp
+ 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
1128
1129
let modl = mkHomeModule (hscHomeUnit ppEnv) mod
1130
sourceType = if "-boot" `isSuffixOf` takeExtension fp then HsBootFile else HsSrcFile
0 commit comments