void (@NotNull final Project project, @NotNull ProblemDescriptor descriptor) { if (!FileModificationService.getInstance().preparePsiElementForWrite(descriptor.getPsiElement())) return; PsiFile psiFile = myPointer.getContainingFile(); final PsiClass element = myPointer.getElement(); if (element == null) { LOG.info("Element is null for PsiPointer: " + myPointer); return; } LOG.assertTrue(psiFile != null); final Module module = ModuleUtilCore.findModuleForFile(psiFile.getVirtualFile(), project); assert module != null; Runnable command = () -> { try { XmlFile pluginXml = PluginModuleType.getPluginXml(module); if (pluginXml == null) { pluginXml = DevkitActionsUtil.choosePluginModuleDescriptor(psiFile.getContainingDirectory()); } if (pluginXml != null) { DescriptorUtil.patchPluginXml(this, element, pluginXml); } CommandProcessor.getInstance().markCurrentCommandAsGlobal(project); } catch (IncorrectOperationException e) { Messages.showMessageDialog(project, filterMessage(e.getMessage()), DevKitBundle.message("inspections.component.not.registered.quickfix.error", getType()), Messages.getErrorIcon()); } }; CommandProcessor.getInstance().executeCommand(project, command, getName(), null); }