This repository was archived by the owner on Apr 25, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -731,14 +731,17 @@ guessHaddockUrl modSum targetFile targetModule symbol lineNr colNr ghcPkg readPr
731731
732732 gmLog GmDebug " guessHaddockUrl" $ strDoc $ " haddock: " ++ show haddock
733733
734- let f = haddock </> (moduleNameToHtmlFile lastMatchModule)
735-
736734 let mySymbol' = case mySymbol of
737735 MySymbolSysQualified s -> s
738736 MySymbolUserQualified s -> s
739737
740- return $ mySymbol' ++ " " ++ lastMatchModule ++ " file://" ++ f
741- ++ " " ++ toHackageUrl f lastMatchPackageName lastMatchModule
738+ let f = haddock </> (moduleNameToHtmlFile lastMatchModule)
739+
740+ e <- liftIO $ doesFileExist f
741+
742+ return $
743+ if e then mySymbol' ++ " " ++ lastMatchModule ++ " file://" ++ f
744+ else mySymbol' ++ " " ++ lastMatchModule ++ " " ++ toHackageUrl f lastMatchPackageName lastMatchModule
742745
743746 where
744747 -- Convert a module name string, e.g. @Data.List@ to @Data-List.html@.
@@ -805,4 +808,5 @@ importedFrom file lineNr colNr (Expression symbol) = do
805808 modSum <- fileModSummaryWithMapping (cradleCurrentDir crdl </> file)
806809 let modstr = moduleNameString $ ms_mod_name modSum :: String
807810
808- guessHaddockUrl modSum file modstr symbol lineNr colNr ghcPkg readProc pkgDbStack
811+ x <- guessHaddockUrl modSum file modstr symbol lineNr colNr ghcPkg readProc pkgDbStack
812+ return $ x ++ " \n "
You can’t perform that action at this time.
0 commit comments