mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
remove logging
This commit is contained in:
-32
@@ -81,14 +81,12 @@ public class AndroidResourceReference extends PsiReferenceBase.Poly<XmlElement>
|
||||
|
||||
@Override
|
||||
public PsiElement handleElementRename(String newElementName) throws IncorrectOperationException {
|
||||
System.out.println("Handle element rename to " + newElementName);
|
||||
if (newElementName.startsWith(AndroidResourceUtil.NEW_ID_PREFIX)) {
|
||||
newElementName = AndroidResourceUtil.getResourceNameByReferenceText(newElementName);
|
||||
}
|
||||
ResourceValue value = myValue.getValue();
|
||||
assert value != null;
|
||||
String resType = value.getResourceType();
|
||||
System.out.println("Restype: " + resType);
|
||||
|
||||
if (resType != null && newElementName != null) {
|
||||
// todo: do not allow new value resource name to contain dot, because it is impossible to check if it file or value otherwise
|
||||
@@ -96,7 +94,6 @@ public class AndroidResourceReference extends PsiReferenceBase.Poly<XmlElement>
|
||||
final String newResName = newElementName.contains(".") // it is file
|
||||
? AndroidCommonUtils.getResourceName(resType, newElementName)
|
||||
: newElementName;
|
||||
System.out.println("New res name: " + newResName);
|
||||
myValue.setValue(ResourceValue.referenceTo(value.getPrefix(), value.getPackage(), resType, newResName));
|
||||
}
|
||||
return myValue.getXmlTag();
|
||||
@@ -202,51 +199,22 @@ 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);
|
||||
System.out.println(vFile + "; class: " + vFile.getClass().getCanonicalName());
|
||||
System.out.println(info.getContainingFile() + "; class: " + info.getContainingFile().getClass().getCanonicalName());
|
||||
System.out.println(vFile.equals(info.getContainingFile()));
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -40,7 +40,6 @@ public class LazyValueResourceElementWrapper extends RenameableFakePsiElement im
|
||||
throw new IncorrectOperationException(
|
||||
"Cannot find resource '" + myResourceInfo.getName() + "' in file " + myResourceInfo.getContainingFile().getPath());
|
||||
}
|
||||
System.out.println("Lazy;set name: " + name);
|
||||
return new ValueResourceElementWrapper(element).setName(name);
|
||||
}
|
||||
|
||||
@@ -98,7 +97,6 @@ public class LazyValueResourceElementWrapper extends RenameableFakePsiElement im
|
||||
public static PsiElement computeLazyElement(PsiElement element) {
|
||||
if (element instanceof LazyValueResourceElementWrapper) {
|
||||
element = ((LazyValueResourceElementWrapper)element).computeElement();
|
||||
System.out.println("computed element" + element);
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
-3
@@ -340,7 +340,6 @@ public class ValueResourceElementWrapper implements XmlAttributeValue, ResourceE
|
||||
|
||||
@Nullable
|
||||
public PsiElement setName(@NonNls @NotNull String name) throws IncorrectOperationException {
|
||||
System.out.println("Wrapper;set name: " + name);
|
||||
if (AndroidResourceUtil.isIdDeclaration(myWrappee)) {
|
||||
XmlAttribute attribute = (XmlAttribute)myWrappee.getParent();
|
||||
attribute.setValue(name);
|
||||
@@ -351,9 +350,7 @@ public class ValueResourceElementWrapper implements XmlAttributeValue, ResourceE
|
||||
DomElement domElement = DomManager.getDomManager(getProject()).getDomElement(tag);
|
||||
assert domElement instanceof ResourceElement;
|
||||
ResourceElement resElement = (ResourceElement)domElement;
|
||||
System.out.println("resElement: " + resElement + ", name to set: " + name);
|
||||
resElement.getName().setValue(name);
|
||||
System.out.println("setted: " + resElement.getName().getStringValue());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user