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

Bug 386034

Summary: Build project and Clean keyboard shortcuts have no effect while editing file in autotools project using nonrecursive makefile
Product: [Tools] CDT Reporter: Ari Fogel <ari>
Component: cdt-autotoolsAssignee: Jeff Johnston <jjohnstn>
Status: CLOSED DUPLICATE QA Contact: Jeff Johnston <jjohnstn>
Severity: normal    
Priority: P3 CC: cdtdoug, dan
Version: Next   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Ari Fogel CLA 2012-07-26 08:39:59 EDT
Build Identifier: Version: Juno Release Build id: 20120614-1722

Custom keybindings for the "Build Project" and "Clean" actions do not work while editing a file in that project using the C/C++ perspective (or any perspective). However, if one clicks on the corresponding file in the project explorer, these keyboard shortcuts work. Additionally, while in file editor, the keybindings (but not the actions themselves) disappear from the project menu.

Reproducible: Always

Steps to Reproduce:
1. Create an autotools project

2. Make the akefile nonrecursive, e.g. all targets appear in 1 Makefile.am in root of project.

3. Recreate Makefile using appropriate autotools commands ('autoreconf --force --install && ./configure' in project root should to the trick)

4. Bind keyboard shortcuts to the "Build Project" and/or "Clean (AKA Build Clean)" actions.

5. Open a file from the new project in the editor (either using or not using C/C++ perspective).

6. Attempt to use one of the keybindings created above.
Comment 1 Ari Fogel CLA 2012-08-07 14:59:15 EDT
The problem also occurs in a Makefile project (no autotools). In my setup, the source files are in a subdirectory src, whereas the Makefile is in the root of the project.
Comment 2 Dan Brown CLA 2012-08-11 20:45:10 EDT
Also happens in a plain Executable project (not Makefile or autotools)

I have a separate workspace for my current main project so I can bind F9 to 'Build All' instead which works fine. So it seems the F9 keypress itself is being captured.

It's a useless workaround for a multi-project workspace though so I am keeping Indigo around for those.
Comment 3 Jeff Johnston CLA 2012-08-16 17:06:27 EDT
(In reply to comment #2)
> Also happens in a plain Executable project (not Makefile or autotools)
> 
> I have a separate workspace for my current main project so I can bind F9 to
> 'Build All' instead which works fine. So it seems the F9 keypress itself is
> being captured.
> 
> It's a useless workaround for a multi-project workspace though so I am
> keeping Indigo around for those.

This is a duplicate of platform bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=383497

In my attempt to debug the problem, I was able to see the short-cuts show up as choices (e.g. I tried ESC CTRL+M and it showed me this when I hit the ESC key in the KeyAssistDialog that pops-ups).  However, it never executed and I traced this to the handler service finding no handler for the command in the context given.

The given context ended up being an "e4 editor compatibility part" which had a Perspective parent and a TrimmedWindowImpl parent and a Workbench Context parent and an OSGI Workbench parent.  None of these had a handler for the Build Project command.

Perhaps none of these contexts map to the choices the user can set for the binding in the Keys Preference page (I tried "text editing", "C/C++ editor", "dialogs and windows", and "windows", but none worked).

I am closing this as duplicate as there is nothing that CDT can do about this.  There seem to be a few other platform UI bugs opened for the same issue with different views in the UI.  

The problem does not exist in Indigo.

*** This bug has been marked as a duplicate of bug 383497 ***