Bug 413410 - [KeyBindings] Lots of Keybinding conflicts occurred on official CDT Eclipse Kepler 4.3
Summary: [KeyBindings] Lots of Keybinding conflicts occurred on official CDT Eclipse K...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: 4.4.2   Edit
Assignee: Wojciech Sudol CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 407694 (view as bug list)
Depends on:
Blocks: 331444
  Show dependency tree
 
Reported: 2013-07-22 01:40 EDT by Yevgeny Shifrin CLA
Modified: 2014-11-07 10:06 EST (History)
11 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yevgeny Shifrin CLA 2013-07-22 01:40:59 EDT
!MESSAGE Keybinding conflicts occurred.  They may interfere with normal accelerator operation.

!ENTRY org.eclipse.jface 2 0 2013-07-21 12:32:52.158
!SUBENTRY 1 org.eclipse.jface 2 0 2013-07-21 12:32:52.158
!MESSAGE A conflict occurred for ALT+SHIFT+R:
Binding(ALT+SHIFT+R,
	ParameterizedCommand(Command(org.eclipse.cdt.ui.edit.text.rename.element,Rename - Refactoring ,
		Rename the selected element,
		Category(org.eclipse.cdt.ui.category.refactoring,Refactor - C++,C/C++ Refactorings,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@7bfa9560,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.cdt.ui.cEditorScope,,,system)
Binding(ALT+SHIFT+R,
	ParameterizedCommand(Command(org.eclipse.cdt.ui.edit.text.rename.element,Rename - Refactoring ,
		Rename the selected element,
		Category(org.eclipse.cdt.ui.category.refactoring,Refactor - C++,C/C++ Refactorings,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@7bfa9560,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.cdt.ui.cViewScope,,,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2013-07-21 12:32:52.158
!MESSAGE A conflict occurred for F3:
Binding(F3,
	ParameterizedCommand(Command(org.eclipse.cdt.ui.edit.opendecl,Open Declaration,
		Open an editor on the selected element's declaration(s),
		Category(org.eclipse.cdt.ui.category.source,Source,Source commands,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@651137,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.cdt.ui.cEditorScope,,,system)
Binding(F3,
	ParameterizedCommand(Command(org.eclipse.cdt.ui.edit.opendecl,Open Declaration,
		Open an editor on the selected element's declaration(s),
		Category(org.eclipse.cdt.ui.category.source,Source,Source commands,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@651137,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.cdt.ui.cViewScope,,,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2013-07-21 12:32:52.158
!MESSAGE A conflict occurred for CTRL+SHIFT+T:
Binding(CTRL+SHIFT+T,
	ParameterizedCommand(Command(org.eclipse.cdt.ui.navigate.opentype,Open Element,
		Open an element in an Editor,
		Category(org.eclipse.cdt.ui.category.source,Source,Source commands,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@6b4d3214,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.cdt.ui.cEditorScope,,,system)
Binding(CTRL+SHIFT+T,
	ParameterizedCommand(Command(org.eclipse.cdt.ui.navigate.opentype,Open Element,
		Open an element in an Editor,
		Category(org.eclipse.cdt.ui.category.source,Source,Source commands,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@6b4d3214,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.cdt.ui.cViewScope,,,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2013-07-21 12:32:52.158
!MESSAGE A conflict occurred for F4:
Binding(F4,
	ParameterizedCommand(Command(org.eclipse.cdt.ui.edit.open.type.hierarchy,Open Type Hierarchy,
		Open a type hierarchy on the selected element,
		Category(org.eclipse.ui.category.navigate,Navigate,null,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@1912f615,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.cdt.ui.cEditorScope,,,system)
Binding(F4,
	ParameterizedCommand(Command(org.eclipse.cdt.ui.edit.open.type.hierarchy,Open Type Hierarchy,
		Open a type hierarchy on the selected element,
		Category(org.eclipse.ui.category.navigate,Navigate,null,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@1912f615,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.cdt.ui.cViewScope,,,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2013-07-21 12:32:52.158
!MESSAGE A conflict occurred for CTRL+G:
Binding(CTRL+G,
	ParameterizedCommand(Command(org.eclipse.cdt.ui.search.finddecl,Declaration,
		Search for declarations of the selected element in the workspace,
		Category(org.eclipse.cdt.ui.category.source,Source,Source commands,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@2bd9e98f,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.cdt.ui.cEditorScope,,,system)
Binding(CTRL+G,
	ParameterizedCommand(Command(org.eclipse.cdt.ui.search.finddecl,Declaration,
		Search for declarations of the selected element in the workspace,
		Category(org.eclipse.cdt.ui.category.source,Source,Source commands,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@2bd9e98f,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.cdt.ui.cViewScope,,,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2013-07-21 12:32:52.159
!MESSAGE A conflict occurred for CTRL+SHIFT+G:
Binding(CTRL+SHIFT+G,
	ParameterizedCommand(Command(org.eclipse.cdt.ui.search.findrefs,References,
		Search for references to the selected element in the workspace,
		Category(org.eclipse.cdt.ui.category.source,Source,Source commands,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@6f74c1c6,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.cdt.ui.cEditorScope,,,system)
Binding(CTRL+SHIFT+G,
	ParameterizedCommand(Command(org.eclipse.cdt.ui.search.findrefs,References,
		Search for references to the selected element in the workspace,
		Category(org.eclipse.cdt.ui.category.source,Source,Source commands,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@6f74c1c6,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.cdt.ui.cViewScope,,,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2013-07-21 12:32:52.159
!MESSAGE A conflict occurred for ALT+CTRL+H:
Binding(ALT+CTRL+H,
	ParameterizedCommand(Command(org.eclipse.cdt.ui.edit.open.call.hierarchy,Open Call Hierarchy,
		Open the call hierarchy for the selected element,
		Category(org.eclipse.ui.category.navigate,Navigate,null,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@5a5de754,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.cdt.ui.cEditorScope,,,system)
Binding(ALT+CTRL+H,
	ParameterizedCommand(Command(org.eclipse.cdt.ui.edit.open.call.hierarchy,Open Call Hierarchy,
		Open the call hierarchy for the selected element,
		Category(org.eclipse.ui.category.navigate,Navigate,null,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@5a5de754,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.cdt.ui.cViewScope,,,system)
!SUBENTRY 1 org.eclipse.jface 2 0 2013-07-21 12:32:52.159
!MESSAGE A conflict occurred for CTRL+SHIFT+H:
Binding(CTRL+SHIFT+H,
	ParameterizedCommand(Command(org.eclipse.cdt.ui.navigate.open.type.in.hierarchy,Open Type in Hierarchy,
		Open a type in the type hierarchy view,
		Category(org.eclipse.ui.category.navigate,Navigate,null,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@4afe6a25,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.cdt.ui.cEditorScope,,,system)
Binding(CTRL+SHIFT+H,
	ParameterizedCommand(Command(org.eclipse.cdt.ui.navigate.open.type.in.hierarchy,Open Type in Hierarchy,
		Open a type in the type hierarchy view,
		Category(org.eclipse.ui.category.navigate,Navigate,null,true),
		org.eclipse.ui.internal.WorkbenchHandlerServiceHandler@4afe6a25,
		,,true),null),
	org.eclipse.ui.defaultAcceleratorConfiguration,
	org.eclipse.cdt.ui.cViewScope,,,system)
Comment 1 Marc-André Laperle CLA 2013-08-29 11:37:25 EDT

*** This bug has been marked as a duplicate of bug 407694 ***
Comment 2 Yevgeny Shifrin CLA 2013-08-29 16:25:19 EDT
(In reply to comment #1)
> 
> *** This bug has been marked as a duplicate of bug 407694 ***

Hi,

Are you sure that this is duplicate of 407694 bug? As far as I know, I do not have jdt installed. The other bug is refering to collisions between cdt and jdt.

Thanks,
Yevgeny
Comment 3 Yevgeny Shifrin CLA 2013-08-29 16:32:18 EDT
In all collisions the difference is org.eclipse.cdt.ui.cEditorScope vs org.eclipse.cdt.ui.cViewScope. It does not seem to be related to jdt. But maybe I am missing something ;(

Thanks,
Yevgeny
Comment 4 Marc-André Laperle CLA 2013-08-29 17:12:23 EDT
(In reply to comment #3)
> In all collisions the difference is org.eclipse.cdt.ui.cEditorScope vs
> org.eclipse.cdt.ui.cViewScope. It does not seem to be related to jdt. But
> maybe I am missing something ;(
> 
> Thanks,
> Yevgeny

I can reproduce both bugs with the same steps. The other bug has the same conflicts but with jdt added so 3 scopes are conflicting instead of two. org.eclipse.cdt.ui.cEditorScope, org.eclipse.cdt.ui.cViewScope and (from JDT) org.eclipse.ui.contexts.window. I does seem pretty similar no?
Comment 5 Marc-André Laperle CLA 2013-08-29 17:14:18 EDT
Both bugs are likely dupes of bug 387951. I'll test tonight.
Comment 6 Marc-André Laperle CLA 2013-08-29 20:06:04 EDT
(In reply to comment #5)
> Both bugs are likely dupes of bug 387951. I'll test tonight.

Unfortunately, that didn't fix the problem. I'll reopen this just in case it is different.
Comment 7 Marc-André Laperle CLA 2013-08-29 20:12:44 EDT
Reassigning to platform/UI. This only happens in 4.x, I can't reproduce it with 3.8. It looks similar to bug 387951 but I tried build 4.3 M20130829-1300 which is supposed to include the fix and it's still happening.
Comment 8 Martin Oberhuber CLA 2014-02-20 07:20:29 EST
CQ:WIND00-WB4-2775

We see this too, in Eclipse 4.3.1 + CDT 8.2.1 when we open a C-file in the editor.
Comment 9 Martin Oberhuber CLA 2014-05-19 03:01:02 EDT
I can still reproduce the issue with Eclipse SDK 4.4RC1 + CDT 8.3 latest :

1. Download and start Eclipse SDK on empy workspace
2. Help > Install CDT latest, allow to restart
3. Switch to C/C++ Perspective
4. Window > Show View > Other > General : Errorlog
4. File > New > C Project, ANSI Helloworld Example, Finish
   Note: At this point a C Editor is open but no conflicts reported yet
5. In Project Explorer, expand hellocdt/src and dblclick on hellocdt.c

--> Keybinding conflicts reported in the errorlog view.

The problem seems to be that cEditorContext and cViewContext are active at the same time, and both contribute a binding like F4 Open Hierarchy. cEditorContext is a child of textEditorScope which is a child of contexts.window ; cViewScope is a direct child of contexts.window:

   org.eclipse.contexts.window
      org.eclipse.cdt.ui.cViewScope
      org.eclipse.ui.textEditorScope
         org.eclipse.cdt.ui.cEditorScope

One could claim that the cEditorScope is more specific so it should win over cViewScope ... but I'm not sure if that idea matches the thinking of Platform/UI? And why did 3.8.2 not report a conflict but 4.4 does ?

The other question is, why are both contexts active at the same time ? Should the C/C++ Editor perhaps de-activate the cViewScope when an editor gets the focus ?

This issue seems just cosmetic, but many people may lose trust in the IDE when they see messages like this spill into the Error Log.
Comment 10 Paul Webster CLA 2014-06-10 09:45:39 EDT
(In reply to Martin Oberhuber from comment #9)
> 
> The problem seems to be that cEditorContext and cViewContext are active at
> the same time, and both contribute a binding like F4 Open Hierarchy.
> cEditorContext is a child of textEditorScope which is a child of
> contexts.window ; cViewScope is a direct child of contexts.window:
> 
>    org.eclipse.contexts.window
>       org.eclipse.cdt.ui.cViewScope
>       org.eclipse.ui.textEditorScope
>          org.eclipse.cdt.ui.cEditorScope
> 
> One could claim that the cEditorScope is more specific so it should win over
> cViewScope

In 3.x, this would be reported as a conflict (because the key bindings are in contexts that weren't in a parent-child relationship).  In 4.x, keybinding look ups are simply in a sorted order, where contexts are sorted by level then ID, so the lookup order is: cEditorScope, textEditorScope, cViewScope, window

> ... but I'm not sure if that idea matches the thinking of
> Platform/UI? And why did 3.8.2 not report a conflict but 4.4 does ?
> 
> The other question is, why are both contexts active at the same time ?
> Should the C/C++ Editor perhaps de-activate the cViewScope when an editor
> gets the focus ?

I think it's a transient call that is reporting the errors, while both contexts are active.  But CViewScope becomes deactivated correctly and then the keybindings work as expected, that's why it looks like a cosmetic problem.

PW
Comment 11 Martin Oberhuber CLA 2014-09-04 18:05:30 EDT
This issue may seem only cosmetic, but the error logs have already caused loss of confidence into Eclipse with some of our customers. This has been moved out to different target milestones a couple times already ... is there any confidence that it will actually make 4.4.2 ?
Comment 12 Wojciech Sudol CLA 2014-09-05 03:33:53 EDT
(In reply to Martin Oberhuber from comment #11)
> is there any confidence that it will actually make 4.4.2 ?

My plan is to fix it in M2 or M3, so it will be backported to 4.4.2. I already started working on it.
Comment 13 Martin Oberhuber CLA 2014-09-05 06:19:40 EDT
Very cool, thanks Wojciech !
Comment 14 Lars Vogel CLA 2014-09-05 07:02:32 EDT
(In reply to Wojciech Sudol from comment #12)
> My plan is to fix it in M2 or M3, so it will be backported to 4.4.2. I
> already started working on it.

Great news. I would be also in favor to see partial fixes here, e.g. if you already have a fix for some of them, I think it would be OK to put it up for review. For the downport we can easily combine them via interactive rebase.
Comment 15 Wojciech Sudol CLA 2014-10-01 10:57:12 EDT
When switching focus from Navigator to an editor, the list of active contexts changes multiple times before forming the final state. The keybinding conflict occurs when the list is in a temporary state, in which the org.eclipse.cdt.ui.cViewScope and org.eclipse.cdt.ui.cEditorScope contexts are active (what should never happen).
Normally, a context activation or deactivation should trigger active keybinding recomputation (done indirectly by ContextManager). Obviously, transient context changes should not do that (to avoid issues like this one).
Whilst EContextService (implemented by ContextContexService) already contains the deferUpdates(boolean) method and it is used by PartServiceImpl, it does not prevent the transient keybinding computations because the ContextManager is also used directly by ContextServiceAddon.
Since ContextManager has its own deferUpdates(boolean) method, my initial approach to fix the issue is to call the ContextManager.deferUpdates(boolean) within (indirectly) ContextContexService.deferUpdates(boolean) .
Link to the patch: https://git.eclipse.org/r/34204 .
It seems to work fine, however I continue investigation to make sure this is correct approach and it does not introduce any regression.
Comment 16 Wojciech Sudol CLA 2014-10-03 09:54:21 EDT
After additional review I think it will be safer to keep ContextManager.deferUpdates(boolean) and ContextContexService.deferUpdates(boolean) independent and call ContextManager.deferUpdates(boolean) directly in PartServiceImpl. I have uploaded a new patch set.
Comment 18 Sergey Prigogin CLA 2014-11-05 21:24:01 EST
*** Bug 407694 has been marked as a duplicate of this bug. ***