@@ -0,0 +1,2028 @@
+// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.%0Apackage com.intellij.ide.impl;%0A%0Aimport com.intellij.openapi.application.ApplicationManager;%0Aimport com.intellij.openapi.module.Module;%0Aimport com.intellij.openapi.module.ModuleManager;%0Aimport com.intellij.openapi.project.Project;%0Aimport com.intellij.openapi.roots.ContentEntry;%0Aimport com.intellij.openapi.roots.ModifiableRootModel;%0Aimport com.intellij.openapi.roots.ModuleRootManager;%0Aimport com.intellij.openapi.util.Ref;%0Aimport com.intellij.openapi.vfs.LocalFileSystem;%0Aimport com.intellij.openapi.vfs.VfsUtilCore;%0Aimport com.intellij.openapi.vfs.VirtualFile;%0Aimport com.intellij.platform.DirectoryProjectConfigurator;%0Aimport org.jetbrains.annotations.NotNull;%0A%0Apublic class NoContentRootProjectConfigurator implements DirectoryProjectConfigurator %7B%0A  @Override%0A  public void configureProject(@NotNull Project project,%0A                               @NotNull final VirtualFile baseDir,%0A                               @NotNull final Ref%3CModule%3E moduleRef,%0A                               boolean isProjectCreatedWithWizard) %7B%0A    VirtualFile projectsRoot = LocalFileSystem.getInstance().findFileByPath(ProjectUtil.getProjectsPath());%0A    if (projectsRoot == null %7C%7C !VfsUtilCore.isAncestor(projectsRoot, baseDir, true)) return;%0A%0A    ApplicationManager.getApplication().runWriteAction(() -%3E %7B%0A      for (Module module : ModuleManager.getInstance(project).getModules()) %7B%0A        ModuleRootManager rootManager = ModuleRootManager.getInstance(module);%0A        ModifiableRootModel rootModel = rootManager.getModifiableModel();%0A        for (ContentEntry entry : rootModel.getContentEntries()) %7B%0A          VirtualFile entryFile = entry.getFile();%0A          if (entryFile != null && VfsUtilCore.isAncestor(projectsRoot, entryFile, true)) %7B%0A            rootModel.removeContentEntry(entry);%0A          %7D%0A        %7D%0A        rootModel.inheritSdk();%0A        rootModel.commit();%0A      %7D%0A    %7D);%0A  %7D%0A%7D%0A

move DataGripProjectConfigurator to platform