Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 388931

Summary: [QuickAccess] Copy Qualified Name doesn't work
Product: [Eclipse Project] Platform Reporter: Paul Webster <pwebster>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: bsd, daniel_megert, emoffatt, john.arthorne
Version: 4.2Flags: john.arthorne: pmc_approved+
bsd: review+
Target Milestone: 4.2.1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Paul Webster CLA 2012-09-06 07:57:56 EDT
Bug 384545 introduced a regression against Copy Qualified Name when called from Quick Access.

org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommandInContext(ParameterizedCommand, Event, IEvaluationContext) should create the snapshot IEclipseContext off of the eclipseContext.getActiveLeaf().

PW
Comment 1 Paul Webster CLA 2012-09-06 08:13:20 EDT
The lookup context needs to be off of the activeLeaf, or editor based contributions are not found and handled correctly.

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=pwebster/bug388931&id=b517497f1691ea81a9d3181445d4f8d72be33309

PW
Comment 2 Paul Webster CLA 2012-09-06 08:31:28 EDT
John, I'd like to consider this for 4.2.1.

Copy and Paste seem to work without it, but I'm concerned about other editor action contributions similar to Copy Qualified Name.

PW
Comment 3 John Arthorne CLA 2012-09-06 14:59:17 EDT
Please get a reviewer and post a link to the bug on eclipse-pmc per our freeze plan.
Comment 4 Paul Webster CLA 2012-09-06 15:34:56 EDT
Brian, could you please review the change.

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=pwebster/bug388931&id=b517497f1691ea81a9d3181445d4f8d72be33309

The problem manifests itself in that quick access ignores a few editor action contributions, like Copy Qualified Name.

PW
Comment 5 Brian de Alwis CLA 2012-09-06 18:43:06 EDT
The change makes sense.  I tried running with it, verified that CQN works and that the previous EGit problem still works (EGit > delete within branch dialog).

My only concern (and it might actually be a useful thing) is that it causes the handler to be looked up from the part context:

public Object executeCommandInContext(...) {
    // ...
    EHandlerService hs = lookupContext.get(EHandlerService.class);
    try {
        final Object rc = hs.executeHandler(command, staticContext);
	if (staticContext.get(HandlerServiceImpl.NOT_HANDLED) == Boolean.TRUE) {


But I think this will be a good thing going forward trying to allow E3.x and E4.x pieces to work together.
Comment 6 Paul Webster CLA 2012-09-06 19:16:14 EDT
(In reply to comment #5)
> My only concern (and it might actually be a useful thing) is that it causes
> the handler to be looked up from the part context:

Yes, that's what I want it to do, include the part in the handler lookup (thus including the editor action contributions)

PW
Comment 7 Dani Megert CLA 2012-09-07 03:53:00 EDT
The fix seems good for this concrete (new) problem. But e.g. 'Cut' (which is already broken in 4.2) still does not work. This makes me think that the code is still fishy/wrong.

BTW: For me, 'Quick Access' (Ctrl+3) is anyway unusable in 4.x. due to bug 389018.
Comment 9 Dani Megert CLA 2012-09-10 04:22:13 EDT
Works now in 4.2-M20120909-2000.