mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
logging
This commit is contained in:
+26
@@ -194,22 +194,48 @@ public class AndroidResourceReference extends PsiReferenceBase.Poly<XmlElement>
|
||||
final PsiFile psiFile = element.getContainingFile();
|
||||
final VirtualFile vFile = psiFile != null ? psiFile.getVirtualFile() : null;
|
||||
|
||||
boolean log = element instanceof XmlAttributeValue || element instanceof LazyValueResourceElementWrapper;
|
||||
|
||||
for (ResolveResult result : results) {
|
||||
final PsiElement target = result.getElement();
|
||||
|
||||
if (log) {
|
||||
System.out.println("resolved to " + target);
|
||||
}
|
||||
|
||||
if (element.getManager().areElementsEquivalent(target, element)) {
|
||||
if (log) {
|
||||
System.out.println("equivalent");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (log) {
|
||||
System.out.println("non-equivalent");
|
||||
}
|
||||
|
||||
if (target instanceof LazyValueResourceElementWrapper && vFile != null) {
|
||||
final ValueResourceInfo info = ((LazyValueResourceElementWrapper)target).getResourceInfo();
|
||||
|
||||
if (log) {
|
||||
System.out.println("lazy computed to " + info);
|
||||
}
|
||||
|
||||
if (info.getContainingFile().equals(vFile)) {
|
||||
final XmlAttributeValue realTarget = info.computeXmlElement();
|
||||
|
||||
if (log) {
|
||||
System.out.println("computed element " + element + "; text: " + element.getText());
|
||||
}
|
||||
|
||||
if (element.getManager().areElementsEquivalent(realTarget, element)) {
|
||||
if (log) {
|
||||
System.out.println("equivalent");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if (log) {
|
||||
System.out.println("non-equivalent");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user