Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341042 - [Services] Allow to retrieve a resource service provider for a given language id
Summary: [Services] Allow to retrieve a resource service provider for a given language id
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-26 15:46 EDT by Sebastian Zarnekow CLA
Modified: 2013-04-19 09:17 EDT (History)
2 users (show)

See Also:
sebastian.zarnekow: indigo+


Attachments

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