ndmitchell / ghcid

Very low feature GHCi based IDE
Other
1.13k stars 114 forks source link

Multiline errors/warnings #318

Closed mystaroll closed 4 years ago

mystaroll commented 4 years ago

Hello all, Thank you for this tool. Is there a way to view multiline errors/warnings? currently ghcid reports only a single line out of each error/warning in ghci.

Thanks

ndmitchell commented 4 years ago

It reports multiline warnings for me just fine. Can you provide a screenshot/example of the problem? Is it possible your terminal size isn't being detected, in which case --width=80 might help.

mystaroll commented 4 years ago

I was thinking the same, however that didn't solve the problem: Screenshot from 2020-05-28 11-04-02 Left is ghcid and right is ghci, as you can see ghcid is missing Testnewline

Running ghcid with --verbose :

%MESSAGES: ...... loadMessage = ["/home/mustafa/coding/qc-to-lh/src/Test2.hs:(51,6)-(55,2): error:","    [qc-to-lh] error: Test"]}]
.....
/home/mustafa/coding/qc-to-lh/src/Test2.hs:(51,6)-(55,2): error:
    [qc-to-lh] error: Test

Testnewline is not there.

mystaroll commented 4 years ago

I throw the error with something like this

failWith "Test\nTestnewline"
ndmitchell commented 4 years ago

Is this from a type checking plugin? Or a preprocessor? These don't appear to be normal GHC error messages. Note that Ghcid parses error messages in the style/format of GHC, and for those, there is the error message remains indented below the location. If you are generating your own messages, I suggest following the same style - e.g. failWith "Test\n Testnewline".

mystaroll commented 4 years ago

I see, it indeed works with the indentation. I have some preformatted messages from other tooling to report to the user. The idea is to keep the errors as they are with no added spacing. But thank you for your help