Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update kotlin version, idea gradle plugin and target idea version #93

Merged
merged 2 commits into from
Mar 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlinVersion = '1.7.20'
ext.kotlinVersion = '1.8.10'
repositories {
mavenCentral()
}
Expand All @@ -10,8 +10,8 @@ buildscript {

plugins {
id 'java'
id 'org.jetbrains.intellij' version '1.10.1'
id 'org.jetbrains.kotlin.jvm' version '1.7.20'
id 'org.jetbrains.intellij' version '1.13.3'
id 'org.jetbrains.kotlin.jvm' version '1.8.10'
}

apply plugin: 'org.jetbrains.intellij'
Expand All @@ -21,7 +21,7 @@ sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

intellij {
version = '2022.2'
version = '2023.1'
plugins = ['Kotlin', 'java']
pluginName = 'kotlin-fill-class'
updateSinceUntilBuild = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
import org.jetbrains.kotlin.resolve.calls.util.getParameterForArgument
import org.jetbrains.kotlin.resolve.lazy.descriptors.LazyClassDescriptor
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.utils.addToStdlib.safeAs

abstract class BaseFillClassInspection(
@JvmField var withoutDefaultValues: Boolean = false,
Expand Down Expand Up @@ -120,7 +119,7 @@ open class FillClassFix(

override fun applyFix(project: Project, descriptor: ProblemDescriptor) {
val argumentList = descriptor.psiElement as? KtValueArgumentList ?: return
val (resolvedCall, functionDescriptor) = argumentList.parent.safeAs<KtCallElement>()?.analyze() ?: return
val (resolvedCall, functionDescriptor) = (argumentList.parent as? KtCallElement)?.analyze() ?: return
argumentList.fillArguments(functionDescriptor.valueParameters, resolvedCall)
}

Expand All @@ -132,7 +131,7 @@ open class FillClassFix(
val argumentSize = arguments.size
val argumentNames = arguments.mapNotNull { it.getArgumentName()?.asName?.identifier }

val lambdaArgument = parent.safeAs<KtCallElement>()?.lambdaArguments?.singleOrNull()
val lambdaArgument = (parent as? KtCallElement)?.lambdaArguments?.singleOrNull()
val parameterForLambdaArgument = lambdaArgument?.let { resolvedCall?.getParameterForArgument(it) }

val factory = KtPsiFactory(this)
Expand Down