diff options
author | roland <rsx@bluewin.ch> | 2018-09-16 19:06:13 +0300 |
---|---|---|
committer | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2018-09-16 19:24:54 +0300 |
commit | c6bff526123611d89ea4c92fbc26df221b7ecdd5 (patch) | |
tree | 233b3b3c587aa0da988c4fbb8fb8beb281732648 /compiler/main/Finder.hs | |
parent | a3bce956d7ee5f3951e3e93fd3946711c50ff07f (diff) | |
download | haskell-c6bff526123611d89ea4c92fbc26df221b7ecdd5.tar.gz |
Fix for #13862: Optional "-v" not allowed with :load in GHCi
Replace the error message
`Use -v to see a list of the files searched for.`
with
`Use -v (or :set -v` in ghci) to see a list of the files searched for.`
Reviewers: bgamari, monoidal, thomie, osa1
Subscribers: rwbarton, carter
GHC Trac Issues: #13862
Differential Revision: https://phabricator.haskell.org/D5122
Diffstat (limited to 'compiler/main/Finder.hs')
-rw-r--r-- | compiler/main/Finder.hs | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/compiler/main/Finder.hs b/compiler/main/Finder.hs index 40efcf3523..9a3cb6009b 100644 --- a/compiler/main/Finder.hs +++ b/compiler/main/Finder.hs @@ -652,7 +652,7 @@ cantFindErr cannot_find _ dflags mod_name find_result -> not_found_in_package pkg files | not (null suggest) - -> pp_suggestions suggest $$ tried_these files + -> pp_suggestions suggest $$ tried_these files dflags | null files && null mod_hiddens && null pkg_hiddens && null unusables @@ -662,7 +662,7 @@ cantFindErr cannot_find _ dflags mod_name find_result -> vcat (map pkg_hidden pkg_hiddens) $$ vcat (map mod_hidden mod_hiddens) $$ vcat (map unusable unusables) $$ - tried_these files + tried_these files dflags _ -> panic "cantFindErr" @@ -676,20 +676,13 @@ cantFindErr cannot_find _ dflags mod_name find_result in text "Perhaps you haven't installed the " <> text build <> text " libraries for package " <> quotes (ppr pkg) <> char '?' $$ - tried_these files + tried_these files dflags | otherwise = text "There are files missing in the " <> quotes (ppr pkg) <> text " package," $$ text "try running 'ghc-pkg check'." $$ - tried_these files - - tried_these files - | null files = Outputable.empty - | verbosity dflags < 3 = - text "Use -v to see a list of the files searched for." - | otherwise = - hang (text "Locations searched:") 2 $ vcat (map text files) + tried_these files dflags pkg_hidden :: UnitId -> SDoc pkg_hidden pkgid = @@ -778,7 +771,7 @@ cantFindInstalledErr cannot_find _ dflags mod_name find_result -> text "It is not a module in the current program, or in any known package." | otherwise - -> tried_these files + -> tried_these files dflags _ -> panic "cantFindInstalledErr" @@ -804,17 +797,19 @@ cantFindInstalledErr cannot_find _ dflags mod_name find_result in text "Perhaps you haven't installed the " <> text build <> text " libraries for package " <> quotes (ppr pkg) <> char '?' $$ - tried_these files + tried_these files dflags | otherwise = text "There are files missing in the " <> quotes (ppr pkg) <> text " package," $$ text "try running 'ghc-pkg check'." $$ - tried_these files - - tried_these files - | null files = Outputable.empty - | verbosity dflags < 3 = - text "Use -v to see a list of the files searched for." - | otherwise = - hang (text "Locations searched:") 2 $ vcat (map text files) + tried_these files dflags + +tried_these :: [FilePath] -> DynFlags -> SDoc +tried_these files dflags + | null files = Outputable.empty + | verbosity dflags < 3 = + text "Use -v (or `:set -v` in ghci) " <> + text "to see a list of the files searched for." + | otherwise = + hang (text "Locations searched:") 2 $ vcat (map text files) |