From 776a32c75e451ad725b3dd390bb4b43f747692c3 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Fri, 19 Jan 2018 12:24:01 -0500 Subject: [PATCH] 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 (cherry picked from commit 746993c9eed534783dbaf563d6ba8280e27a84f4) --- .../ui/launch/CApplicationLaunchShortcut.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/CApplicationLaunchShortcut.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/CApplicationLaunchShortcut.java index e3f86ff5d05..e22d04ba2b0 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/CApplicationLaunchShortcut.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/launch/CApplicationLaunchShortcut.java @@ -63,6 +63,8 @@ import org.eclipse.ui.dialogs.ElementListSelectionDialog; import org.eclipse.ui.dialogs.TwoPaneElementSelector; public class CApplicationLaunchShortcut implements ILaunchShortcut2 { + private final static String CONNECTION_URI = "org.eclipse.cdt.docker.launcher.connection_uri"; //$NON-NLS-1$ + @Override public void launch(IEditorPart editor, String mode) { searchAndLaunch(new Object[] { editor.getEditorInput() }, mode); @@ -98,9 +100,12 @@ public class CApplicationLaunchShortcut implements ILaunchShortcut2 { IPath programPath = CDebugUtils.getProgramPath(config); String projectName = CDebugUtils.getProjectName(config); IPath name = bin.getResource().getProjectRelativePath(); - if (programPath != null && programPath.equals(name)) { - if (projectName != null && projectName.equals(bin.getCProject().getProject().getName())) { - candidateConfigs.add(config); + // don't match any launch config that is used for a Container launch + if (config.getAttribute(CONNECTION_URI, "").isEmpty()) { //$NON-NLS-1$ + if (programPath != null && programPath.equals(name)) { + if (projectName != null && projectName.equals(bin.getCProject().getProject().getName())) { + candidateConfigs.add(config); + } } } }