Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 334080 - [validation] Allow language (resource) specific validators
Summary: [validation] Allow language (resource) specific validators
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: M5   Edit
Assignee: Jan Koehnlein CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 325136
  Show dependency tree
 
Reported: 2011-01-12 07:51 EST by Jan Koehnlein CLA
Modified: 2017-09-19 17:49 EDT (History)
1 user (show)

See Also:
jan: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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