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

Bug 334080

Summary: [validation] Allow language (resource) specific validators
Product: [Modeling] TMF Reporter: Jan Koehnlein <jan>
Component: XtextAssignee: Jan Koehnlein <jan>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: tmf.xtext-inbox
Version: 2.0.0Flags: jan: indigo+
Target Milestone: M5   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 325136    

Description Jan Koehnlein CLA 2011-01-12 07:51:15 EST

    
Comment 1 Jan Koehnlein CLA 2011-01-12 08:17:15 EST
Currently we are registering our EValidators to EMF's EValidator.Registry, which makes them globally available for a set of EPackage(s). When dealing with multiple or existing metamodels, it'd be nice if certain checks are only executed in the context of one specific Xtext language, i.e. in resources belonging to that language. 

This can also be used to avoid duplicate checks in the context of language inheritance: If a sublanguage's validator inherits from the superlanguage's validator, you can then register the validator only for resources of the respective languages to avoid duplicate check execution in the sublanguage. OTOH, the implementation of the superlanguage's validator can still rely on language specific components which are bound differently in the sublanguage. Such a situation arises with Xbase and Xtend2.

Even though called from a completely different context, the ConcreteSyntaxValidator already uses a similar strategy.
Comment 2 Jan Koehnlein CLA 2011-01-12 10:26:34 EST
Pushed to MASTER.

AbstractInjectableValidator now only validates if the XtextResource of the element has the same language. This behavior can be overriden by returning false in isLanguageSpecific(). Once derived, the language name is cached in the validation context map for better performance. The ResourceValidatorImpl sets the language name in the context eagerly.

Removed the equvialent mechanism in AbstractConcreteSyntaxValidator.
Comment 3 Karsten Thoms CLA 2017-09-19 17:38:09 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 17:49:21 EDT
Closing all bugs that were set to RESOLVED before Neon.0