void () { final MatchResultImpl result = getResult(); final boolean complexMatch = myMatchedNodes.size() > 1; final PsiElement match = myMatchedNodes.get(0); if (!complexMatch) { result.setMatch(match); result.setMatchImage(match.getText()); } else { for (final PsiElement matchStatement : myMatchedNodes) { result.addChild(new MatchResultImpl(MatchResult.LINE_MATCH, matchStatement.getText(), matchStatement, 0, -1, false)); } result.setMatch(match); result.setMatchImage(match.getText()); result.setName(MatchResult.MULTI_LINE_MATCH); } getSink().newMatch(result); }