Ordering items in smart completion for nullable
This commit is contained in:
@@ -56,6 +56,6 @@ object KeywordValues {
|
||||
|
||||
collection.addLookupElements(expectedInfos,
|
||||
{ info -> if (info.type.isNullable()) ExpectedInfoClassification.MATCHES else ExpectedInfoClassification.NOT_MATCHES },
|
||||
{ LookupElementBuilder.create("null").bold() })
|
||||
{ LookupElementBuilder.create("null").bold().assignSmartCompletionPriority(SmartCompletionItemPriority.NULL) })
|
||||
}
|
||||
}
|
||||
@@ -209,6 +209,7 @@ enum class SmartCompletionItemPriority {
|
||||
LAMBDA_NO_PARAMS
|
||||
LAMBDA
|
||||
FUNCTION_REFERENCE
|
||||
NULL
|
||||
}
|
||||
|
||||
val SMART_COMPLETION_ITEM_PRIORITY_KEY = Key<SmartCompletionItemPriority>("SMART_COMPLETION_ITEM_PRIORITY_KEY")
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
var global: C = C()
|
||||
|
||||
abstract class C {
|
||||
class object {
|
||||
val INSTANCE = C()
|
||||
}
|
||||
}
|
||||
|
||||
fun foo(p: C?) {
|
||||
val local = C()
|
||||
foo(<caret>)
|
||||
}
|
||||
|
||||
|
||||
// ORDER: p
|
||||
// ORDER: local
|
||||
// ORDER: global
|
||||
// ORDER: C.INSTANCE
|
||||
// ORDER: object
|
||||
// ORDER: null
|
||||
Reference in New Issue
Block a user