[GHC] #12206: No exposed API to get full text of ErrMsg

#12206: No exposed API to get full text of ErrMsg -------------------------------------+------------------------------------- Reporter: bit | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHC API | Version: 8.0.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- In GHC version 7.10.3 it was possible to get the full text of an error message by using the functions `ErrUtils.errMsgShortDoc` and `ErrUtils.errMsgExtraInfo`. But in GHC version 8.0.1 the code has changed. The full text of the error message is stored in the `ErrMsg` field `ErrUtils.errMsgDoc`, but this field is hidden, and there doesn't seem to be any API to access its contents. The only workaround I can find is to use `ErrUtils.pprLocErrMsg`, and then strip out the first line containing the location info, and then manually unindent the 4-space "hang". This is quite ugly. I suggest exporting `ErrUtils.errMsgDoc`, and then for that to be useful the fields of `ErrUtils.ErrDoc` will also be needed. Additionally, `ErrUtils.formatErrDoc` could be a nice bonus to have (and if exported would lessen the need for the `ErrDoc` fields). The GHC API changes on every GHC release, so since backwards compatibility is not an issue, it would seem that there is no need to have a carefully exposed API, and there is no danger in liberally exporting stuff that clients could potentially find useful. Thank you -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12206 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12206: No exposed API to get full text of ErrMsg -------------------------------------+------------------------------------- Reporter: bit | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: GHC API | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by mpickering): Seems like a sensible suggestion. Could you perhaps submit a patch exposing it? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12206#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12206: No exposed API to get full text of ErrMsg -------------------------------------+------------------------------------- Reporter: bit | Owner: Type: bug | Status: patch Priority: normal | Milestone: 8.0.2 Component: GHC API | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2491 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: new => patch * differential: => Phab:D2491 * milestone: => 8.0.2 Comment: bit, does Phab:D2491 look okay to you? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12206#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12206: No exposed API to get full text of ErrMsg
-------------------------------------+-------------------------------------
Reporter: bit | Owner:
Type: bug | Status: patch
Priority: normal | Milestone: 8.0.2
Component: GHC API | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D2491
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#12206: No exposed API to get full text of ErrMsg -------------------------------------+------------------------------------- Reporter: bit | Owner: Type: bug | Status: merge Priority: normal | Milestone: 8.0.2 Component: GHC API | Version: 8.0.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2491 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => merge -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12206#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12206: No exposed API to get full text of ErrMsg -------------------------------------+------------------------------------- Reporter: bit | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: GHC API | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2491 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: merge => closed * resolution: => fixed Comment: Merged to `ghc-8.0` as 99bb8ffe85ab135b3928b790818c0d5bbbb747a4. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12206#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12206: No exposed API to get full text of ErrMsg -------------------------------------+------------------------------------- Reporter: bit | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.2 Component: GHC API | Version: 8.0.1 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D2491 Wiki Page: | -------------------------------------+------------------------------------- Comment (by bit): I haven't tested this yet, but I carefully inspected the patch and it looks great! Thanks so much! -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12206#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC