Numbering compiler error messages?

Kapps opantm2+spam at gmail.com
Fri Mar 28 15:33:03 PDT 2014


On Friday, 28 March 2014 at 18:24:21 UTC, Walter Bright wrote:
> The IDE doesn't have to parse them. All it has to do is do a 
> substring search. The IDE developer would have to provide the 
> patterns to search for, but that isn't any harder than creating 
> an indexed table.

Error messages can and frequently are improved and thus are not 
usable by tools. Error codes remain constant and thus are usable 
by tools.

IDE support would also allow things like pressing F1 on an error 
in the error list to be taken to something like wiki/ERR005 which 
may show an explanation of the error or an example of how to fix 
it or such. I'm not sure how useful this particular use case is 
though.

In an ideal world errors would be able to be outputted (using a 
compiler flag) in a program readable way (i.e., JSON or the like, 
with a code representing the error and data for that particular 
error, such as { code: ERR003, description: "variable 'foo' is 
unused", variable: "foo", file: "foo.d", line: 32 }, then your 
IDE could offer to remove the variable for you immediately, as 
well as other nice things like that. But without tool support I 
feel error codes aren't too useful, and in order to provide 
enough context to make tools useful you'd have to parse the error 
message in the first place which immediately makes it not 
practical and defeats the benefit of error codes.


More information about the Digitalmars-d mailing list