From bddee1fd2032a00718c794a020239b38d9b3abc4 Mon Sep 17 00:00:00 2001 From: Him188 Date: Sat, 1 Apr 2023 18:23:04 +0100 Subject: [PATCH] [idea] Update to IDEA 2023.1, plugin version 231-2.15.0-182-1 close #2606 --- buildSrc/src/main/kotlin/Versions.kt | 6 +++--- mirai-console/tools/intellij-plugin/build.gradle.kts | 7 ++++--- .../run/projects/test-project/build.gradle.kts | 6 +++--- .../gradle/wrapper/gradle-wrapper.properties | 11 ++++++++++- .../src/diagnostics/PluginDataValuesChecker.kt | 6 ++++-- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt index 3e0060f97..7c8dfb9fa 100644 --- a/buildSrc/src/main/kotlin/Versions.kt +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -28,14 +28,14 @@ object Versions { val core get() = project val console get() = project - val consoleIntellij get() = "223-$project-172-1" // idea-mirai-kotlin-patch + val consoleIntellij get() = "231-$project-182-1" // idea-mirai-kotlin-patch val consoleTerminal get() = project const val kotlinCompiler = "1.8.10" const val kotlinStdlib = kotlinCompiler const val dokka = "1.8.10" - const val kotlinCompilerForIdeaPlugin = "1.8.10" + const val kotlinCompilerForIdeaPlugin = "1.8.20-RC" // 231 bundles 1.8.20 const val coroutines = "1.6.4" const val atomicFU = "0.20.0" @@ -84,7 +84,7 @@ object Versions { // don't update easily unless you want your disk space -= 1000 MB // (700 MB for IDEA, 150 MB for sources, 150 MB for JBR) - const val intellij = "2022.3.1" + const val intellij = "2023.1" } @Suppress("unused") diff --git a/mirai-console/tools/intellij-plugin/build.gradle.kts b/mirai-console/tools/intellij-plugin/build.gradle.kts index 0a7e08766..ceecb5ea2 100644 --- a/mirai-console/tools/intellij-plugin/build.gradle.kts +++ b/mirai-console/tools/intellij-plugin/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2019-2022 Mamoe Technologies and contributors. + * Copyright 2019-2023 Mamoe Technologies and contributors. * * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link. @@ -65,14 +65,15 @@ fun File.resolveMkdir(relative: String): File { kotlin.target.compilations.all { kotlinOptions { jvmTarget = "17" - apiVersion = "1.7" // bundled Kotlin is 1.7.20 + apiVersion = "1.9" // bundled Kotlin is 1.7.20 + languageVersion = "1.9" // idea requires 1.9 } } // https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library tasks.withType { sinceBuild.set("223") - untilBuild.set("223.*") + untilBuild.set("231.*") pluginDescription.set( """ Plugin development support for Mirai Console diff --git a/mirai-console/tools/intellij-plugin/run/projects/test-project/build.gradle.kts b/mirai-console/tools/intellij-plugin/run/projects/test-project/build.gradle.kts index cefd7c8ab..9652116b5 100644 --- a/mirai-console/tools/intellij-plugin/run/projects/test-project/build.gradle.kts +++ b/mirai-console/tools/intellij-plugin/run/projects/test-project/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2019-2022 Mamoe Technologies and contributors. + * Copyright 2019-2023 Mamoe Technologies and contributors. * * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link. @@ -8,8 +8,8 @@ */ plugins { - kotlin("jvm") version "1.7.20" - kotlin("plugin.serialization") version "1.7.20" + kotlin("jvm") version "1.8.10" + kotlin("plugin.serialization") version "1.8.10" id("net.mamoe.mirai-console") version "2.99.0-local" java } diff --git a/mirai-console/tools/intellij-plugin/run/projects/test-project/gradle/wrapper/gradle-wrapper.properties b/mirai-console/tools/intellij-plugin/run/projects/test-project/gradle/wrapper/gradle-wrapper.properties index da9702f9e..0eab02fe3 100644 --- a/mirai-console/tools/intellij-plugin/run/projects/test-project/gradle/wrapper/gradle-wrapper.properties +++ b/mirai-console/tools/intellij-plugin/run/projects/test-project/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,14 @@ +# +# Copyright 2019-2023 Mamoe Technologies and contributors. +# +# 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. +# Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link. +# +# https://github.com/mamoe/mirai/blob/dev/LICENSE +# + distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/mirai-console/tools/intellij-plugin/src/diagnostics/PluginDataValuesChecker.kt b/mirai-console/tools/intellij-plugin/src/diagnostics/PluginDataValuesChecker.kt index 2997a6ac0..0df7707fe 100644 --- a/mirai-console/tools/intellij-plugin/src/diagnostics/PluginDataValuesChecker.kt +++ b/mirai-console/tools/intellij-plugin/src/diagnostics/PluginDataValuesChecker.kt @@ -1,5 +1,5 @@ /* - * Copyright 2019-2022 Mamoe Technologies and contributors. + * Copyright 2019-2023 Mamoe Technologies and contributors. * * 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. * Use of this source code is governed by the GNU AGPLv3 license that can be found through the following link. @@ -24,6 +24,7 @@ import org.jetbrains.kotlin.idea.inspections.collections.isCalling import org.jetbrains.kotlin.idea.project.builtIns import org.jetbrains.kotlin.idea.refactoring.fqName.fqName import org.jetbrains.kotlin.js.descriptorUtils.getJetTypeFqName +import org.jetbrains.kotlin.js.descriptorUtils.getKotlinTypeFqName import org.jetbrains.kotlin.psi.* import org.jetbrains.kotlin.psi.psiUtil.containingClassOrObject import org.jetbrains.kotlin.resolve.calls.checkers.CallChecker @@ -109,7 +110,7 @@ class PluginDataValuesChecker : CallChecker, DeclarationChecker { context: CallCheckerContext ) { val classDescriptor = type.classDescriptor() ?: return - val jetTypeFqn = type.getJetTypeFqName(false) + val jetTypeFqn = type.getKotlinTypeFqName(false) val builtIns = callExpr.builtIns val factory = when { @@ -194,6 +195,7 @@ private fun canBeSerializedInternally(descriptor: ClassDescriptor): Boolean { "kotlin.collections.Collection", "kotlin.collections.List", "kotlin.collections.ArrayList", "kotlin.collections.MutableList", -> "ArrayListSerializer" + "kotlin.collections.Set", "kotlin.collections.LinkedHashSet", "kotlin.collections.MutableSet" -> "LinkedHashSetSerializer" "kotlin.collections.HashSet" -> "HashSetSerializer" "kotlin.collections.Map", "kotlin.collections.LinkedHashMap", "kotlin.collections.MutableMap" -> "LinkedHashMapSerializer"