|
|
|
|
Re: Customizing error messages [message #894212 is a reply to message #893921] |
Sat, 07 July 2012 13:18  |
Eclipse User |
|
|
|
It is better to have a lenient and forgiving grammar and instead do
custom validation, this way you get full control over errors/warnings
and can even control what to flag as errors/warnings via user properties
if you want to.
You may even want to go as far as supporting illegal constructs in the
grammar where such constructs are common user mistakes just for the sake
of providing better feedback. As an example, if string are delimited
only by " " and user enters a string with ' ' - you can then easily
write a check for that, and provide a quickfix. If instead the first
single quote triggered a syntax error, you would have a very hard time
in the "error message provider" to translate the syntax-error to
something meaningful, and it would also be quite hard to provide a quick
fix (how do you know that what follows may be a string in an alternate
illegal form?)
Just my 2c
Regards
- henrik
On 2012-06-07 7:15, Christian Dietrich wrote:
> Hi,
>
> this is what ISyntaxErrorMessageProvideris for - unfortunately you will
> have to do a lot of reverse engineering to do the mapping of the default
> messages to your messages.
>
> ~Christian
|
|
|
Powered by
FUDForum. Page generated in 0.04729 seconds