1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-11 18:25:40 +02:00

Bug 530053 - Launching locally after Container launch doesn't work

- add logic in CApplicationLaunchShortcut find launch configs to
  discard any launch config that has a Docker Connection URI
  attribute

Change-Id: Ieb53f4c89b24cd3fac01bec35eafc8c62748d0b3
This commit is contained in:
Jeff Johnston 2018-01-19 12:24:01 -05:00
parent a4599f7c36
commit 746993c9ee

View file

@ -63,6 +63,8 @@ import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.ui.dialogs.TwoPaneElementSelector; import org.eclipse.ui.dialogs.TwoPaneElementSelector;
public class CApplicationLaunchShortcut implements ILaunchShortcut2 { public class CApplicationLaunchShortcut implements ILaunchShortcut2 {
private final static String CONNECTION_URI = "org.eclipse.cdt.docker.launcher.connection_uri"; //$NON-NLS-1$
@Override @Override
public void launch(IEditorPart editor, String mode) { public void launch(IEditorPart editor, String mode) {
searchAndLaunch(new Object[] { editor.getEditorInput() }, mode); searchAndLaunch(new Object[] { editor.getEditorInput() }, mode);
@ -98,9 +100,12 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut2 {
IPath programPath = CDebugUtils.getProgramPath(config); IPath programPath = CDebugUtils.getProgramPath(config);
String projectName = CDebugUtils.getProjectName(config); String projectName = CDebugUtils.getProjectName(config);
IPath name = bin.getResource().getProjectRelativePath(); IPath name = bin.getResource().getProjectRelativePath();
if (programPath != null && programPath.equals(name)) { // don't match any launch config that is used for a Container launch
if (projectName != null && projectName.equals(bin.getCProject().getProject().getName())) { if (config.getAttribute(CONNECTION_URI, "").isEmpty()) { //$NON-NLS-1$
candidateConfigs.add(config); if (programPath != null && programPath.equals(name)) {
if (projectName != null && projectName.equals(bin.getCProject().getProject().getName())) {
candidateConfigs.add(config);
}
} }
} }
} }