Extra info for GHC warnings.
This commit is contained in:
parent
badaea4eff
commit
5296ccf38d
3
Check.hs
3
Check.hs
@ -78,13 +78,14 @@ ghcPackage = ExposePackage "ghc"
|
||||
----------------------------------------------------------------
|
||||
|
||||
showErrMsg :: ErrMsg -> String
|
||||
showErrMsg err = file ++ ":" ++ line ++ ":" ++ col ++ ":" ++ msg
|
||||
showErrMsg err = file ++ ":" ++ line ++ ":" ++ col ++ ":" ++ msg ++ "\0" ++ ext
|
||||
where
|
||||
spn = head (errMsgSpans err)
|
||||
file = unpackFS (srcSpanFile spn)
|
||||
line = show (srcSpanStartLine spn)
|
||||
col = show (srcSpanStartCol spn)
|
||||
msg = showSDoc (errMsgShortDoc err)
|
||||
ext = showSDoc (errMsgExtraInfo err)
|
||||
|
||||
style :: PprStyle
|
||||
style = mkUserStyle neverQualify AllTheWay
|
||||
|
@ -70,7 +70,11 @@
|
||||
(defun ghc-flymake-insert-errors (title errs)
|
||||
(save-excursion
|
||||
(insert title "\n")
|
||||
(mapc (lambda (x) (insert (ghc-replace-character x ghc-null ghc-newline) "\n")) errs)))
|
||||
(mapc (lambda (x) (insert (ghc-replace-character x ghc-null ghc-newline) "\n")) errs)
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "In the [^:\n]+: " nil t)
|
||||
(replace-match (concat "\n" (match-string 0) "\n ")))))
|
||||
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user