<commit_before>/*
 * Copyright (c) Salomon Automation GmbH
 */
package com.wamas.ide.launching.generator

import com.google.common.base.Joiner
import com.google.inject.Inject
import com.wamas.ide.launching.Activator
import com.wamas.ide.launching.lcDsl.GroupPostLaunchAction
import com.wamas.ide.launching.lcDsl.GroupPostLaunchDelay
import com.wamas.ide.launching.lcDsl.GroupPostLaunchRegex
import com.wamas.ide.launching.lcDsl.GroupPostLaunchWait
import com.wamas.ide.launching.lcDsl.LaunchConfig
import com.wamas.ide.launching.lcDsl.LaunchConfigType
import com.wamas.ide.launching.services.LcDslPostProcessor
import java.io.File
import java.util.Map
import java.util.TreeSet
import org.eclipse.core.resources.ResourcesPlugin
import org.eclipse.core.runtime.IStatus
import org.eclipse.debug.core.DebugPlugin
import org.eclipse.debug.core.ILaunchConfiguration
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy
import org.eclipse.debug.core.ILaunchManager
import org.eclipse.debug.internal.core.groups.GroupLaunchConfigurationDelegate
import org.eclipse.debug.internal.core.groups.GroupLaunchElement
import org.eclipse.debug.ui.IDebugUIConstants
import org.eclipse.emf.common.util.Diagnostic
import org.eclipse.emf.ecore.util.Diagnostician
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants
import org.eclipse.pde.core.plugin.PluginRegistry
import org.eclipse.pde.core.plugin.TargetPlatform
import org.eclipse.pde.internal.core.product.WorkspaceProductModel
import org.eclipse.pde.internal.launching.IPDEConstants
import org.eclipse.pde.launching.IPDELauncherConstants
import org.eclipse.pde.ui.launcher.EclipseLaunchShortcut
import org.eclipse.xtext.naming.IQualifiedNameProvider

import static extension com.wamas.ide.launching.generator.RecursiveCollectors.*
import org.eclipse.pde.core.plugin.TargetPlatform
import org.eclipse.jdt.internal.junit.launcher.JUnitLaunchConfigurationConstants
import org.eclipse.jdt.internal.junit.launcher.TestKindRegistry
import org.eclipse.debug.internal.core.LaunchConfiguration

class StandaloneLaunchConfigGenerator {

	@Inject
	extension IQualifiedNameProvider qnp

	val knownStartLevels = newHashMap(
		"org.eclipse.osgi" -> "@-1:true",
		"org.eclipse.equinox.ds" -> "@1:true",
		"org.eclipse.equinox.common" -> "@2:true"
	)
	val launchMgr = DebugPlugin.^default.launchManager

	public static final String CONFIGURATION_TYPE_RAP = "org.eclipse.rap.ui.launch.RAPLauncher";
	public static final String CONFIGURATION_TYPE_SWTBOT = "org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig";
	public static final String CONFIGURATION_TYPE_JUNIT = "org.eclipse.pde.ui.JunitLaunchConfig";	
	public static final String CONFIGURATION_TYPE_GROUP = "org.eclipse.debug.core.groups.GroupLaunchConfigurationType";

	static val TYPE_MAP = newHashMap(
		LaunchConfigType.JAVA -> IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION,
		LaunchConfigType.ECLIPSE -> EclipseLaunchShortcut.CONFIGURATION_TYPE,
		LaunchConfigType.SWTBOT -> CONFIGURATION_TYPE_SWTBOT,
		LaunchConfigType.JUNIT_PLUGIN -> CONFIGURATION_TYPE_JUNIT,
		LaunchConfigType.RAP -> CONFIGURATION_TYPE_RAP,
		LaunchConfigType.GROUP -> CONFIGURATION_TYPE_GROUP
	)

	static def getType(ILaunchManager mgr, LaunchConfigType type) {
		mgr.getLaunchConfigurationType(TYPE_MAP.get(type))
	}

	static def getTypeName(LaunchConfigType type) {
		TYPE_MAP.get(type)
	}
	
	def fullName(LaunchConfig c) {
		c.fullyQualifiedName?.toString
	}

