Repository: eclipse-corrosion/corrosion (language: rust)

Issue:
Cannot start debugging because the Working Directory is empty
I have to set Working Directory every time I open Debug Configurations Window. 
It won't save after I click Apply button and Close the window in currentt version 2018-09 (4.9.0) (Build id: 20180917-1800):

![image](https://user-images.githubusercontent.com/44570153/50044530-dda1b400-0095-11e9-86db-ebb5d593a6d5.png)

The main reason is that Arguments Tab is already has the Workind Directory field:

![image](https://user-images.githubusercontent.com/44570153/50044715-ee9ff480-0098-11e9-97a8-5283982a46cc.png)

and WorkingDirectoryBlock::performApply() method delete working directory value from the configuration (set it to null):

![image](https://user-images.githubusercontent.com/44570153/50044750-4e969b00-0099-11e9-8f2c-1b95808746aa.png)

Do we need to duplicate this setting on the first page?


Discussion / hints:
Can you please try a more recent build? Get the upcoming release of "Eclipse IDE for Rust developers" at https://www.eclipse.org/downloads/index-developer.php and check whether you can reproduce it.
There seems to be indeed room for improvement: the working directory `useDefault` could be always selected by default and deduced from the project location for instance.
I can reproduce it on latest build: Version: 2018-12 RC1 (4.10.0RC1), Build id: 20181206-2346

As I wrote above, I already investigated this issue using Eclipse for Commiters and found out that the **main tab** and **Arguments tab** have 2 different Working Directory fields. The "Apply button" code for Argument tab sets Working Directory value to null. So it won't save after user click Apply button and close the debug configuration window. 

I think there is no reason to duplicate this setting on the first page. 
You analysis is most likely correct. Do you feel like you could submit a patch for it?
Sure, just to clarify - is it better to delete Working Directory from main tab or Arguments tab? What do you think?
I don't have a strong opinion here and it's something we can easily change later if necessary. So I let you choose whichever your prefer ;)

Fix patch:
diff --git a/org.eclipse.corrosion.feature/feature.xml b/org.eclipse.corrosion.feature/feature.xml
index d432eb4..c963174 100644
--- a/org.eclipse.corrosion.feature/feature.xml
+++ b/org.eclipse.corrosion.feature/feature.xml
@@ -2,7 +2,7 @@
 <feature
       id="org.eclipse.corrosion.feature"
       label="%name"
-      version="0.3.0.qualifier"
+      version="0.4.0.qualifier"
       provider-name="Eclipse Corrosion"
       license-feature="org.eclipse.license"
       license-feature-version="0.0.0">
diff --git a/org.eclipse.corrosion.feature/pom.xml b/org.eclipse.corrosion.feature/pom.xml
index 959b25c..57234d4 100644
--- a/org.eclipse.corrosion.feature/pom.xml
+++ b/org.eclipse.corrosion.feature/pom.xml
@@ -4,7 +4,7 @@
 	<parent>
 		<groupId>org.eclipse.corrosion</groupId>
 		<artifactId>parent</artifactId>
-		<version>0.3.0-SNAPSHOT</version>
+		<version>0.4.0-SNAPSHOT</version>
 	</parent>
 	<packaging>eclipse-feature</packaging>
 </project>
\ No newline at end of file
diff --git a/org.eclipse.corrosion/META-INF/MANIFEST.MF b/org.eclipse.corrosion/META-INF/MANIFEST.MF
index efd974e..652228a 100644
--- a/org.eclipse.corrosion/META-INF/MANIFEST.MF
+++ b/org.eclipse.corrosion/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-SymbolicName: org.eclipse.corrosion;singleton:=true
-Bundle-Version: 0.3.0.qualifier
+Bundle-Version: 0.4.0.qualifier
 Automatic-Module-Name: org.eclipse.corrosion
 Bundle-Activator: org.eclipse.corrosion.CorrosionPlugin
 Bundle-Vendor: %Bundle-Vendor
diff --git a/org.eclipse.corrosion/pom.xml b/org.eclipse.corrosion/pom.xml
index e7721b9..85ceb5f 100644
--- a/org.eclipse.corrosion/pom.xml
+++ b/org.eclipse.corrosion/pom.xml
@@ -4,7 +4,7 @@
 	<parent>
 		<groupId>org.eclipse.corrosion</groupId>
 		<artifactId>parent</artifactId>
-		<version>0.3.0-SNAPSHOT</version>
+		<version>0.4.0-SNAPSHOT</version>
 	</parent>
 	<packaging>eclipse-plugin</packaging>
 	
diff --git a/org.eclipse.corrosion/src/org/eclipse/corrosion/debug/RustDebugDelegate.java b/org.eclipse.corrosion/src/org/eclipse/corrosion/debug/RustDebugDelegate.java
index 2dd8eb7..088e591 100644
--- a/org.eclipse.corrosion/src/org/eclipse/corrosion/debug/RustDebugDelegate.java
+++ b/org.eclipse.corrosion/src/org/eclipse/corrosion/debug/RustDebugDelegate.java
@@ -48,7 +48,7 @@
 import org.eclipse.ui.IEditorPart;
 
 public class RustDebugDelegate extends GdbLaunchDelegate implements ILaunchShortcut {
-	public static final String BUILD_COMMAND_ATTRIBUTE = CorrosionPlugin.PLUGIN_ID + "BUILD_COMMAND"; //$NON-NLS-1$
+	public static final String BUILD_COMMAND_ATTRIBUTE = CorrosionPlugin.PLUGIN_ID + ".BUILD_COMMAND"; //$NON-NLS-1$
 
 	@Override public void launch(ILaunchConfiguration config, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
 		ILaunchConfiguration configuration = launch.getLaunchConfiguration();
diff --git a/org.eclipse.corrosion/src/org/eclipse/corrosion/debug/RustDebugTab.java b/org.eclipse.corrosion/src/org/eclipse/corrosion/debug/RustDebugTab.java
index 7fa4f45..c2793cc 100644
--- a/org.eclipse.corrosion/src/org/eclipse/corrosion/debug/RustDebugTab.java
+++ b/org.eclipse.corrosion/src/org/eclipse/corrosion/debug/RustDebugTab.java
@@ -37,7 +37,6 @@ public class RustDebugTab extends AbstractLaunchConfigurationTab {
 	private InputComponent projectInput;
 	private InputComponent buildInput;
 	private OptionalDefaultInputComponent executableInput;
-	private OptionalDefaultInputComponent workingDirectoryInput;
 
 	private IProject project;
 
@@ -46,8 +45,6 @@ public void performApply(ILaunchConfigurationWorkingCopy configuration) {
 		configuration.setAttribute(RustDebugDelegate.BUILD_COMMAND_ATTRIBUTE, buildInput.getValue());
 		configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectInput.getValue());
 		configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, executableInput.getValue());
-		configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY,
-				workingDirectoryInput.getValue());
 		setDirty(false);
 	}
 
@@ -79,11 +76,6 @@ public void createControl(Composite parent) {
 				() -> getDefaultExecutablePath(project));
 		executableInput.createComponent();
 		executableInput.createResourceSelection(() -> project);
-
-		workingDirectoryInput = new OptionalDefaultInputComponent(container, Messages.LaunchUI_workingDirectory,
-				updateListener, () -> getDefaultWorkingDirectoryPath());
-		workingDirectoryInput.createComponent();
-		workingDirectoryInput.createContainerSelection(() -> project);
 	}
 
 	private void setProject(String projectName) {
@@ -95,16 +87,6 @@ private void setProject(String projectName) {
 		if (executableInput.getSelection()) {
 			executableInput.setValue(getDefaultExecutablePath(project));
 		}
-		if (workingDirectoryInput.getSelection()) {
-			workingDirectoryInput.setValue(getDefaultWorkingDirectoryPath());
-		}
-	}
-
-	private String getDefaultWorkingDirectoryPath() {
-		if (project == null) {
-			return ""; //$NON-NLS-1$
-		}
-		return project.getName();
 	}
 
 	@Override
@@ -112,7 +94,6 @@ public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
 		configuration.setAttribute(RustDebugDelegate.BUILD_COMMAND_ATTRIBUTE, "build"); //$NON-NLS-1$
 		configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""); //$NON-NLS-1$
 		configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_NAME, ""); //$NON-NLS-1$
