this.services = new HashMap<String, ContainerService>();
if(this.sources.contains(Source.COMPILER)) {
for(Map.Entry<String, String> entry: ServiceXmlParserFactory.getInstance(project, XmlServiceParser.class).getServiceMap().getMap().entrySet()) {
services.put(entry.getKey(), new ContainerService(entry.getKey(), entry.getValue()));
}
}
if(this.sources.contains(Source.INDEX)) {
SymfonyProcessors.CollectProjectUniqueKeysStrong projectUniqueKeysStrong = new SymfonyProcessors.CollectProjectUniqueKeysStrong(project, ServicesDefinitionStubIndex.KEY, this.services.keySet());
FileBasedIndexImpl.getInstance().processAllKeys(ServicesDefinitionStubIndex.KEY, projectUniqueKeysStrong, project);
for(String serviceName: projectUniqueKeysStrong.getResult()) {
// we have higher priority on compiler, which already has safe value
if(!this.services.containsKey(serviceName)) {
List<String[]> serviceDefinitions = FileBasedIndexImpl.getInstance().getValues(ServicesDefinitionStubIndex.KEY, serviceName, GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.allScope(project), XmlFileType.INSTANCE, YAMLFileType.YML));
if(serviceDefinitions.size() == 0) {
this.services.put(serviceName, new ContainerService(serviceName, null, true));
} else {
this.services.putAll(convertIndexToService(serviceName, serviceDefinitions));
}