FIR IDE: change destructing declaration reference behaviour to match FE1.0 plugin behaviour

This commit is contained in:
Ilya Kirillov
2021-08-10 18:42:03 +02:00
parent aef45f0997
commit 2e3b576342
5 changed files with 25 additions and 9 deletions
@@ -20,6 +20,10 @@ abstract class KtDestructuringDeclarationReference(
abstract override fun canRename(): Boolean
override fun resolve() = multiResolve(false).asSequence()
.map { it.element }
.first { it is KtDestructuringDeclarationEntry }
override fun handleElementRename(newElementName: String): PsiElement? {
if (canRename()) return expression
throw IncorrectOperationException()