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

Bug 341042

Summary: [Services] Allow to retrieve a resource service provider for a given language id
Product: [Modeling] TMF Reporter: Sebastian Zarnekow <sebastian.zarnekow>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: knut.wannheden, moritz.eysholdt
Version: 2.0.0Flags: sebastian.zarnekow: indigo+
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Sebastian Zarnekow CLA 2011-03-26 15:46:53 EDT
I've something like IResourceServiceProvider.Registry#getLanguageIdToServiceProviderMap()

Btw: Why are the methods in the registry called getXYZTo_Factory_Map()?

This would allow to discard some code in the codetemplate implementation.
Comment 1 Sven Efftinge CLA 2012-11-21 03:12:14 EST
> Btw: Why are the methods in the registry called getXYZTo_Factory_Map()?

Not sure what you mean?
Comment 2 Knut Wannheden CLA 2012-11-21 06:30:43 EST
I assume these methods were copied and pasted from EMF's Resource.Factory.Registry where they have the exact same names. But in the IResourceServiceProvider case the 'Factory' should probably have been replaced with 'Provider' as the returned map contains IResourceServiceProvider instances (or lazy-loading Provider<IResourceServiceProvider> instances).

But what is proposed by this ticket would indeed be useful. I've also seen code here and there which constructs a dummy URI (with the correct file extension) in order to access a language's IResourceServiceProvider.
Comment 3 Sebastian Zarnekow CLA 2013-04-19 05:56:25 EDT
The code templates languages uses something like a language registry, too
Comment 4 Moritz Eysholdt CLA 2013-04-19 09:17:57 EDT
I've implemented a language registry for Xpect, too:
https://github.com/meysholdt/Xpect/blob/master/org.xpect/src/org/xpect/registry/ILanguageInfo.java