Moved method to psiUtils.kt

This commit is contained in:
Valentin Kipyatkov
2015-05-28 23:23:56 +03:00
parent 85d9855013
commit ac7e6bdfe4
2 changed files with 3 additions and 2 deletions
@@ -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)