Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.core.externaltools/src')
-rw-r--r--org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java
index aba44bbcd..d316f27e9 100644
--- a/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java
+++ b/org.eclipse.core.externaltools/src/org/eclipse/core/externaltools/internal/launchConfigurations/ExternalToolsCoreUtil.java
@@ -234,8 +234,16 @@ public class ExternalToolsCoreUtil {
return projects;
}
} else if (scope.equals("${project}")) { //$NON-NLS-1$
- if(configuration.getFile()!=null)
- return new IProject[]{((IResource)configuration.getFile()).getProject()};
+ IStringVariableManager manager = VariablesPlugin.getDefault().getStringVariableManager();
+ try {
+ String pathString = manager.performStringSubstitution("${selected_resource_path}"); //$NON-NLS-1$
+ IResource res = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(pathString));
+ if (res != null && res.getProject() != null) {
+ return new IProject[]{res.getProject()};
+ }
+ } catch (CoreException e) {
+ // unable to resolve a selection
+ }
}
return new IProject[0];
}

Back to the top