boolean (@NotNull DomFileElement<?> domFileElement, @NotNull Class<? extends DomElement> clazz) { final VirtualFile file = domFileElement.getFile().getVirtualFile(); if (!(file instanceof VirtualFileWithId)) return false; final String clazzName = clazz.getName(); CommonProcessors.FindFirstProcessor<? super PsiFile> processor = new CommonProcessors.FindFirstProcessor<>(); StubIndex.getInstance().processElements(KEY, clazzName, domFileElement.getFile().getProject(), GlobalSearchScope.fileScope(domFileElement.getFile()), PsiFile.class, processor ); return processor.isFound(); }