private CachedValue<Map<String, XmlElementDescriptor>> doBuildDeclarationMap() {
    return CachedValuesManager.getManager(myElement.getProject()).createCachedValue(() -> {
      final List<XmlElementDecl> result = new ArrayList<>();
      myElement.processElements(new FilterElementProcessor(new ClassFilter(XmlElementDecl.class), result), getDeclaration());
      final Map<String, XmlElementDescriptor> ret = new LinkedHashMap<>((int)(result.size() * 1.5));
      Set<PsiFile> dependencies = new HashSet<>(1);
      dependencies.add(myDescriptorFile);

      for (final XmlElementDecl xmlElementDecl : result) {
        final String name = xmlElementDecl.getName();
        if (name != null) {
          if (!ret.containsKey(name)) {
            ret.put(name, new XmlElementDescriptorImpl(xmlElementDecl));
            // if element descriptor was produced from entity reference use proper dependency
            PsiElement dependingElement = xmlElementDecl.getUserData(XmlElement.DEPENDING_ELEMENT);
            if (dependingElement != null) {
              PsiFile dependingElementContainingFile = dependingElement.getContainingFile();
              if (dependingElementContainingFile != null) dependencies.add(dependingElementContainingFile);
            }
          }
        }
      }
      return new CachedValueProvider.Result<>(ret, dependencies.toArray());
     }, false);
  }
private CachedValue<Map<String, XmlElementDescriptor>> doBuildDeclarationMap()