boolean (final PsiLanguageInjectionHost psiElement) { if (!isMine(psiElement)) return false; final HashMap<BaseInjection, Pair<PsiMethod, Integer>> injectionsMap = new HashMap<>(); final ArrayList<PsiElement> annotations = new ArrayList<>(); final PsiLiteralExpression host = (PsiLiteralExpression)psiElement; final Project project = host.getProject(); final Configuration configuration = Configuration.getProjectInstance(project); collectInjections(host, configuration, this, injectionsMap, annotations); if (injectionsMap.isEmpty() || !annotations.isEmpty()) return false; final BaseInjection originalInjection = injectionsMap.keySet().iterator().next(); final MethodParameterInjection methodParameterInjection = createFrom(psiElement.getProject(), originalInjection, injectionsMap.get(originalInjection).first, false); final MethodParameterInjection copy = methodParameterInjection.copy(); final BaseInjection newInjection = showInjectionUI(project, methodParameterInjection); if (newInjection != null) { newInjection.mergeOriginalPlacesFrom(copy, false); newInjection.mergeOriginalPlacesFrom(originalInjection, true); configuration.replaceInjectionsWithUndo( project, psiElement.getContainingFile(), Collections.singletonList(newInjection), Collections.singletonList(originalInjection), Collections.<PsiAnnotation>emptyList()); } return true; }