This commit is contained in:
Valentin Kipyatkov
2014-10-16 15:13:34 +04:00
parent 6b163bca8a
commit 79123d6bb6
2 changed files with 3 additions and 4 deletions
@@ -176,11 +176,10 @@ object KeywordCompletion {
private fun PsiElement.prevLeafSkipWhitespacesAndComments(): PsiElement? {
var leaf = prevLeaf()
while (leaf != null) {
if (leaf !is PsiWhiteSpace && leaf !is PsiComment) return leaf
while (leaf is PsiWhiteSpace || leaf is PsiComment) {
leaf = leaf!!.prevLeaf()
}
return null
return leaf
}
// builds text within scope (or from the start of the file) before position element excluding almost all declarations
@@ -4,7 +4,7 @@ class A {
}
fun bar() {
fun()
foo()
}
<caret>