void (@NotNull Project project, @Nullable Module module, @NotNull List<? extends VirtualFile> files, boolean add) { if (module == null) module = getAttachTargetModule(project); if (module == null) module = createDefaultModule(project); ModuleRootModificationUtil.updateModel(module, model -> { if (add) { for (VirtualFile file : files) { model.addContentEntry(file); } } else { for (ContentEntry entry : model.getContentEntries()) { if (files.contains(entry.getFile())) { model.removeContentEntry(entry); } } } }); }