void (@NotNull ContentEntry contentEntry, @NotNull IdeModifiableModelsProvider modelsProvider, @Nullable ProjectSystemId owner, @NotNull Project project) { if (owner == null) { return; // can not remove imported exclude folders is source is not known } if (modelsProvider instanceof IdeModifiableModelsProviderImpl impl) { MutableEntityStorage diff = impl.getActualStorageBuilder(); VirtualFileUrl vfu = project.getService(VirtualFileUrlManager.class).fromUrl(contentEntry.getUrl()); Pair<WorkspaceEntity, String> result = ContainerUtil.find(diff.getVirtualFileUrlIndex().findEntitiesByUrl(vfu).iterator(), pair -> { return "url".equals(pair.component2()) && pair.component1() instanceof ContentRootEntity; }); if (result != null && result.component1() instanceof ContentRootEntity contentRootEntity) { for (ExcludeUrlEntity excludeEntity : contentRootEntity.getExcludedUrls()) { if (isImportedEntity(owner, excludeEntity)) { diff.removeEntity(excludeEntity); } } } } }