Explorar o código

[idea] Update to IDEA 2023.1, plugin version 231-2.15.0-182-1

close #2606
Him188 %!s(int64=2) %!d(string=hai) anos
pai
achega
bddee1fd20

+ 3 - 3
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")

+ 4 - 3
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<org.jetbrains.intellij.tasks.PatchPluginXmlTask> {
     sinceBuild.set("223")
-    untilBuild.set("223.*")
+    untilBuild.set("231.*")
     pluginDescription.set(
         """
         Plugin development support for <a href='https://github.com/mamoe/mirai'>Mirai Console</a>

+ 3 - 3
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
 }

+ 10 - 1
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

+ 4 - 2
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"