@@ -288,6 +288,8 @@ errorSuggestion err = case err of
288 UnusedImport{} -> emptySuggestion
288 UnusedImport{} -> emptySuggestion
289 DuplicateImport{} -> emptySuggestion
289 DuplicateImport{} -> emptySuggestion
290 UnusedExplicitImport mn _ qual refs -> suggest $ importSuggestion mn refs qual
290 UnusedExplicitImport mn _ qual refs -> suggest $ importSuggestion mn refs qual
291+ UnusedDctorImport mn _ qual refs -> suggest $ importSuggestion mn refs qual
292+ UnusedDctorExplicitImport mn _ _ qual refs -> suggest $ importSuggestion mn refs qual
291 ImplicitImport mn refs -> suggest $ importSuggestion mn refs Nothing
293 ImplicitImport mn refs -> suggest $ importSuggestion mn refs Nothing
292 ImplicitQualifiedImport mn asModule refs -> suggest $ importSuggestion mn refs (Just asModule)
294 ImplicitQualifiedImport mn asModule refs -> suggest $ importSuggestion mn refs (Just asModule)
293 HidingImport mn refs -> suggest $ importSuggestion mn refs Nothing
295 HidingImport mn refs -> suggest $ importSuggestion mn refs Nothing
@@ -756,12 +758,18 @@ prettyPrintSingleError (PPEOptions codeColor full level showWiki) e = flip evalS
756 , line "It could be replaced with:"
758 , line "It could be replaced with:"
757 , indent $ line $ markCode $ showSuggestion msg ]
759 , indent $ line $ markCode $ showSuggestion msg ]
759− renderSimpleErrorMessage (UnusedDctorImport name) =
761+ renderSimpleErrorMessage msg@(UnusedDctorImport mn name _ _) =
760− line $ "The import of type " ++ markCode (runProperName name) ++ " includes data constructors but only the type is used"
762+ paras [line $ "The import of type " ++ markCode (runProperName name)
763+ ++ " from module " ++ markCode (runModuleName mn) ++ " includes data constructors but only the type is used"
764+ , line "It could be replaced with:"
765+ , indent $ line $ markCode $ showSuggestion msg ]
762− renderSimpleErrorMessage (UnusedDctorExplicitImport name names) =
767+ renderSimpleErrorMessage msg@(UnusedDctorExplicitImport mn name names _ _) =
763− paras [ line $ "The import of type " ++ markCode (runProperName name) ++ " includes the following unused data constructors:"
768+ paras [ line $ "The import of type " ++ markCode (runProperName name)
769+ ++ " from module " ++ markCode (runModuleName mn) ++ " includes the following unused data constructors:"
764− , indent $ paras $ map (line . markCode . runProperName) names ]
770+ , indent $ paras $ map (line . markCode . runProperName) names
771+ , line "It could be replaced with:"
772+ , indent $ line $ markCode $ showSuggestion msg ]
766 renderSimpleErrorMessage (DuplicateSelectiveImport name) =
774 renderSimpleErrorMessage (DuplicateSelectiveImport name) =
767 line $ "There is an existing import of " ++ markCode (runModuleName name) ++ ", consider merging the import lists"
775 line $ "There is an existing import of " ++ markCode (runModuleName name) ++ ", consider merging the import lists"