void (@NotNull String name, @NotNull Processor<? super NavigationItem> processor, @NotNull FindSymbolParameters parameters) { boolean[] result = {true}; PsiManager psiManager = PsiManager.getInstance(parameters.getProject()); FileBasedIndex.getInstance().getFilesWithKey( RelaxSymbolIndex.NAME, Collections.singleton(name), file -> { PsiFile psiFile = psiManager.findFile(file); Grammar grammar = psiFile instanceof XmlFile ? GrammarFactory.getGrammar((XmlFile)psiFile) : null; if (grammar == null) return true; grammar.acceptChildren(new CommonElement.Visitor() { @Override public void visitDefine(Define define) { if (!result[0]) return; if (name.equals(define.getName())) { NavigationItem wrapped = wrap(define.getPsiElement()); result[0] = wrapped == null || processor.process(wrapped); } } }); return result[0]; }, parameters.getSearchScope()); }