Xtext : shouldgenerate [message #1764419] |
Mon, 29 May 2017 10:53  |
Eclipse User |
|
|
|
Hello,
I have a new problem.
I want to launch the function doGenerate even if there are errors.
I found this interface which blocks me.
@Beta
@ImplementedBy(OnlyWithoutErrors)
interface IShouldGenerate {
/**
* whether code should be generated for this resource.
*/
def boolean shouldGenerate(Resource resource, CancelIndicator cancelIndicator);
@Beta
static class OnlyWithoutErrors implements IShouldGenerate {
@Inject IResourceValidator resourceValidator
override shouldGenerate(Resource resource, CancelIndicator cancelIndicator) {
if (!resource.errors.isEmpty)
return false
val issues = resourceValidator.validate(resource, CheckMode.NORMAL_AND_FAST, cancelIndicator)
return !issues.exists[severity == Severity.ERROR]
}
}
@Beta
static class Always implements IShouldGenerate {
override shouldGenerate(Resource resource, CancelIndicator cancelIndicator) {
return true
}
}
}
I would like to use the Always implementation.
How I have to configure it (in GenerateMyDsl.mwe2) ?
Thank you
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06838 seconds