| Quickfix for syntactical errors [message #1741766] | 
Mon, 29 August 2016 07:12   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hi, 
 
I have customized the generated error messages for my language via ISyntaxErrorMessageProvider by the following: 
public static val INVALID_VAR_IDENTIFIER = "INVALID_VAR_IDENTIFIER"
override getSyntaxErrorMessage(IParserErrorContext context) {
	val unexpectedText = context?.recognitionException?.token?.text
	if ( !(GrammarUtil::getAllAlternatives(grammarAccess.getGrammar()).contains(unexpectedText))) {
		if (context.currentContext.eClass.name == "Dcl_var") {
			return new SyntaxErrorMessage(
				"Identifiers for variables have to start with a lower case!",
				INVALID_VAR_IDENTIFIER
			)
		}
}
 
Now I want to add a quickfix for this, but I'm getting the error "The annotation @Fix is disallowed for this location." 
@Fix(CeuSyntaxErrorMessageProvider.INVALID_VAR_IDENTIFIER) { }
 
how can I now add a quickfix for this IssueCode if this is not working? I haven't found any help on the documentation..
 |  
 |  
  | 
 | 
 | 
 | 
 | 
Powered by 
FUDForum. Page generated in 0.05028 seconds