Minor performance optimization

This commit is contained in:
Valentin Kipyatkov
2015-10-28 22:09:11 +03:00
parent 4ab2019da4
commit 2e80a7194c
3 changed files with 10 additions and 3 deletions
@@ -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()
}
@@ -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
@@ -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