Dropped unused methods
This commit is contained in:
@@ -255,22 +255,6 @@ public fun JetElement.getQualifiedElementSelector(): JetElement? {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns outermost qualified element ([[JetQualifiedExpression]] or [[JetUserType]]) in the non-interleaving chain
|
|
||||||
* of qualified elements which enclose given expression
|
|
||||||
* If there is no such elements original expression is returned
|
|
||||||
*/
|
|
||||||
public fun JetSimpleNameExpression.getOutermostNonInterleavingQualifiedElement(): JetElement {
|
|
||||||
var element = ((getParent() as? JetCallExpression) ?: this).getParent()
|
|
||||||
if (element !is JetQualifiedExpression && element !is JetUserType) return this
|
|
||||||
|
|
||||||
while (true) {
|
|
||||||
val parent = element!!.getParent()
|
|
||||||
if (parent !is JetQualifiedExpression && parent !is JetUserType) return element as JetElement
|
|
||||||
element = parent
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public fun PsiDirectory.getPackage(): PsiPackage? = JavaDirectoryService.getInstance()!!.getPackage(this)
|
public fun PsiDirectory.getPackage(): PsiPackage? = JavaDirectoryService.getInstance()!!.getPackage(this)
|
||||||
|
|
||||||
public fun JetModifierListOwner.isPrivate(): Boolean = hasModifier(JetTokens.PRIVATE_KEYWORD)
|
public fun JetModifierListOwner.isPrivate(): Boolean = hasModifier(JetTokens.PRIVATE_KEYWORD)
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.psi.psiUtil
|
package org.jetbrains.kotlin.psi.psiUtil
|
||||||
|
|
||||||
import com.intellij.lang.ASTNode
|
|
||||||
import com.intellij.openapi.util.TextRange
|
import com.intellij.openapi.util.TextRange
|
||||||
import com.intellij.psi.*
|
import com.intellij.psi.*
|
||||||
import com.intellij.psi.search.PsiSearchScopeUtil
|
import com.intellij.psi.search.PsiSearchScopeUtil
|
||||||
@@ -39,22 +38,11 @@ public fun PsiElement.siblings(forward: Boolean = true, withItself: Boolean = tr
|
|||||||
return if (withItself) sequence else sequence.drop(1)
|
return if (withItself) sequence else sequence.drop(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun ASTNode.siblings(forward: Boolean = true, withItself: Boolean = true): Sequence<ASTNode> {
|
|
||||||
val stepFun = if (forward) { node: ASTNode -> node.getTreeNext() } else { e: ASTNode -> e.getTreeNext() }
|
|
||||||
val sequence = sequence(this, stepFun)
|
|
||||||
return if (withItself) sequence else sequence.drop(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
public fun PsiElement.parents(withItself: Boolean = true): Sequence<PsiElement> {
|
public fun PsiElement.parents(withItself: Boolean = true): Sequence<PsiElement> {
|
||||||
val sequence = sequence(this) { if (it is PsiFile) null else it.getParent() }
|
val sequence = sequence(this) { if (it is PsiFile) null else it.getParent() }
|
||||||
return if (withItself) sequence else sequence.drop(1)
|
return if (withItself) sequence else sequence.drop(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun ASTNode.parents(withItself: Boolean = true): Sequence<ASTNode> {
|
|
||||||
val sequence = sequence(this) { it.getTreeParent() }
|
|
||||||
return if (withItself) sequence else sequence.drop(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
public fun PsiElement.prevLeaf(skipEmptyElements: Boolean = false): PsiElement?
|
public fun PsiElement.prevLeaf(skipEmptyElements: Boolean = false): PsiElement?
|
||||||
= PsiTreeUtil.prevLeaf(this, skipEmptyElements)
|
= PsiTreeUtil.prevLeaf(this, skipEmptyElements)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user