}
}
// try and make one
final ILaunchConfigurationType launchConfigurationType = launchManager
.getLaunchConfigurationType(IErlangLaunchDelegateConstants.CONFIGURATION_TYPE);
ILaunchConfigurationWorkingCopy wc = null;
wc = launchConfigurationType.newInstance(null, name);
wc.setAttribute(ErlRuntimeAttributes.PROJECTS,
ListsUtils.packList(projectNames, PROJECT_NAME_SEPARATOR));
wc.setAttribute(ErlRuntimeAttributes.RUNTIME_NAME, projects.iterator().next()
.getRuntimeInfo().getName());
wc.setAttribute(ErlRuntimeAttributes.NODE_NAME, name);
wc.setAttribute(ErlRuntimeAttributes.USE_LONG_NAME,
!HostnameUtils.canUseShortNames()); // prefer short names
wc.setAttribute(ErlRuntimeAttributes.CONSOLE, true);
wc.setAttribute(ErlRuntimeAttributes.INTERNAL, false);
wc.setAttribute(ErlRuntimeAttributes.LOAD_ALL_NODES, false);
wc.setAttribute(ErlRuntimeAttributes.COOKIE, "erlide");
final Map<String, String> map = Maps.newHashMap();
wc.setAttribute("org.eclipse.debug.core.environmentVariables", map);
if ("debug".equals(mode)) {
final List<String> moduleNames = getProjectAndModuleNames(projects);
wc.setAttribute(ErlRuntimeAttributes.DEBUG_INTERPRET_MODULES, moduleNames);
}
wc.setMappedResources(getProjectResources(projects));
return wc.doSave();
}