Enable rainbow highlighting for destructuring declaration entries

#KT-17652 Fixed
This commit is contained in:
Dmitry Jemerov
2017-05-08 15:56:55 +02:00
parent 382bf9a500
commit b33c544fdf
2 changed files with 14 additions and 2 deletions
@@ -93,8 +93,10 @@ class KotlinRainbowVisitor : RainbowVisitor() {
addInfo(getInfo(context, rainbowElement, rainbowElement.text, attributesKeyToUse))
}
private fun PsiElement?.isRainbowDeclaration() =
(this is KtProperty && isLocal) || (this is KtParameter && getStrictParentOfType<KtPrimaryConstructor>() == null)
private fun PsiElement?.isRainbowDeclaration(): Boolean =
(this is KtProperty && isLocal) ||
(this is KtParameter && getStrictParentOfType<KtPrimaryConstructor>() == null) ||
this is KtDestructuringDeclarationEntry
}
private fun PsiElement.isAnonymousFunction(): Boolean = this is KtNamedFunction && nameIdentifier == null