Minor performance optimization
This commit is contained in:
@@ -393,7 +393,8 @@ abstract class CompletionSession(protected val configuration: CompletionSessionC
|
||||
private fun createLookupElementFactory(callType: CallType<*>?, receiverTypes: Collection<KotlinType>?): LookupElementFactory {
|
||||
val contextVariablesProvider = {
|
||||
nameExpression?.let {
|
||||
referenceVariantsHelper.getReferenceVariants(it, CallTypeAndReceiver.DEFAULT, DescriptorKindFilter.VARIABLES, nameFilter = { true })
|
||||
val descriptorFilter = DescriptorKindFilter.VARIABLES exclude DescriptorKindExclude.Extensions // we exclude extensions by performance reasons
|
||||
referenceVariantsHelper.getReferenceVariants(it, CallTypeAndReceiver.DEFAULT, descriptorFilter, nameFilter = { true })
|
||||
.map { it as VariableDescriptor }
|
||||
} ?: emptyList()
|
||||
}
|
||||
|
||||
+4
-1
@@ -26,5 +26,8 @@ val String.wrongExtension: () -> Unit
|
||||
// EXIST: { itemText: "xfoo", tailText: "(local) (<root>)", typeText: "Unit" }
|
||||
// EXIST: { itemText: "xfoo", tailText: "(global) (<root>)", typeText: "Unit" }
|
||||
// EXIST: { itemText: "xfoo", tailText: "(publicVal) (<root>)", typeText: "Unit" }
|
||||
// EXIST: { itemText: "xfoo", tailText: "(extension) (<root>)", typeText: "Unit" }
|
||||
|
||||
// excluded by performance reasons:
|
||||
// ABSENT: { itemText: "xfoo", tailText: "(extension) (<root>)", typeText: "Unit" }
|
||||
|
||||
// NOTHING_ELSE
|
||||
|
||||
+4
-1
@@ -26,5 +26,8 @@ val String.wrongExtension: () -> Unit
|
||||
// EXIST: { itemText: "xfoo", tailText: "(local) for String in <root>", typeText: "Unit" }
|
||||
// EXIST: { itemText: "xfoo", tailText: "(global) for String in <root>", typeText: "Unit" }
|
||||
// EXIST: { itemText: "xfoo", tailText: "(publicVal) for String in <root>", typeText: "Unit" }
|
||||
// EXIST: { itemText: "xfoo", tailText: "(extension) for String in <root>", typeText: "Unit" }
|
||||
|
||||
// excluded by performance reasons:
|
||||
// ABSENT: { itemText: "xfoo", tailText: "(extension) for String in <root>", typeText: "Unit" }
|
||||
|
||||
// NOTHING_ELSE
|
||||
|
||||
Reference in New Issue
Block a user