Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After running devc (start in container) the Run/Debug config history is messed up #357

Closed
scottkurz opened this issue Apr 11, 2023 · 1 comment · Fixed by #390
Closed
Milestone

Comments

@scottkurz
Copy link
Member

If you do the sequence (run or debug).

  1. start
  2. custom start .. (non-container)
  3. start in container
  4. start

In step 4., we should reuse the config in step 2., but we don't.

@scottkurz
Copy link
Member Author

OK..the problem is the last line here in LaunchConfigurationHelper:

    public ILaunchConfiguration getLaunchConfiguration(IProject iProject, String mode, RuntimeEnv runtimeEnv) throws Exception {
        DevModeOperations devModeOps = DevModeOperations.getInstance();
        ILaunchConfiguration configuration = null;
        ILaunchManager iLaunchMgr = DebugPlugin.getDefault().getLaunchManager();
        ILaunchConfigurationType iLaunchConfigType = iLaunchMgr
                .getLaunchConfigurationType(LaunchConfigurationDelegateLauncher.LAUNCH_CONFIG_TYPE_ID);

        // Find the set of configurations that were used by the currently active project last.
        ILaunchConfiguration[] existingConfigs = iLaunchMgr.getLaunchConfigurations(iLaunchConfigType);

        List<ILaunchConfiguration> matchingConfigList = filterLaunchConfigurations(existingConfigs, iProject.getName(), runtimeEnv);

        switch (matchingConfigList.size()) {
            case 0:
                // Create a new configuration.
                String newName = iLaunchMgr.generateLaunchConfigurationName(iProject.getName());
                ILaunchConfigurationWorkingCopy workingCopy = iLaunchConfigType.newInstance(null, newName);
                workingCopy.setAttribute(StartTab.PROJECT_NAME, iProject.getName());
                workingCopy.setAttribute(StartTab.PROJECT_START_PARM, devModeOps.getProjectModel().getDefaultStartParameters(iProject));
                workingCopy.setAttribute(StartTab.PROJECT_RUN_IN_CONTAINER, false);

It shouldn't set that last attribute to 'false', but rather should use the value from the current request (is it a dev or a devc?).

TESTS

We should also look at our tests to understand why this wasn't caught.

@scottkurz scottkurz added this to the 23.0.1 milestone Apr 11, 2023
@scottkurz scottkurz mentioned this issue Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant