Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 325136

Summary: JavaValidator isn't registered, if grammer is not generated
Product: [Modeling] TMF Reporter: Benjamin Schwertfeger <benjamin.schwertfeger>
Component: XtextAssignee: Jan Koehnlein <jan>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: Andreas.Muelder, jan, sebastian.zarnekow, tmf.xtext-inbox
Version: 1.0.0Flags: sebastian.zarnekow: indigo+
Target Milestone: M5   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on: 334080    
Bug Blocks:    

Description Benjamin Schwertfeger CLA 2010-09-13 12:55:35 EDT
If you use an existing ecore model for your grammar the AbstractXXXJavaValidator and XXXJavaValidator classes are generated and set in the module. 


IS: The Validator is not registered in the Registry, because the getPackages method returns an empty array.

EXPECTED: The generated validator should register for each referenced ecore model or contain a dummy implementation of getEPackages() with a comment to fill in the relevant EPackages.
Comment 1 Sebastian Zarnekow CLA 2010-09-13 14:06:23 EDT
This is intentional: We do not register anything for EPackages that are imported because the Xtext grammar is not the primary source for those packages and should not alter their behaviour or semantics. Developers have to do this explicitly. 
Although this often causes confusion I'm inclined to keep the current behaviour.
Comment 2 Lothar Wendehals CLA 2011-01-04 07:22:13 EST
Hi everybody,

I also stumbled upon this "bug". It took me an hour to find out what was wrong. If its not a bug, it should definitely(!!!) be documented. It's not documented in the build-in help.
Comment 3 Jan Koehnlein CLA 2011-01-12 08:15:32 EST
We should only register for EPackages of elements that can be contained, to avoid a giant composite validator for often referenced languages such as Ecore or JvmTypes. 

If we resolve Bug 334080, we can register the EValidator for all these EPackages, but only in the context of a single language, making it less invasive with regard to other EMF based plug-ins.
Comment 4 Jan Koehnlein CLA 2011-01-13 04:02:27 EST
Implemented and pushed to MASTER.
Comment 5 Karsten Thoms CLA 2017-09-19 17:04:21 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 6 Karsten Thoms CLA 2017-09-19 17:16:18 EDT
Closing all bugs that were set to RESOLVED before Neon.0