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:
parent
19737500de
commit
838fd14a80
2 changed files with 7 additions and 5 deletions
|
@ -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();
|
||||||
|
|
|
@ -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);
|
||||||
|
|
Loading…
Add table
Reference in a new issue