boolean (PsiElement host) { final Project project = host.getProject(); final Configuration configuration = Configuration.getProjectInstance(project); final ArrayList<BaseInjection> injections = collectInjections(host, configuration); if (injections.isEmpty()) return false; final ArrayList<BaseInjection> newInjections = new ArrayList<>(); for (BaseInjection injection : injections) { final BaseInjection newInjection = injection.copy(); newInjection.setPlaceEnabled(null, false); if (InjectorUtils.canBeRemoved(newInjection)) continue; newInjections.add(newInjection); } configuration.replaceInjectionsWithUndo( project, host.getContainingFile(), newInjections, injections, Collections.emptyList()); return true; }