void (@NotNull Project project) { final SmartPointerManager manager = SmartPointerManager.getInstance(project); if (MatchResult.MULTI_LINE_MATCH.equals(matchResult.getName())) { final Iterator<MatchResult> i = matchResult.getChildren().iterator(); while (i.hasNext()) { final MatchResult r = i.next(); if (MatchResult.LINE_MATCH.equals(r.getName())) { PsiElement element = r.getMatch(); if (element instanceof PsiDocCommentBase) { // doc comment is not collapsed when created in block if (i.hasNext()) { final MatchResult son = i.next(); if (!MatchResult.LINE_MATCH.equals(son.getName()) || !StructuralSearchUtil.isDocCommentOwner(son.getMatch())) { matchesPtrList.add(manager.createSmartPsiElementPointer(element)); } element = son.getMatch(); } } matchesPtrList.add(manager.createSmartPsiElementPointer(element)); } } } else { matchesPtrList.add(manager.createSmartPsiElementPointer(matchResult.getMatch())); } }