From 3f451d7eafdc337866979a333d58028e49637726 Mon Sep 17 00:00:00 2001 From: Natalia Selezneva Date: Thu, 8 Aug 2019 12:45:26 +0300 Subject: [PATCH] Switch off SAM adapter conversion for constructors in completion It is very slow in completion for build.gradle.kts because it creates SAM adapters for constructors of all imported classes Note that those SamAdapters weren't shown in completion in any case because they were filtered by name filter (SamAdapters for constructors have name) --- .../kotlin/idea/codeInsight/ReferenceVariantsHelper.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/idea/ide-common/src/org/jetbrains/kotlin/idea/codeInsight/ReferenceVariantsHelper.kt b/idea/ide-common/src/org/jetbrains/kotlin/idea/codeInsight/ReferenceVariantsHelper.kt index 27cc9bdf9df..99dc68cec1c 100644 --- a/idea/ide-common/src/org/jetbrains/kotlin/idea/codeInsight/ReferenceVariantsHelper.kt +++ b/idea/ide-common/src/org/jetbrains/kotlin/idea/codeInsight/ReferenceVariantsHelper.kt @@ -478,8 +478,8 @@ fun ResolutionScope.collectSyntheticStaticMembersAndConstructors( kindFilter: DescriptorKindFilter, nameFilter: (Name) -> Boolean ): List { - val syntheticScopes = resolutionFacade.getFrontendService(SyntheticScopes::class.java).forceEnableSamAdapters() - return (syntheticScopes.collectSyntheticStaticFunctions(this) + syntheticScopes.collectSyntheticConstructors(this)) + val syntheticScopes = resolutionFacade.getFrontendService(SyntheticScopes::class.java) + return (syntheticScopes.forceEnableSamAdapters().collectSyntheticStaticFunctions(this) + syntheticScopes.collectSyntheticConstructors(this)) .filter { kindFilter.accepts(it) && nameFilter(it.name) } }