Skip to content
This repository was archived by the owner on Jan 2, 2021. It is now read-only.

Discard diagnostics from type check in suggestModuleTypo #943

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Development/IDE/Plugin/CodeAction.hs
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,9 @@ suggestModuleTypo Diagnostic{_range=_range,..}
-- Could not find module ‘Data.Cha’
-- Perhaps you meant Data.Char (from base-4.12.0.0)
| "Could not find module" `T.isInfixOf` _message
, "Perhaps you meant" `T.isInfixOf` _message = let
, "Perhaps you meant" `T.isInfixOf` _message
, Just "not found" <- _source
= let
findSuggestedModules = map (head . T.words) . drop 2 . T.lines
proposeModule mod = ("replace with " <> mod, [TextEdit _range mod])
in map proposeModule $ nubOrd $ findSuggestedModules _message
Expand Down