More correct keyword completion after @
This commit is contained in:
@@ -35,10 +35,7 @@ import org.jetbrains.kotlin.lexer.JetKeywordToken
|
||||
import org.jetbrains.kotlin.lexer.JetModifierKeywordToken
|
||||
import org.jetbrains.kotlin.lexer.JetTokens.*
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
|
||||
import org.jetbrains.kotlin.psi.psiUtil.nextLeaf
|
||||
import org.jetbrains.kotlin.psi.psiUtil.prevLeaf
|
||||
import org.jetbrains.kotlin.psi.psiUtil.siblings
|
||||
import org.jetbrains.kotlin.psi.psiUtil.*
|
||||
import org.jetbrains.kotlin.resolve.ModifierCheckerCore
|
||||
|
||||
open class KeywordLookupObject
|
||||
@@ -194,7 +191,7 @@ object KeywordCompletion {
|
||||
|
||||
elementAt.getNonStrictParentOfType<PsiErrorElement>() != null -> return false
|
||||
|
||||
elementAt.prevLeaf { it !is PsiWhiteSpace && it !is PsiComment } is PsiErrorElement -> return false
|
||||
elementAt.prevLeaf { it !is PsiWhiteSpace && it !is PsiComment }?.parentsWithSelf?.any { it is PsiErrorElement } ?: false -> return false
|
||||
|
||||
keywordTokenType !is JetModifierKeywordToken -> return true
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
// EXIST: {"lookupString":"fun","itemText":"fun","attributes":"bold"}
|
||||
// EXIST: {"lookupString":"interface","itemText":"interface","attributes":"bold"}
|
||||
// EXIST: {"lookupString":"object","itemText":"object","attributes":"bold"}
|
||||
// EXIST: {"lookupString":"package","itemText":"package","attributes":"bold"}
|
||||
// EXIST: {"lookupString":"val","itemText":"val","attributes":"bold"}
|
||||
// EXIST: {"lookupString":"var","itemText":"var","attributes":"bold"}
|
||||
// NOTHING_ELSE
|
||||
|
||||
+1
-3
@@ -9,8 +9,6 @@ class Completion(@get:Ann val p1: String, @<caret>)
|
||||
// EXIST: setparam
|
||||
// EXIST: property
|
||||
|
||||
/*TODO: keywords below should not be here*/
|
||||
// EXIST: val
|
||||
// EXIST: var
|
||||
/*TODO: in fact is not applicable */
|
||||
// EXIST: receiver
|
||||
// NOTHING_ELSE
|
||||
|
||||
Reference in New Issue
Block a user