void (@NotNull PatternDefinition definition, @NotNull Map<String, List<PsiElement>> map) { for (Map.Entry<String, List<PsiElement>> entry : map.entrySet()) { String componentName = definition.namesToComponent.get(entry.getKey()); for (PsiElement element : entry.getValue()) { CommentTracker tracker = new CommentTracker(); if (element instanceof PsiExpression expression) { PsiReplacementUtil.replaceExpressionAndShorten(expression, componentName, tracker); } } } }