Replace single line let: application on IDEA + front-end modules
This commit is contained in:
@@ -42,7 +42,8 @@ class FileScopeProviderImpl(
|
||||
) : FileScopeProvider {
|
||||
|
||||
private val cache = storageManager.createMemoizedFunction<KtFile, FileScopes> { file ->
|
||||
val scopes = (file.originalFile as KtFile?)?.fileScopesCustomizer?.let { it.createFileScopes(fileScopeFactory) } ?: fileScopeFactory.createScopesForFile(file)
|
||||
val scopes = (file.originalFile as KtFile?)?.fileScopesCustomizer?.createFileScopes(fileScopeFactory)
|
||||
?: fileScopeFactory.createScopesForFile(file)
|
||||
bindingTrace.recordScope(scopes.lexicalScope, file)
|
||||
scopes
|
||||
}
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ class KotlinIntroduceParameterMethodUsageProcessor : IntroduceParameterMethodUsa
|
||||
data.parametersToRemove.toNativeArray().sortedDescending().forEach { changeInfo.removeParameter(it) }
|
||||
|
||||
// Temporarily assume that the new parameter is of Any type. Actual type is substituted during the signature update phase
|
||||
val defaultValueForCall = (data.parameterInitializer.expression as? PsiExpression)?.let { it.j2k() }
|
||||
val defaultValueForCall = (data.parameterInitializer.expression as? PsiExpression)?.j2k()
|
||||
changeInfo.addParameter(KotlinParameterInfo(callableDescriptor = psiMethodDescriptor,
|
||||
name = data.parameterName,
|
||||
originalTypeInfo = KotlinTypeInfo(false, psiMethodDescriptor.builtIns.anyType),
|
||||
|
||||
@@ -386,11 +386,9 @@ fun <T> chooseContainerElement(
|
||||
else -> null
|
||||
} ?: return null
|
||||
val name = renderName()
|
||||
val params = (descriptor as? FunctionDescriptor)?.let { descriptor ->
|
||||
descriptor.valueParameters
|
||||
.map { DescriptorRenderer.Companion.SHORT_NAMES_IN_TYPES.renderType(it.type) }
|
||||
.joinToString(", ", "(", ")")
|
||||
} ?: ""
|
||||
val params = (descriptor as? FunctionDescriptor)?.valueParameters
|
||||
?.map { DescriptorRenderer.Companion.SHORT_NAMES_IN_TYPES.renderType(it.type) }
|
||||
?.joinToString(", ", "(", ")") ?: ""
|
||||
return "$name$params"
|
||||
}
|
||||
|
||||
|
||||
+2
-5
@@ -158,11 +158,8 @@ class KotlinSafeDeleteProcessor : JavaSafeDeleteProcessor() {
|
||||
|
||||
val referencedElement = reference.element
|
||||
|
||||
val argList = referencedElement.getNonStrictParentOfType<KtUserType>()?.let { jetType ->
|
||||
jetType.typeArgumentList
|
||||
} ?: referencedElement.getNonStrictParentOfType<KtCallExpression>()?.let { callExpression ->
|
||||
callExpression.typeArgumentList
|
||||
} ?: null
|
||||
val argList = referencedElement.getNonStrictParentOfType<KtUserType>()?.typeArgumentList
|
||||
?: referencedElement.getNonStrictParentOfType<KtCallExpression>()?.typeArgumentList
|
||||
|
||||
if (argList != null) {
|
||||
val projections = argList.arguments
|
||||
|
||||
Reference in New Issue
Block a user