From ac692546b6375f2bf7179d341de2d459cb791521 Mon Sep 17 00:00:00 2001 From: Anton Leherbauer Date: Fri, 25 Jan 2008 10:26:49 +0000 Subject: [PATCH] Macro explorer: F3 to open macro definition --- core/org.eclipse.cdt.ui/plugin.xml | 7 ++- .../CMacroExpansionExplorationControl.java | 60 +++++++++++++++++-- .../ui/text/c/hover/CMacroExpansionInput.java | 2 +- 3 files changed, 63 insertions(+), 6 deletions(-) diff --git a/core/org.eclipse.cdt.ui/plugin.xml b/core/org.eclipse.cdt.ui/plugin.xml index 87bc1e45c5f..edf577c6c46 100644 --- a/core/org.eclipse.cdt.ui/plugin.xml +++ b/core/org.eclipse.cdt.ui/plugin.xml @@ -1480,7 +1480,12 @@ contextId="org.eclipse.cdt.ui.macroExpansionHoverScope" commandId="org.eclipse.cdt.ui.hover.forwardMacroExpansion" schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"/> - + getStepCount()) { fIndex= 0; @@ -220,7 +272,7 @@ public class CMacroExpansionExplorationControl extends AbstractCompareViewerInfo showExpansion(); } - protected void backward() { + protected final void backward() { --fIndex; if (fIndex < 0) { fIndex= fixIndex(getStepCount()); @@ -266,7 +318,7 @@ public class CMacroExpansionExplorationControl extends AbstractCompareViewerInfo * @see org.eclipse.cdt.internal.ui.text.AbstractCompareViewerInformationControl#getId() */ protected String getId() { - return "org.eclipse.cdt.ui.text.hover.CMacroExpansionExploration"; //$NON-NLS-1$ + return "org.eclipse.cdt.ui.text.hover.CMacroExpansionExploration0"; //$NON-NLS-1$ } /* diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionInput.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionInput.java index 52efaee65d4..9cb6eb6dead 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionInput.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/c/hover/CMacroExpansionInput.java @@ -89,7 +89,7 @@ public class CMacroExpansionInput { final int startOffset = location.getNodeOffset(); if (startOffset <= fOffset) { int endOffset= startOffset + location.getNodeLength(); - if (endOffset >= fEndOffset) { + if (endOffset >= fEndOffset || node instanceof IASTTranslationUnit) { if (startOffset > fBestOffset || endOffset < fBestEndOffset) { fBestMatch= node; fBestOffset= startOffset;