Bug 552310 - Menu contributions to context menu in Debug view missing on 4.13
Summary: Menu contributions to context menu in Debug view missing on 4.13
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.13   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.14   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2019-10-22 05:23 EDT by Mattias Bertilsson CLA
Modified: 2019-12-11 04:15 EST (History)
7 users (show)

See Also:


Attachments
Example project contributing "Command" to context menu in Debug view (2.74 KB, application/zip)
2019-10-23 11:29 EDT, Andrey Loskutov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mattias Bertilsson CLA 2019-10-22 05:23:42 EDT
It seems extensions to "org.eclipse.ui.menus" that contribute to "popup:org.eclipse.debug.ui.DebugView" are ignored with platform version 4.13.

I first noticed that the CDT reverse debugging commands were missing. Those have quite complex logic controlling visibility, but it looks like nothing contributed using "org.eclipse.ui.menus" and menuContributions make it to the menu with 4.13. The example below works fine with 4.12 and earlier.

I haven't checked all entries in the menu, but so far, the only things I find that do make it into the menu are done using deprecated action based mechanisms.

<menuContribution locationURI="popup:org.eclipse.debug.ui.DebugView?before=stepGroup">
<command style="toggle" commandId="XXX">
<visibleWhen checkEnabled="true"/>
</command>
</menuContribution>

<extension point="org.eclipse.ui.commands">
<command id="XXX"
categoryId="YYY"
description="ZZZ"
name="AAA">
</command>
</extension>

<extension point="org.eclipse.ui.handlers">
<handler commandId="XXX" class="BBB">
<enabledWhen>
<with variable="org.eclipse.core.runtime.Platform">
<test property="org.eclipse.core.runtime.bundleState" 
args="CCC" value="ACTIVE"/>
</with>
</enabledWhen>
</handler>
</extension>
Comment 1 Sarika Sinha CLA 2019-10-22 23:05:09 EDT
I have not seen any issues with JDT Debug, moving to CDT for further analysis.
Comment 2 Mattias Bertilsson CLA 2019-10-23 08:48:16 EDT
This is not a CDT problem. The plugin.xml below, along with an empty handler implementation, will give you a "Command" item in the Debug View on Eclipse platform versions < 4.13 and nothing in 4.13:

* plugin.xml:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension point="org.eclipse.ui.commands">
      <command id="com.example.plugin.command"      
            defaultHandler="com.example.plugin.Handler"
            name="Command">
      </command>
   </extension>
   <extension point="org.eclipse.ui.menus">
      <menuContribution locationURI="popup:org.eclipse.debug.ui.DebugView?before=stepGroup">
         <command commandId="com.example.plugin.command"/>
      </menuContribution>
   </extension>
</plugin>

* com/example/plugin/Handler.java:

package com.example.plugin;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;

public class Handler extends AbstractHandler {
	public Object execute(ExecutionEvent event) throws ExecutionException {
		return null;
	}
}
Comment 3 Jonah Graham CLA 2019-10-23 09:17:30 EDT
(In reply to Sarika Sinha from comment #1)
> I have not seen any issues with JDT Debug, moving to CDT for further
> analysis.

@Sarika - As Mattias has provided an example in Comment 2 that is not CDT dependent, I think this belongs in Platform. I remain on the CC list, please let me know what CDT can do beyond Mattias' minimal test case.
Comment 4 Andrey Loskutov CLA 2019-10-23 11:29:18 EDT
Created attachment 280388 [details]
Example project contributing "Command" to context menu in Debug view

I've created a project out of comment 2.

I guess we broke something in menu managers again.
Comment 5 Thomas Wolf CLA 2019-10-23 12:13:58 EDT
Reminds me of bug 550986.
Comment 6 Dani Megert CLA 2019-11-26 05:42:55 EST
Please retarget if you still plan to fix this for 4.14.
Comment 7 Andrey Loskutov CLA 2019-12-04 09:52:38 EST
Simeon, we should address this for 4.15, especially if this affects CDT debugging.
Comment 8 Simeon Andreev CLA 2019-12-06 07:26:37 EST
I no longer see the problem with latest 4.14 and the attached example: https://bugs.eclipse.org/bugs/attachment.cgi?id=280388

I do see the problem in 4.14 m1. I no longer see the problem when I manually add this commit on top: https://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=7efdf6755aefe96cd46a578e0b0a65b9ea44a2b2

So I think this is fixed with the fix for bug 552361.

Hi Mattias Bertilsson,

could you re-test with the latest 4.14 build? E.g.: https://download.eclipse.org/eclipse/downloads/drops4/I20191204-1800/

Best regards and thanks,
Simeon
Comment 9 Andrey Loskutov CLA 2019-12-06 07:42:12 EST
Thanks Simeon, closing.
@Matthias, feel free to reopen if you still can reproduce with 4.14 RC2.
Comment 10 Mattias Bertilsson CLA 2019-12-11 04:15:26 EST
I tested with 4.14RC2a-201912100 and it looks ok.