	def ILaunchConfiguration generate(LaunchConfig c) {<commit_msg>Update default known start levels in LcDSL.<commit_after>/*
 * Copyright (c) Salomon Automation GmbH
 */
package com.wamas.ide.launching.generator

import com.google.common.base.Joiner
import com.google.inject.Inject
import com.wamas.ide.launching.Activator
import com.wamas.ide.launching.lcDsl.GroupPostLaunchAction
import com.wamas.ide.launching.lcDsl.GroupPostLaunchDelay
import com.wamas.ide.launching.lcDsl.GroupPostLaunchRegex
import com.wamas.ide.launching.lcDsl.GroupPostLaunchWait
import com.wamas.ide.launching.lcDsl.LaunchConfig
import com.wamas.ide.launching.lcDsl.LaunchConfigType
import com.wamas.ide.launching.services.LcDslPostProcessor
import java.io.File
import java.util.Map
import java.util.TreeSet
import org.eclipse.core.resources.ResourcesPlugin
import org.eclipse.core.runtime.IStatus
import org.eclipse.debug.core.DebugPlugin
import org.eclipse.debug.core.ILaunchConfiguration
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy
import org.eclipse.debug.core.ILaunchManager
import org.eclipse.debug.internal.core.groups.GroupLaunchConfigurationDelegate
import org.eclipse.debug.internal.core.groups.GroupLaunchElement
import org.eclipse.debug.ui.IDebugUIConstants
import org.eclipse.emf.common.util.Diagnostic
import org.eclipse.emf.ecore.util.Diagnostician
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants
import org.eclipse.pde.core.plugin.PluginRegistry
import org.eclipse.pde.core.plugin.TargetPlatform
import org.eclipse.pde.internal.core.product.WorkspaceProductModel
import org.eclipse.pde.internal.launching.IPDEConstants
import org.eclipse.pde.launching.IPDELauncherConstants
import org.eclipse.pde.ui.launcher.EclipseLaunchShortcut
import org.eclipse.xtext.naming.IQualifiedNameProvider

import static extension com.wamas.ide.launching.generator.RecursiveCollectors.*
import org.eclipse.pde.core.plugin.TargetPlatform
import org.eclipse.jdt.internal.junit.launcher.JUnitLaunchConfigurationConstants
import org.eclipse.jdt.internal.junit.launcher.TestKindRegistry
import org.eclipse.debug.internal.core.LaunchConfiguration

class StandaloneLaunchConfigGenerator {

	@Inject
	extension IQualifiedNameProvider qnp

	// also see org.eclipse.pde.internal.ui.editor.product.PluginConfigurationSection.getBundlesWithStartLevels()
	// for a list of known default start-levels which should be present.
	val knownStartLevels = newHashMap(
		"org.eclipse.osgi" -> "@-1:true",
		"org.apache.felix.scr" -> "@2:true",
		"org.eclipse.core.runtime" -> "@0:true",
		"org.eclipse.equinox.common" -> "@2:true",
		"org.eclipse.equinox.event" -> "@2:true",
		"org.eclipse.equinox.simpleconfigurator" -> "@1:true"
	)
	val launchMgr = DebugPlugin.^default.launchManager

	public static final String CONFIGURATION_TYPE_RAP = "org.eclipse.rap.ui.launch.RAPLauncher";
	public static final String CONFIGURATION_TYPE_SWTBOT = "org.eclipse.swtbot.eclipse.ui.launcher.JunitLaunchConfig";
	public static final String CONFIGURATION_TYPE_JUNIT = "org.eclipse.pde.ui.JunitLaunchConfig";	
	public static final String CONFIGURATION_TYPE_GROUP = "org.eclipse.debug.core.groups.GroupLaunchConfigurationType";

	static val TYPE_MAP = newHashMap(
		LaunchConfigType.JAVA -> IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION,
		LaunchConfigType.ECLIPSE -> EclipseLaunchShortcut.CONFIGURATION_TYPE,
		LaunchConfigType.SWTBOT -> CONFIGURATION_TYPE_SWTBOT,
		LaunchConfigType.JUNIT_PLUGIN -> CONFIGURATION_TYPE_JUNIT,
		LaunchConfigType.RAP -> CONFIGURATION_TYPE_RAP,
		LaunchConfigType.GROUP -> CONFIGURATION_TYPE_GROUP
	)

	static def getType(ILaunchManager mgr, LaunchConfigType type) {
		mgr.getLaunchConfigurationType(TYPE_MAP.get(type))
	}

	static def getTypeName(LaunchConfigType type) {
		TYPE_MAP.get(type)
	}
	
	def fullName(LaunchConfig c) {
		c.fullyQualifiedName?.toString
	}

	def ILaunchConfiguration generate(LaunchConfig c) {
{'fraction_non_alphanumeric': 0.09364412522021955, 'fraction_numerical': 0.0012196774630708767, 'mean_word_length': 6.285291214215202, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 24, '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': '7255205', 'n_tokens_mistral': 2408, 'n_tokens_neox': 2316, 'n_words': 350}