SyntaxErrorMessageProvider custom implementation [message #1770757] |
Wed, 16 August 2017 16:15  |
Eclipse User |
|
|
|
Hi,
I want to customize the syntax error messages provided by the framework. So I tried extending SyntaxErrorMessageProvider class in order to give an error for user defined terms as follows.
public class MyDslErrorMessageProvider extends SyntaxErrorMessageProvider {
@Override
public SyntaxErrorMessage getSyntaxErrorMessage(IParserErrorContext context) {
//SyntaxErrorMessage syntaxError1=new SyntaxErrorMessage("Name should start with a letter", IssueCodes.AMBIGUOUS_FEATURE_CALL);
if(context.getRecognitionException() instanceof RecognitionException){
return new SyntaxErrorMessage("Name should start with a letter", IssueCodes.AMBIGUOUS_FEATURE_CALL);
}
return super.getSyntaxErrorMessage(context);
}
@Override
public SyntaxErrorMessage getSyntaxErrorMessage(IValueConverterErrorContext context) {
// TODO Auto-generated method stub
return null;
}
}
But when I run this message is shown at all errorneous places in the editor. How can I show the message only in needed places?
Thank you.
[Updated on: Wed, 16 August 2017 16:17] by Moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: SyntaxErrorMessageProvider custom implementation [message #1771299 is a reply to message #1771295] |
Wed, 23 August 2017 14:58  |
Eclipse User |
|
|
|
Hi,
Sorry the thing I mentioned above works not for this minimal grammar, but for the complete grammar. However my question is, is there a way to merge these stream,table,trigger,window and function definitions? I don't see any way to combine all of them together to form one rule. If it can be done the issue solves :).
[Updated on: Wed, 23 August 2017 14:59] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.06757 seconds