Community
Participate
Working Groups
Using Build id: 20120202-1513 (Juno M5 C/C++) 1. Create a c++ project and paste this code #define FOO(a) a++ #define BAR(a) FOO(a) int main() { int b; BAR(b); // hover on BAR return 0; } 2. Hover on BAR in main, click on the hover window to open macro explorer. 3. Buttons are disabled at the bottom the window. It works correctly with Indigo SR2-RC2.
(In reply to comment #0) > It works correctly with Indigo SR2-RC2. Also confirmed to be working with 3.8M5. Will poke around. Cool feature, by the way. :)
When we try to look for the "org.eclipse.cdt.ui.hover.backwardMacroExpansion" handler, we don't find anything so mark the item as being disabled.
Looks like the handlers are activated globally. http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/tree/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionExplorationControl.java?id=d2ba7a5b346d568eb26a84666b15c2a944dea8fc IWorkbench workbench= PlatformUI.getWorkbench(); fHandlerService= (IHandlerService) workbench.getService(IHandlerService.class); fContextService= (IContextService) workbench.getService(IContextService.class); fContextActivation= fContextService.activateContext(CONTEXT_ID_MACRO_EXPANSION_HOVER); fHandlerActivations= new ArrayList<IHandlerActivation>(); fHandlerActivations.add(fHandlerService.activateHandler(COMMAND_ID_EXPANSION_BACK, backwardHandler)); fHandlerActivations.add(fHandlerService.activateHandler(COMMAND_ID_EXPANSION_FORWARD, forwardHandler)); fHandlerActivations.add(fHandlerService.activateHandler(ICEditorActionDefinitionIds.OPEN_DECL, gotoDefinitionHandler));
The items are created first and then the handlers are registered. Our CCIs don't seem to be notified of this fact so the items stay disabled.
Created attachment 212158 [details] LegacyHandlerService patch v1 If we force an event to be fired when the handler becomes active this problem goes away.
Created attachment 221376 [details] Workaround for CDT Patch for CDT in case the bug is not fixed in Platform for 4.2.2.
(In reply to comment #5) > Created attachment 212158 [details] > LegacyHandlerService patch v1 Released as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?h=R4_2_maintenance&id=5d63a0b5b571e79ed856062b517739b09a88470e PW
In M20130116-1800 PW