-		configuration.setAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, ""); //$NON-NLS-1$
 	}
 
 	@Override
@@ -135,14 +116,6 @@ public void initializeFrom(ILaunchConfiguration configuration) {
 			executableInput.setValue(""); //$NON-NLS-1$
 		}
 		executableInput.updateSelection(executableInput.getValue().equals(getDefaultExecutablePath(project)));
-		try {
-			workingDirectoryInput
-					.setValue(configuration.getAttribute(ICDTLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY, "")); //$NON-NLS-1$
-		} catch (CoreException ce) {
-			workingDirectoryInput.setValue(""); //$NON-NLS-1$
-		}
-		workingDirectoryInput
-				.updateSelection(workingDirectoryInput.getValue().equals(getDefaultWorkingDirectoryPath()));
 	}
 
 	@Override
@@ -167,10 +140,6 @@ public boolean canSave() {
 			setErrorMessage(Messages.RustDebugTab_InvalidProjectExecutablePath);
 			return false;
 		}
-		if (workingDirectoryInput.getValue().isEmpty()) {
-			setErrorMessage(Messages.LaunchUI_invalidWorkingDirectory);
-			return false;
-		}
 		setErrorMessage(null);
 		return true;
 	}
diff --git a/pom.xml b/pom.xml
index 99ee51b..93cf6f1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,7 +2,7 @@
 	<modelVersion>4.0.0</modelVersion>
 	<groupId>org.eclipse.corrosion</groupId>
 	<artifactId>parent</artifactId>
