Bug 469528 - [Launch bar] Configuration not removed after project (and configurations) are deleted
Summary: [Launch bar] Configuration not removed after project (and configurations) are...
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: launchbar (show other bugs)
Version: 8.7.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-05 16:32 EDT by Marc-André Laperle CLA
Modified: 2021-06-14 17:13 EDT (History)
2 users (show)

See Also:


Attachments
screenshot of preferences (37.36 KB, image/png)
2021-06-14 17:13 EDT, Jonah Graham CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc-André Laperle CLA 2015-06-05 16:32:00 EDT
Using CDT 8.7.0.201506020305
LaunchBar 1.0.0.201506011405

1. With a new workspace, create a Hello World C++ project and build it.
2. Create a debug configuration using the Launch bar
3. Delete the project.

The configuration stays there in the launch bar. There is also no (obvious?) way to delete it from that point.
Comment 1 Doug Schaefer CLA 2015-06-06 20:19:04 EDT
Hmm, I can't reproduce this. It goes back to "No configurations" when I do it.

Is it still there if you restart the workbench? If you can reproduce it, can you stick a breakpoint in LaunchBarManager.launchConfigurationRemoved and see if it's called? Thanks!
Comment 2 Marc-André Laperle CLA 2015-06-08 14:21:47 EDT
(In reply to Doug Schaefer from comment #1)
> Hmm, I can't reproduce this. It goes back to "No configurations" when I do
> it.
> 
> Is it still there if you restart the workbench?

Yes.

> If you can reproduce it, can
> you stick a breakpoint in LaunchBarManager.launchConfigurationRemoved and
> see if it's called?

No, unfortunately it doesn't get hit.
Comment 3 Doug Schaefer CLA 2015-06-08 20:32:59 EDT
(In reply to Marc-Andre Laperle from comment #2)
> > If you can reproduce it, can
> > you stick a breakpoint in LaunchBarManager.launchConfigurationRemoved and
> > see if it's called?
> 
> No, unfortunately it doesn't get hit.

Interesting. The only way that it doesn't get hit is if the configuration isn't removed. Or the listener didn't get registered with the platform debug LaunchManager, but that's suspect.

Are you sure the launch config is gone? Actually you didn't mention if you removed it, I was just assuming. You should be prompted when the project is deleted.
Comment 4 Marc-André Laperle CLA 2015-06-08 23:23:25 EDT
(In reply to Doug Schaefer from comment #3)
> Are you sure the launch config is gone? Actually you didn't mention if you
> removed it, I was just assuming.

I'm "sure" meaning I don't see it anymore in the Debug configurations dialog anymore. Maybe it still lives somewhere but it's not visible anymore? I'll investigate some more.

> You should be prompted when the project is
> deleted.

Prompted to remove the configurations? Hmm, I've never seen this, only the Delete Resources dialog with the "Delete project contents on disk" checkbox (which I checked).
Comment 5 Marc-André Laperle CLA 2015-06-08 23:24:56 EDT
(In reply to Marc-Andre Laperle from comment #4)
> (In reply to Doug Schaefer from comment #3)
> > Are you sure the launch config is gone? Actually you didn't mention if you
> > removed it, I was just assuming.

Just to be more clear, I did not remove the configuration manually, I deleted the project associated with it.
Comment 6 Doug Schaefer CLA 2015-06-09 11:22:07 EDT
(In reply to Marc-Andre Laperle from comment #5)
> (In reply to Marc-Andre Laperle from comment #4)
> > (In reply to Doug Schaefer from comment #3)
> > > Are you sure the launch config is gone? Actually you didn't mention if you
> > > removed it, I was just assuming.
> 
> Just to be more clear, I did not remove the configuration manually, I
> deleted the project associated with it.

If the configuration is set up properly, it'll have the project as a mappedResource. When you delete the project, you should be prompted to delete the configurations it has been mapped to. That's the behavior I see when I created a project, created the C++ Application launch config for it, then deleted the project.
Comment 7 Marc-André Laperle CLA 2015-06-09 13:45:03 EDT
(In reply to Doug Schaefer from comment #6)
> If the configuration is set up properly, it'll have the project as a
> mappedResource. When you delete the project, you should be prompted to
> delete the configurations it has been mapped to.

I don't see that prompt in Eclipse C/C++ EPP (or CDT master on top of Eclipse SDK). I downloaded Momentics IDE to compare and it does prompt for configuration removal. It looks like this is code in Momentics only (notice the com.qnx class):

"main" prio=10 tid=0x00007f105400c000 nid=0x5a1 runnable [0x00007f105b7e7000]
   java.lang.Thread.State: RUNNABLE
	at org.eclipse.swt.internal.gtk.OS.Call(Native Method)
	at org.eclipse.swt.widgets.Display.sleep(Display.java:4233)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:827)
	at org.eclipse.jface.window.Window.open(Window.java:802)
	at org.eclipse.jface.dialogs.MessageDialog.open(MessageDialog.java:334)
	at com.qnx.tools.ide.qde.internal.ui.launch.QDELaunchConfigRemover$1.run(QDELaunchConfigRemover.java:101)
	at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:164)
	at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer.java:158)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	- locked <0x00000000f3b6b008> (a org.eclipse.swt.widgets.RunnableLock)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3717)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3366)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:173)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:388)
	at org.eclipse.ltk.internal.ui.refactoring.RefactoringWizardDialog2.run(RefactoringWizardDialog2.java:331)
	at org.eclipse.ltk.ui.refactoring.RefactoringWizard.internalPerformFinish(RefactoringWizard.java:637)
	at org.eclipse.ltk.ui.refactoring.UserInputWizardPage.performFinish(UserInputWizardPage.java:153)
	at org.eclipse.ltk.ui.refactoring.resource.DeleteResourcesWizard$DeleteResourcesRefactoringConfigurationPage.performFinish(DeleteResourcesWizard.java:202)
Comment 8 Doug Schaefer CLA 2015-06-09 14:06:44 EDT
LOL, I guess I'm running with Momentics in my workspace. We should probably contribute that. :)
Comment 9 Doug Schaefer CLA 2015-06-09 14:14:13 EDT
Anyway, once we get the launch config provider for CDT projects, it can remove all the launch configs it creates when the CDT projects go away.

We're just checking here (David Cummings and I) and it looks like we're right too. The platform will delete the config if mapped resources are set properly in MappedResourceVisitor. It just doesn't prompt. Which adds to my suspicion that CDT launches aren't set up correctly.
Comment 10 Elena Laskavaia CLA 2015-06-22 10:25:19 EDT
CDT launch configuration will not be deleted if project is deleted. But it has nothing to do with launch bar.
Momentics has a specific hack to do that (lc listener).
Proper way to do mapped resources, should not be hard to add to CDT's Local C/C++ Application launch configuration type I suppose.
Comment 11 Jonah Graham CLA 2021-06-14 17:13:13 EDT
Created attachment 286595 [details]
screenshot of preferences

I can see the launch configurations in the dialog if I don't filter out launch configs for deleted projects. Similarly, if I enable delete launch config when project is deleted in the preferences then the launch config is deleted and therefore removed from the launch bar.

Should the launchbar be using the same filtering options as the Run/Debug Configurations dialogs?