More correct keyword completion after "@"

This commit is contained in:
Valentin Kipyatkov
2015-10-21 17:16:07 +03:00
parent 235399f784
commit fabf3e5e84
3 changed files with 24 additions and 11 deletions
@@ -69,6 +69,12 @@ public fun PsiElement.prevLeaf(skipEmptyElements: Boolean = false): PsiElement?
public fun PsiElement.nextLeaf(skipEmptyElements: Boolean = false): PsiElement?
= PsiTreeUtil.nextLeaf(this, skipEmptyElements)
public val PsiElement.prevLeafs: Sequence<PsiElement>
get() = sequence({ prevLeaf() }, { it.prevLeaf() })
public val PsiElement.nextLeafs: Sequence<PsiElement>
get() = sequence({ nextLeaf() }, { it.nextLeaf() })
public fun PsiElement.prevLeaf(filter: (PsiElement) -> Boolean): PsiElement? {
var leaf = prevLeaf()
while (leaf != null && !filter(leaf)) {