-	<version>0.3.0-SNAPSHOT</version>
+	<version>0.4.0-SNAPSHOT</version>
 	<packaging>pom</packaging>
 	
 	<prerequisites>
diff --git a/repository/pom.xml b/repository/pom.xml
index c676776..06b1c51 100644
--- a/repository/pom.xml
+++ b/repository/pom.xml
@@ -4,7 +4,7 @@
 	<parent>
 		<groupId>org.eclipse.corrosion</groupId>
 		<artifactId>parent</artifactId>
-		<version>0.3.0-SNAPSHOT</version>
+		<version>0.4.0-SNAPSHOT</version>
 	</parent>
 	<packaging>eclipse-repository</packaging>
 </project>
diff --git a/target-platform/pom.xml b/target-platform/pom.xml
index fa2962c..77be000 100644
--- a/target-platform/pom.xml
+++ b/target-platform/pom.xml
@@ -4,7 +4,7 @@
 	<parent>
 		<groupId>org.eclipse.corrosion</groupId>
 		<artifactId>parent</artifactId>
-		<version>0.3.0-SNAPSHOT</version>
+		<version>0.4.0-SNAPSHOT</version>
 	</parent>
 	<packaging>eclipse-target-definition</packaging>
 </project>


Test patch:
diff --git a/org.eclipse.corrosion.tests/META-INF/MANIFEST.MF b/org.eclipse.corrosion.tests/META-INF/MANIFEST.MF
index 1ed3ad0..95c697d 100644
--- a/org.eclipse.corrosion.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.corrosion.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: %Bundle-Name
 Bundle-SymbolicName: org.eclipse.corrosion.tests;singleton:=true
-Bundle-Version: 0.3.0.qualifier
+Bundle-Version: 0.4.0.qualifier
 Bundle-Vendor: %Bundle-Vendor
 Eclipse-BundleShape: dir
 Automatic-Module-Name: org.eclipse.corrosion.tests
diff --git a/org.eclipse.corrosion.tests/pom.xml b/org.eclipse.corrosion.tests/pom.xml
index b964f7b..9b904ef 100644
--- a/org.eclipse.corrosion.tests/pom.xml
+++ b/org.eclipse.corrosion.tests/pom.xml
@@ -4,7 +4,7 @@
 	<parent>
 		<groupId>org.eclipse.corrosion</groupId>
 		<artifactId>parent</artifactId>
-		<version>0.3.0-SNAPSHOT</version>
+		<version>0.4.0-SNAPSHOT</version>
 	</parent>
 	<packaging>eclipse-test-plugin</packaging>