ask GHC for pretty printing to GHC instead of pretifying in Elisp.
This commit is contained in:
parent
b3d9b12688
commit
b3523951c5
5
Check.hs
5
Check.hs
@ -91,4 +91,7 @@ style :: PprStyle
|
||||
style = mkUserStyle neverQualify AllTheWay
|
||||
|
||||
showSDoc :: SDoc -> String
|
||||
showSDoc d = Pretty.showDocWith OneLineMode (d style)
|
||||
showSDoc d = map toNull . Pretty.showDocWith ZigZagMode $ d style
|
||||
where
|
||||
toNull '\n' = '\0'
|
||||
toNull x = x
|
||||
|
@ -70,13 +70,7 @@
|
||||
(defun ghc-flymake-insert-errors (title errs)
|
||||
(save-excursion
|
||||
(insert title "\n\n")
|
||||
(mapc (lambda (x) (insert (ghc-replace-character x ghc-null ghc-newline) "\n")) errs)
|
||||
(goto-char (point-min))
|
||||
(while (re-search-forward "In the definition of [^:\n ]+: \\|In the [^:\n ]+: \\|Expected type: \\|Inferred type: \\|Possible fix: " nil t)
|
||||
(replace-match (concat "\n" (match-string 0) "\n ")))
|
||||
(goto-char (point-max))
|
||||
(while (re-search-backward "In the [a-z]+ argument\\|In the `" nil t)
|
||||
(insert "\n"))))
|
||||
(mapc (lambda (x) (insert (ghc-replace-character x ghc-null ghc-newline) "\n")) errs)))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user