use of org.eclipse.xtext.resource.IResourceServiceProvider in project xtext-core by eclipse.
the class SyntacticSequencerTestLanguageStandaloneSetupGenerated method register.
public void register(Injector injector) {
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("syntacticsequencertestlanguage", resourceFactory);
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("syntacticsequencertestlanguage", serviceProvider);
if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2009/tmf/xtext/syntacticsequencertestlanguage")) {
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2009/tmf/xtext/syntacticsequencertestlanguage", SyntacticsequencertestPackage.eINSTANCE);
}
}
use of org.eclipse.xtext.resource.IResourceServiceProvider in project xtext-core by eclipse.
the class ContextFinderTestLanguageStandaloneSetupGenerated method register.
public void register(Injector injector) {
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("contextfindertestlanguage", resourceFactory);
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("contextfindertestlanguage", serviceProvider);
if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2009/tmf/xtext/contextfindertestlanguage")) {
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2009/tmf/xtext/contextfindertestlanguage", ContextFinderTestPackage.eINSTANCE);
}
}
use of org.eclipse.xtext.resource.IResourceServiceProvider in project xtext-core by eclipse.
the class SequencerTestLanguageStandaloneSetupGenerated method register.
public void register(Injector injector) {
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("sequencertestlanguage", resourceFactory);
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("sequencertestlanguage", serviceProvider);
if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2009/tmf/xtext/sequencertestlanguage")) {
EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2009/tmf/xtext/sequencertestlanguage", SequencertestPackage.eINSTANCE);
}
}
use of org.eclipse.xtext.resource.IResourceServiceProvider in project xtext-core by eclipse.
the class WorkspaceSymbolService method getSymbols.
public List<? extends SymbolInformation> getSymbols(String query, IResourceAccess resourceAccess, IResourceDescriptions indexData, CancelIndicator cancelIndicator) {
List<SymbolInformation> result = new LinkedList<>();
for (IResourceDescription resourceDescription : indexData.getAllResourceDescriptions()) {
operationCanceledManager.checkCanceled(cancelIndicator);
IResourceServiceProvider resourceServiceProvider = registry.getResourceServiceProvider(resourceDescription.getURI());
if (resourceServiceProvider != null) {
DocumentSymbolService documentSymbolService = resourceServiceProvider.get(DocumentSymbolService.class);
if (documentSymbolService != null) {
result.addAll(documentSymbolService.getSymbols(resourceDescription, query, resourceAccess, cancelIndicator));
}
}
}
return result;
}
use of org.eclipse.xtext.resource.IResourceServiceProvider in project xtext-core by eclipse.
the class WrappingInjectorProvider method registerFactory.
private void registerFactory(Injector injector) {
IResourceFactory factory = injector.getInstance(IResourceFactory.class);
IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
FileExtensionProvider fileExtensionProvider = injector.getInstance(FileExtensionProvider.class);
for (String ext : fileExtensionProvider.getFileExtensions()) {
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(ext, factory);
IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put(ext, serviceProvider);
}
}
Aggregations