Suggestion needed to improve the JAX-RS change processing and validation
by Xavier Coulon
Hello,
I recently opened https://issues.jboss.org/browse/JBIDE-17290 because I realised that since I added the "as-you-type" validation in the JAX-RS tooling, I have two concurrent updates in the JAX-RS model: a JavaElementChangedListener that updates the JAX-RS elements in the model after the user edited a compilation unit, but the 'as-you-type' validator needs to perform the same updates in order to be sure that the validation occurs after the last changes have been taken into account. Actually, the two processes occur in parallel and I have no idea how to make sure that the JavaElementListener-related task is executed and completes before the validation start. I should point that the JavaElementChangedListener is not related to the JAX-RS Builder which is called when a file is saved - that's another story, since there are also updates at this level.
I don't want to get rid of the JavaElementChangedListener because the notification event provides me with the modified CompilationUnit AST, which is required for later processing (I don't want to parse the compilation unit unless it's absolutely necessary). Furthermore, it feels weird that the updates would only occur during the validation, so I'd rather avoid such updates in the validator.
Do you have any suggestion on how I could simplify and improve this part of the tooling ? Since we're now preparing for CR1, an easy-and-acceptable-by-Max solution would be preferred ;-)
How is the situation handled in the CDI tooling ?
Thanks for reading this mail and thanks for your help !
Best regards,
/Xavier
10 years, 5 months