diff options
author | Markus Schorn | 2006-09-11 13:46:32 +0000 |
---|---|---|
committer | Markus Schorn | 2006-09-11 13:46:32 +0000 |
commit | 72d7147e7786b2a8a94f8e30a327d5124e10f761 (patch) | |
tree | ecd2b5d950d83c98f99fedfc866c826d145e7050 /core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHContentProvider.java | |
parent | d104bdce04cfce6a5c7bfcc628f3a4ae6c61e9d6 (diff) | |
download | org.eclipse.cdt-72d7147e7786b2a8a94f8e30a327d5124e10f761.tar.gz org.eclipse.cdt-72d7147e7786b2a8a94f8e30a327d5124e10f761.tar.xz org.eclipse.cdt-72d7147e7786b2a8a94f8e30a327d5124e10f761.zip |
Call Hierarchy: support for initializers of global variables
Diffstat (limited to 'core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHContentProvider.java')
-rw-r--r-- | core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHContentProvider.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHContentProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHContentProvider.java index b0f42501269..1b3e926ea8e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHContentProvider.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/callhierarchy/CHContentProvider.java @@ -20,12 +20,14 @@ import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.jface.text.Region; import org.eclipse.swt.widgets.Display; +import org.eclipse.cdt.core.dom.ast.IEnumerator; import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.ICElement; import org.eclipse.cdt.core.model.ICProject; import org.eclipse.cdt.core.model.ISourceRange; import org.eclipse.cdt.core.model.ISourceReference; import org.eclipse.cdt.core.model.ITranslationUnit; +import org.eclipse.cdt.core.model.IVariable; import org.eclipse.cdt.ui.CUIPlugin; import org.eclipse.cdt.internal.corext.util.CModelUtil; @@ -76,9 +78,15 @@ public class CHContentProvider extends AsyncTreeContentProvider { if (node.isRecursive() || node.getRepresentedDeclaration() == null) { return NO_CHILDREN; } - if (!fComputeReferencedBy && (node.isVariable() || node.isMacro())) { + if (fComputeReferencedBy) { + if (node.isInitializer()) { + return NO_CHILDREN; + } + } + else if (node.isVariable() || node.isMacro()) { return NO_CHILDREN; } + } // allow for async computation return null; @@ -130,6 +138,9 @@ public class CHContentProvider extends AsyncTreeContentProvider { private CHNode createRefbyNode(CHNode parent, ICElement element, CIndexReference[] refs) { ITranslationUnit tu= CModelUtil.getTranslationUnit(element); CHNode node= new CHNode(parent, tu, refs[0].getTimestamp(), element); + if (element instanceof IVariable || element instanceof IEnumerator) { + node.setInitializer(true); + } Arrays.sort(refs, CIndexReference.COMPARE_OFFSET); for (int i = 0; i < refs.length; i++) { CIndexReference reference = refs[i]; |