My late christmas present for you: context-aware assertion error messages

WebFreak001 d.forum at webfreak.org
Mon Jan 14 21:42:24 UTC 2019


On Saturday, 12 January 2019 at 16:52:28 UTC, Seb wrote:
> On Saturday, 12 January 2019 at 16:32:43 UTC, H. S. Teoh wrote:
>>
>> Seriously, for editor/IDE plugins, there should be a 
>> --porcelain option that outputs error messages in a 
>> machine-friendly format, like with a fixed format that's easy 
>> for scripts / code / whatever to parse.
>>
>>
>> T
>
> It probably would be -verrors=json (or sth. like this), but the 
> problem is that tools which parse DMD output are already out 
> there, so we need to be a bit careful not to break them.
>
> Anyhow, I think using TTY detection to enable -verrors=context 
> by default should work fine.
> DMD did/does the same when color-coded messages (`-color` ) 
> where introduced.

I would be happy to change code-d and tools to any other format 
than currently parsing regexes, it's also missing consecutive 
errors like "instantiated from here" right now which I would like 
to fix :)


More information about the Digitalmars-d mailing list