void (IndexPatternSearch.SearchParameters queryParameters, Processor<? super IndexPatternOccurrence> consumer) { final IndexPatternProvider patternProvider = queryParameters.getPatternProvider(); final PsiFile file = queryParameters.getFile(); final CharSequence chars = file.getViewProvider().getContents(); boolean multiLine = queryParameters.isMultiLine(); List<CommentRange> commentRanges = findCommentTokenRanges(file, chars, queryParameters.getRange(), multiLine); IntList occurrences = new IntArrayList(1); IndexPattern[] patterns = patternProvider != null ? patternProvider.getIndexPatterns() : new IndexPattern[] {queryParameters.getPattern()}; for (int i = 0; i < commentRanges.size(); i++) { occurrences.clear(); for (int j = patterns.length - 1; j >=0; --j) { if (!collectPatternMatches(patterns, patterns[j], chars, commentRanges, i, file, queryParameters.getRange(), consumer, occurrences, multiLine)) { return; } } } }