Moved method to psiUtils.kt
This commit is contained in:
@@ -236,8 +236,6 @@ public fun JetSimpleNameExpression.isImportDirectiveExpression(): Boolean {
|
||||
}
|
||||
}
|
||||
|
||||
public fun JetElement.getTextWithLocation(): String = "'${this.getText()}' at ${DiagnosticUtils.atLocation(this)}"
|
||||
|
||||
public fun JetExpression.isFunctionLiteralOutsideParentheses(): Boolean {
|
||||
val parent = getParent()
|
||||
return when (parent) {
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.intellij.psi.*
|
||||
import com.intellij.psi.search.PsiSearchScopeUtil
|
||||
import com.intellij.psi.search.SearchScope
|
||||
import com.intellij.psi.util.PsiTreeUtil
|
||||
import org.jetbrains.kotlin.diagnostics.DiagnosticUtils
|
||||
import java.util.ArrayList
|
||||
|
||||
// NOTE: in this file we collect only LANGUAGE INDEPENDENT methods working with PSI and not modifying it
|
||||
@@ -256,6 +257,8 @@ public fun PsiElement.getElementTextWithContext(): String {
|
||||
.toString()
|
||||
}
|
||||
|
||||
public fun PsiElement.getTextWithLocation(): String = "'${this.getText()}' at ${DiagnosticUtils.atLocation(this)}"
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
public fun SearchScope.contains(element: PsiElement): Boolean = PsiSearchScopeUtil.isInScope(this, element)
|
||||
|
||||
Reference in New Issue
Block a user