Always return identifier from handleElementRename() (KT-14358)

Returning reference will lead to replacing identifier with reference, that result bad psi, bad stubs, and failure at some point.

 #KT-14358 Fixed
This commit is contained in:
Nikolay Krasko
2016-12-21 17:32:56 +03:00
parent 8a49a017ff
commit da5f2a0784
@@ -49,9 +49,9 @@ class AndroidSimpleNameReferenceExtension : SimpleNameReferenceExtension {
}
else if (isLayoutPackageIdentifier(reference)) {
return if (newElementName.endsWith(".xml"))
psiFactory.createSimpleName(newElementName.dropLast(".xml".length))
psiFactory.createSimpleName(newElementName.dropLast(".xml".length)).getIdentifier()
else
reference.element
reference.element.getIdentifier()
}
return null