1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Fixes file resolution in ref-by query.

This commit is contained in:
Markus Schorn 2006-08-24 11:08:39 +00:00
parent 19737500de
commit 838fd14a80
2 changed files with 7 additions and 5 deletions

View file

@ -101,10 +101,12 @@ public class CHContentProvider extends AsyncTreeContentProvider {
ICElement[] elements= calledBy.getElements(); ICElement[] elements= calledBy.getElements();
for (int i = 0; i < elements.length; i++) { for (int i = 0; i < elements.length; i++) {
ICElement element = elements[i]; ICElement element = elements[i];
CIndexReference[] refs= calledBy.getReferences(element); if (element != null) {
if (refs != null && refs.length > 0) { CIndexReference[] refs= calledBy.getReferences(element);
CHNode node = createRefbyNode(parent, element, refs); if (refs != null && refs.length > 0) {
result.add(node); CHNode node = createRefbyNode(parent, element, refs);
result.add(node);
}
} }
} }
return result.toArray(); return result.toArray();

View file

@ -223,7 +223,7 @@ public class CIndexQueries {
IASTName[] names= pdom.getReferences(binding); IASTName[] names= pdom.getReferences(binding);
for (int i = 0; i < names.length; i++) { for (int i = 0; i < names.length; i++) {
IASTName rname = names[i]; IASTName rname = names[i];
ITranslationUnit tu= toTranslationUnit(project, name); ITranslationUnit tu= toTranslationUnit(project, rname);
CIndexReference ref= new CIndexReference(tu, rname); CIndexReference ref= new CIndexReference(tu, rname);
ICElement elem= findCaller(ref); ICElement elem= findCaller(ref);
result.add(elem, ref); result.add(elem, ref);