Set<String> uniqueTags = new HashSet<String>();
XmlTagParser xmlEventParser = ServiceXmlParserFactory.getInstance(project, XmlTagParser.class);
for(String tag: xmlEventParser.get()) {
uniqueTags.add(tag);
lookupElements.add(new ContainerTagLookupElement(tag));
}
SymfonyProcessors.CollectProjectUniqueKeys projectUniqueKeysStrong = new SymfonyProcessors.CollectProjectUniqueKeys(project, ServicesTagStubIndex.KEY);
FileBasedIndexImpl.getInstance().processAllKeys(ServicesTagStubIndex.KEY, projectUniqueKeysStrong, project);
for(String serviceName: projectUniqueKeysStrong.getResult()) {
List<String[]> tags = FileBasedIndexImpl.getInstance().getValues(ServicesTagStubIndex.KEY, serviceName, GlobalSearchScope.getScopeRestrictedByFileTypes(GlobalSearchScope.allScope(project), XmlFileType.INSTANCE, YAMLFileType.YML));
for(String[] tagDef: tags) {
for(String tag: tagDef) {
if(!uniqueTags.contains(tag)) {
uniqueTags.add(tag);
lookupElements.add(new ContainerTagLookupElement(tag, true));
}
}
}
}
return lookupElements;