in ideaSupport/src/main/scala/org/jetbrains/sbtidea/tasks/IdeaConfigBuilder.scala [179:217]
private def buildRunConfigurationXML(
configurationName: String,
vmOptions: VmOptions,
programParams: String,
envVars: Map[String, String],
): String = {
val envVarsSection = createEnvironmentVariablesSection(envVars)
val vmOptionsStr = buildRunVmOptionsString(vmOptions)
val moduleName = generateModuleName(sourceSetModuleSuffix = "main")
// We only run the "Build Artifacts" before lunch.
// It transitively triggers the "Build" under the hood, ensuring incremental compilation of any changes.
val buildArtifactsStepText = s"""<option name="BuildArtifacts" enabled="true"><artifact name="$artifactName" /></option>"""
s"""<component name="ProjectRunConfigurationManager">
| <configuration default="false" name="$configurationName" type="Application" factoryName="Application">
| $jreSettings
| <log_file alias="IJ LOG" path="$dataDir/system/log/idea.log" />
| <log_file alias="JPS LOG" path="$dataDir/system/log/build-log/build.log" />
| <option name="MAIN_CLASS_NAME" value="com.intellij.idea.Main" />
| <module name="$moduleName" />
| <option name="VM_PARAMETERS" value="$vmOptionsStr" />
| <RunnerSettings RunnerId="Debug">
| <option name="DEBUG_PORT" value="" />
| <option name="TRANSPORT" value="0" />
| <option name="LOCAL" value="true" />
| </RunnerSettings>
| <option name="PROGRAM_PARAMETERS" value="$programParams" />
| <RunnerSettings RunnerId="Profile " />
| <RunnerSettings RunnerId="Run" />
| <ConfigurationWrapper RunnerId="Debug" />
| <ConfigurationWrapper RunnerId="Run" />
| $envVarsSection
| <method v="2">
| $buildArtifactsStepText
| </method>
| </configuration>
|</component>""".stripMargin
}