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 <init> name)
This commit is contained in:
Natalia Selezneva
2019-08-08 12:45:26 +03:00
parent f7b8c7f76e
commit 3f451d7eaf
@@ -478,8 +478,8 @@ fun ResolutionScope.collectSyntheticStaticMembersAndConstructors(
kindFilter: DescriptorKindFilter,
nameFilter: (Name) -> Boolean
): List<FunctionDescriptor> {
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) }
}