Skip to content

Commit

Permalink
Extend redundant-import trigger to support qualified imports
Browse files Browse the repository at this point in the history
The redundant-import-removal-suggest feature added in 741ab38 has two
deficiencies:

 - doesn't trigger in case of multi-line warnings (happens with GHC 7.6), and
 - doesn't trigger in case of qualified imports.

This commit tries to address these two issues by improving the regexp
providing the trigger.
  • Loading branch information
hvr committed May 22, 2013
1 parent de4a198 commit 314a780
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions haskell-process.el
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,11 @@ to be loaded by ghci."
(cond ((string-match "\\-X\\([A-Z][A-Za-z]+\\)" msg)
(when haskell-process-suggest-language-pragmas
(haskell-process-suggest-pragma session "LANGUAGE" (match-string 1 msg) file)))
((string-match "Warning: The import of[ ]`\\([^ ]+\\)' is redundant" msg)
((string-match " The \\(qualified \\)?import of[ ]`\\([^ ]+\\)' is redundant" msg)
(when haskell-process-suggest-remove-import-lines
(haskell-process-suggest-remove-import session
file
(match-string 1 msg)
(match-string 2 msg)
line)))
((string-match "Warning: orphan instance: " msg)
(when haskell-process-suggest-no-warn-orphans
Expand Down

0 comments on commit 314a780

Please sign in to comment.