List<TagInfo> (final @NotNull XmlFile file, final @NotNull XmlTag context) { final Set<String> namespaces = ContainerUtil.newHashSet(context.knownNamespaces()); final List<XmlSchemaProvider> providers = XmlSchemaProvider.getAvailableProviders(file); for (XmlSchemaProvider provider : providers) { namespaces.addAll(provider.getAvailableNamespaces(file, null)); } List<String> nsInfo = new ArrayList<>(); List<XmlElementDescriptor> descriptors = TagNameVariantCollector.getTagDescriptors(context, namespaces, nsInfo); final List<TagInfo> set = new ArrayList<>(); for (int i = 0; i < descriptors.size(); i++) { final XmlElementDescriptor descriptor = descriptors.get(i); String qualifiedName = descriptor.getName(context); LOG.assertTrue(qualifiedName != null, descriptor + " returned null name"); final int pos = qualifiedName.indexOf(':'); final String name = pos >= 0 ? qualifiedName.substring(pos + 1) : qualifiedName; set.add(new TagInfo(name, nsInfo.get(i)) { @Override public @Nullable PsiElement getDeclaration() { return descriptor.getDeclaration(); } }); } return set; }