This repository was archived by the owner on Oct 7, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
src/Haskell/Ide/Engine/Plugin Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -63,14 +63,15 @@ lookupSrcHtmlForModule =
63
63
64
64
lookupHtmlForModule :: (FilePath -> FilePath -> FilePath ) -> DynFlags -> Module -> IO (Maybe FilePath )
65
65
lookupHtmlForModule mkDocPath df m = do
66
- let mfp = go <$> (listToMaybe =<< lookupHtmls df ui)
67
- exists <- maybe ( pure False ) doesFileExist mfp
68
- return $ if exists then mfp else Nothing
66
+ let mfs = go <$> (listToMaybe =<< lookupHtmls df ui)
67
+ htmls <- filterM doesFileExist ( concat . maybeToList $ mfs)
68
+ return $ listToMaybe htmls
69
69
where
70
- go pkgDocDir = mkDocPath pkgDocDir mn
70
+ -- The file might use "." or "-" as separator
71
+ go pkgDocDir = [mkDocPath pkgDocDir mn | mn <- [mndot,mndash]]
71
72
ui = moduleUnitId m
72
- mn = map (\ x -> if x == ' .' then ' -' else x) mns
73
- mns = moduleNameString $ moduleName m
73
+ mndash = map (\ x -> if x == ' .' then ' -' else x) mndot
74
+ mndot = moduleNameString $ moduleName m
74
75
75
76
nameCacheFromGhcMonad :: GhcMonad m => NameCacheAccessor m
76
77
nameCacheFromGhcMonad = ( read_from_session , write_to_session )
You can’t perform that action at this time.
0 commit comments