-
Notifications
You must be signed in to change notification settings - Fork 214
What changes to GHC error reporting are required #7
Comments
Important part of error message is the cross referencing information point to related files and lines of code. gcc and clang always put file name and line number as first information in output line:
Sadly GHC likes to put paths to source files inside sentences so we have to discover where is the cross referencing information. |
It would be great to have |
I think there has been a change to prepend "error", will be in 8.0.1, may On Tue, Oct 27, 2015 at 12:41 AM, Michael Sloan notifications@github.com
|
One thing that I keep stumbling upon is the fact that suggestions to enable pragmas always have slightly different formats causing tools which try to parse them such as |
What about |
As pointed by @mpickering there are a ghc proposal to implement structured errors: https://github.com/bgamari/ghc-proposals/blob/rich-errors-proposal/proposals/0000-rich-errors-proposal.rst. It is pretty recent (3 months). To fix some bugs for windows i had to add more cases in parsing human readable ghc errors: haskell-ide-engine/test/functional/FunctionalCodeActionsSpec.hs Lines 224 to 228 in 5385087
or haskell-ide-engine/src/Haskell/Ide/Engine/Plugin/HsImport.hs Lines 489 to 501 in 5385087
|
There are a number of trac tickets related to the way GHC reports errors, with a view to improving them.
https://ghc.haskell.org/trac/ghc/ticket/8809
https://ghc.haskell.org/trac/ghc/ticket/10073
https://ghc.haskell.org/trac/ghc/ticket/10179
For tooling support, there should be an option to return errors in some kind of typed structure that can be easily an unambiguously processed by the tool.
This is in general a hard task, with deep tentacles into GHC.
Is there any low hanging fruit we can harvest in time for GHC 8.1?
The text was updated successfully, but these errors were encountered: