Move: Fix processing of callable references to nested Java classes and static methods

#KT-17827 Fixed
This commit is contained in:
Alexey Sedunov
2018-02-13 18:58:11 +03:00
parent 441f88c144
commit 17e64ebae0
46 changed files with 230 additions and 12 deletions
@@ -19,10 +19,7 @@ package org.jetbrains.kotlin.psi.psiUtil
import com.intellij.extapi.psi.StubBasedPsiElementBase
import com.intellij.openapi.util.Key
import com.intellij.openapi.util.TextRange
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiParameter
import com.intellij.psi.PsiParameterList
import com.intellij.psi.PsiWhiteSpace
import com.intellij.psi.*
import com.intellij.psi.stubs.StubElement
import com.intellij.psi.tree.TokenSet
import org.jetbrains.kotlin.KtNodeTypes
@@ -596,4 +593,12 @@ fun String?.isIdentifier(): Boolean {
return lexer.tokenType == null
}
fun String.quoteIfNeeded(): String = if (this.isIdentifier()) this else "`$this`"
fun String.quoteIfNeeded(): String = if (this.isIdentifier()) this else "`$this`"
fun PsiElement.isTopLevelKtOrJavaMember(): Boolean {
return when (this) {
is KtDeclaration -> parent is KtFile
is PsiClass -> containingClass == null && this.qualifiedName != null
else -> false
}
}