void (@NotNull Processor<? super YAMLKeyNavigationItem> consumer, @NotNull String pattern, ProgressIndicator progressIndicator) { if (ActionUtil.isDumbMode(myProject)) { return; } assert myProject != null; Collection<String> allKeys = FileBasedIndex.getInstance().getAllKeys(YAMLKeysIndex.KEY, myProject); List<String> sorted = applyPattern(allKeys, pattern, progressIndicator); boolean everywhere = SearchEverywhereManager.getInstance(myProject).isEverywhere(); for (String name : sorted) { progressIndicator.checkCanceled(); CommonProcessors.CollectProcessor<VirtualFile> files = new CommonProcessors.CollectProcessor<>(); GlobalSearchScope filter = everywhere ? ProjectScope.getAllScope(myProject) : ProjectScope.getProjectScope(myProject); FileBasedIndex.getInstance().getFilesWithKey(YAMLKeysIndex.KEY, Collections.singleton(name), files, filter); for (VirtualFile file : files.getResults()) { PsiFile psiFile = PsiManager.getInstance(myProject).findFile(file); if (psiFile == null) { continue; } Integer position = FileBasedIndex.getInstance().getFileData(YAMLKeysIndex.KEY, file, myProject).get(name); if (position != null) { Navigatable navigatable = PsiNavigationSupport.getInstance().createNavigatable(myProject, file, position); if (!consumer.process(new YAMLKeyNavigationItem(myProject, name, file, position))) { return; } } } } }