<commit_before>package org.jetbrains.sbt
package project.data
package service

import com.intellij.compiler.impl.javaCompiler.javac.JavacConfiguration
import com.intellij.compiler.{CompilerConfiguration, CompilerConfigurationImpl}
import com.intellij.openapi.externalSystem.model.DataNode
import com.intellij.openapi.externalSystem.model.project.ProjectData
import com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProvider
import com.intellij.openapi.module.ModuleUtil
import com.intellij.openapi.project.Project
import com.intellij.openapi.roots.{LanguageLevelProjectExtension, ProjectRootManager}
import org.jetbrains.plugins.scala.project.IncrementalityType
import org.jetbrains.plugins.scala.project.settings.ScalaCompilerConfiguration
import org.jetbrains.plugins.scala.settings.ScalaProjectSettings
import org.jetbrains.sbt.project.sources.SharedSourcesModuleType
import org.jetbrains.sbt.settings.SbtSystemSettings

import scala.collection.JavaConverters._

/**
 * @author <NAME>
 */
class SbtProjectDataService extends AbstractDataService[SbtProjectData, Project](SbtProjectData.Key) {
  override def createImporter(toImport: Seq[DataNode[SbtProjectData]],
                              projectData: ProjectData,
                              project: Project,
                              modelsProvider: IdeModifiableModelsProvider): Importer[SbtProjectData] =
    new SbtProjectDataService.Importer(toImport, projectData, project, modelsProvider)
}

object SbtProjectDataService {

  private class Importer(dataToImport: Seq[DataNode[SbtProjectData]],
                         projectData: ProjectData,<commit_msg>SBT: don't create dirs for empty content roots even while creating new project #SCL-13085 fixed<commit_after>package org.jetbrains.sbt
package project.data
package service

import com.intellij.compiler.impl.javaCompiler.javac.JavacConfiguration
import com.intellij.compiler.{CompilerConfiguration, CompilerConfigurationImpl}
import com.intellij.openapi.externalSystem.model.{DataNode, ProjectKeys}
import com.intellij.openapi.externalSystem.model.project.ProjectData
import com.intellij.openapi.externalSystem.service.project.IdeModifiableModelsProvider
import com.intellij.openapi.externalSystem.service.project.manage.ContentRootDataService
import com.intellij.openapi.externalSystem.util.ExternalSystemApiUtil
import com.intellij.openapi.module.ModuleUtil
import com.intellij.openapi.project.Project
import com.intellij.openapi.roots.{LanguageLevelProjectExtension, ProjectRootManager}
import org.jetbrains.plugins.scala.project.IncrementalityType
import org.jetbrains.plugins.scala.project.settings.ScalaCompilerConfiguration
import org.jetbrains.plugins.scala.settings.ScalaProjectSettings
import org.jetbrains.sbt.project.sources.SharedSourcesModuleType
import org.jetbrains.sbt.settings.SbtSystemSettings

import scala.collection.JavaConverters._

/**
 * @author <NAME>
 */
class SbtProjectDataService extends AbstractDataService[SbtProjectData, Project](SbtProjectData.Key) {
  override def createImporter(toImport: Seq[DataNode[SbtProjectData]],
                              projectData: ProjectData,
                              project: Project,
                              modelsProvider: IdeModifiableModelsProvider): Importer[SbtProjectData] = {
    for {
      head <- toImport.headOption
      projectData <- Option(ExternalSystemApiUtil.findParent(head, ProjectKeys.PROJECT))
    } {
      projectData.removeUserData(ContentRootDataService.CREATE_EMPTY_DIRECTORIES) //we don't need creating empty dirs anyway
    }
    
    new SbtProjectDataService.Importer(toImport, projectData, project, modelsProvider)
  }
}

object SbtProjectDataService {

  private class Importer(dataToImport: Seq[DataNode[SbtProjectData]],
                         projectData: ProjectData,
{'fraction_non_alphanumeric': 0.07822685788787484, 'fraction_numerical': 0.001303780964797914, 'mean_word_length': 4.8744257274119445, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1377947', 'n_tokens_mistral': 1070, 'n_tokens_neox': 1036, 'n_words': 166}