Community
Participate
Working Groups
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.
> Btw: Why are the methods in the registry called getXYZTo_Factory_Map()? Not sure what you mean?
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.
The code templates languages uses something like a language registry, too
I've implemented a language registry for Xpect, too: https://github.com/meysholdt/Xpect/blob/master/org.xpect/src/org/xpect/registry/ILanguageInfo.java