From 38555253a36eac05e2e70d621a8e362898f3532c Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Wed, 27 Jul 2022 03:42:07 +0900 Subject: [PATCH 01/14] Support 2022.2 --- build.gradle.kts | 20 +++++++++++++++++-- gradle.properties | 10 ++++++---- gradle/wrapper/gradle-wrapper.properties | 2 +- .../com/koxudaxi/pydantic/PydanticTestCase.kt | 2 +- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 0c1513d9..3202985b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,9 +5,9 @@ fun properties(key: String) = project.findProperty(key).toString() plugins { // Kotlin support - kotlin("jvm") version "1.6.10" + kotlin("jvm") version "1.7.10" // Gradle IntelliJ Plugin - id("org.jetbrains.intellij") version "1.5.3" + id("org.jetbrains.intellij") version "1.7.0" // Gradle Changelog Plugin id("org.jetbrains.changelog") version "1.3.1" // Gradle Qodana Plugin @@ -50,8 +50,24 @@ tasks { // Set the JVM compatibility versions withType { kotlinOptions.jvmTarget = properties("javaVersion") + kotlinOptions.languageVersion = properties("languageVersion") + kotlinOptions.apiVersion = properties("apiVersion") } + // workaround + withType().all { + jvmArgs( + "--add-opens", "java.base/java.io=ALL-UNNAMED", + "--add-opens", "java.base/java.util=ALL-UNNAMED", + "--add-opens", "java.desktop/sun.awt=ALL-UNNAMED", + "--add-opens", "java.desktop/java.awt=ALL-UNNAMED", + "--add-opens", "java.desktop/javax.swing=ALL-UNNAMED", + "--add-opens", "java.desktop/java.awt.event=ALL-UNNAMED", + "--add-opens", "java.desktop/javax.swing.plaf.basic=ALL-UNNAMED", + "--add-opens", "java.desktop/sun.font=ALL-UNNAMED" + + ) + } wrapper { gradleVersion = properties("gradleVersion") } diff --git a/gradle.properties b/gradle.properties index 353ef8f7..38593920 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,12 +8,12 @@ pluginVersion = 0.3.12 # See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html # for insight into build numbers and IntelliJ Platform versions. -pluginSinceBuild = 213.5744.223 -pluginUntilBuild = 221.* +pluginSinceBuild = 222.3345.99 +pluginUntilBuild = 222.* # IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties platformType = PC -platformVersion = 2021.3.2 +platformVersion = 222.3345.99-EAP-SNAPSHOT # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22 @@ -21,9 +21,11 @@ platformPlugins = python-ce # Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3 javaVersion = 11 +languageVersion = 1.7 +apiVersion = 1.6 # Gradle Releases -> https://github.com/gradle/gradle/releases -gradleVersion = 7.4 +gradleVersion = 7.5 # Opt-out flag for bundling Kotlin standard library. # See https://plugins.jetbrains.com/docs/intellij/kotlin.html#kotlin-standard-library for details. diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 41dfb879..8049c684 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/testSrc/com/koxudaxi/pydantic/PydanticTestCase.kt b/testSrc/com/koxudaxi/pydantic/PydanticTestCase.kt index 11dd75bf..1a8f3d1f 100644 --- a/testSrc/com/koxudaxi/pydantic/PydanticTestCase.kt +++ b/testSrc/com/koxudaxi/pydantic/PydanticTestCase.kt @@ -55,7 +55,7 @@ abstract class PydanticTestCase(version: String = "v1") : UsefulTestCase() { override fun setUp() { super.setUp() val factory = IdeaTestFixtureFactory.getFixtureFactory() - val fixtureBuilder = factory.createLightFixtureBuilder(projectDescriptor) + val fixtureBuilder = factory.createLightFixtureBuilder(projectDescriptor, "PyLightProject") val fixture = fixtureBuilder.fixture myFixture = IdeaTestFixtureFactory.getFixtureFactory().createCodeInsightFixture(fixture, LightTempDirTestFixtureImpl(true)) From 8cc8b56ba335b4036b94d4fccbd62e525f30b603 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Wed, 27 Jul 2022 03:56:50 +0900 Subject: [PATCH 02/14] Improve code --- src/com/koxudaxi/pydantic/PydanticConfigPanel.kt | 3 ++- src/com/koxudaxi/pydantic/PydanticConfigurable.kt | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/koxudaxi/pydantic/PydanticConfigPanel.kt b/src/com/koxudaxi/pydantic/PydanticConfigPanel.kt index 834ba285..c2c1502e 100644 --- a/src/com/koxudaxi/pydantic/PydanticConfigPanel.kt +++ b/src/com/koxudaxi/pydantic/PydanticConfigPanel.kt @@ -11,6 +11,7 @@ import javax.swing.event.HyperlinkEvent import com.intellij.ide.BrowserUtil import com.intellij.openapi.project.Project import com.intellij.ui.ColorUtil +import com.intellij.util.ui.HTMLEditorKitBuilder import com.intellij.util.ui.UIUtil class PydanticConfigPanel(project: Project) { @@ -45,7 +46,7 @@ class PydanticConfigPanel(project: Project) { private fun setHyperlinkHtml(jTextPane: JTextPane, html: String) { jTextPane.contentType = "text/html" jTextPane.isEditable = false - jTextPane.editorKit = UIUtil.getHTMLEditorKit() + jTextPane.editorKit = HTMLEditorKitBuilder.simple() val kit = jTextPane.editorKit if (kit is HTMLEditorKit) { val css = kit.styleSheet diff --git a/src/com/koxudaxi/pydantic/PydanticConfigurable.kt b/src/com/koxudaxi/pydantic/PydanticConfigurable.kt index 512b383a..0e804ba7 100644 --- a/src/com/koxudaxi/pydantic/PydanticConfigurable.kt +++ b/src/com/koxudaxi/pydantic/PydanticConfigurable.kt @@ -24,7 +24,6 @@ class PydanticConfigurable internal constructor(project: Project) : Configurable override fun reset() {} override fun isModified(): Boolean { - if (configPanel.initTyped == null || configPanel.warnUntypedFields == null) return false return (pydanticConfigService.initTyped != configPanel.initTyped) || (pydanticConfigService.warnUntypedFields != configPanel.warnUntypedFields) } From c4ea1ae732989c91be69bb5e8112e22d7631a575 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Wed, 27 Jul 2022 04:06:14 +0900 Subject: [PATCH 03/14] Fix unittest --- testData/typeinspectionv18/genericModel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testData/typeinspectionv18/genericModel.py b/testData/typeinspectionv18/genericModel.py index c7a4ddb8..168c6d85 100644 --- a/testData/typeinspectionv18/genericModel.py +++ b/testData/typeinspectionv18/genericModel.py @@ -97,7 +97,7 @@ class OuterT(GenericModel, Generic[T]): OuterT[int](outer=1, nested=nested) nested = InnerT[str](inner='a') -OuterT[int](outer='a', nested=nested) +OuterT[int](outer='a', nested=nested) AT = TypeVar('AT') BT = TypeVar('BT') From f0b35bd2cfb71c0b43d36f211277271a53b8c73d Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Wed, 27 Jul 2022 04:48:03 +0900 Subject: [PATCH 04/14] Fix unittest --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 38593920..a69ce7d0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ pluginUntilBuild = 222.* # IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties platformType = PC -platformVersion = 222.3345.99-EAP-SNAPSHOT +platformVersion = 222.3345-EAP-CANDIDATE-SNAPSHOT # Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html # Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22 From 94f6a1328d390ed5ebedff4ab13e8e1a69f33522 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Wed, 27 Jul 2022 05:30:01 +0900 Subject: [PATCH 05/14] Fix unittest --- build.gradle.kts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 3202985b..2993f244 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -71,7 +71,9 @@ tasks { wrapper { gradleVersion = properties("gradleVersion") } - + runPluginVerifier { + ideVersions.add("PCC-222.3345.99") + } patchPluginXml { version.set(properties("pluginVersion")) sinceBuild.set(properties("pluginSinceBuild")) From db930f243b2a0b9d4069d2831ec17bc8ffa6e5e9 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Wed, 27 Jul 2022 05:35:03 +0900 Subject: [PATCH 06/14] Fix unittest --- build.gradle.kts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 2993f244..a08424af 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -64,7 +64,8 @@ tasks { "--add-opens", "java.desktop/javax.swing=ALL-UNNAMED", "--add-opens", "java.desktop/java.awt.event=ALL-UNNAMED", "--add-opens", "java.desktop/javax.swing.plaf.basic=ALL-UNNAMED", - "--add-opens", "java.desktop/sun.font=ALL-UNNAMED" + "--add-opens", "java.desktop/sun.font=ALL-UNNAMED", + "--add-exports", "java.base/jdk.internal.vm=ALL-UNNAMED" ) } From 8630f86310d0128def0785f9fbf208e87ec72c51 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Wed, 27 Jul 2022 05:43:08 +0900 Subject: [PATCH 07/14] Fix CI --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb5306b0..6357ad6a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -108,7 +108,7 @@ jobs: # Run Qodana inspections - name: Qodana - Code Inspection - uses: JetBrains/qodana-action@v5.0.2 + uses: JetBrains/qodana-action@v2022.1.1 # Prepare plugin archive content for creating artifact - name: Prepare Plugin Artifact From 290634d8f1a2998a6a3b3b74111721aa07d2e5a7 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Wed, 27 Jul 2022 10:06:56 +0900 Subject: [PATCH 08/14] Update gradle.properties --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index a69ce7d0..3d35307a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,7 +22,7 @@ platformPlugins = python-ce # Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3 javaVersion = 11 languageVersion = 1.7 -apiVersion = 1.6 +apiVersion = 1.7 # Gradle Releases -> https://github.com/gradle/gradle/releases gradleVersion = 7.5 @@ -32,4 +32,4 @@ gradleVersion = 7.5 # suppress inspection "UnusedProperty" kotlin.stdlib.default.dependency = false -#org.gradle.jvmargs=-XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=utf-8 \ No newline at end of file +#org.gradle.jvmargs=-XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=utf-8 From cc8211b2e2186db11bdf7a0e219a73b3c84846c9 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Wed, 27 Jul 2022 10:08:12 +0900 Subject: [PATCH 09/14] Update build.gradle.kts --- build.gradle.kts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index a08424af..4c552266 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -23,6 +23,12 @@ repositories { mavenCentral() } +kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of(11)) + } +} + // Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin intellij { pluginName.set(properties("pluginName")) From 28ff935cc93a1f12cc8c4efad8184c00213817a0 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Wed, 27 Jul 2022 22:53:49 +0900 Subject: [PATCH 10/14] Update java version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 3d35307a..b9057adb 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,7 +20,7 @@ platformVersion = 222.3345-EAP-CANDIDATE-SNAPSHOT platformPlugins = python-ce # Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3 -javaVersion = 11 +javaVersion = 17 languageVersion = 1.7 apiVersion = 1.7 From 015148cf1ba118889da6d53472ecc6d0d2fba3f7 Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Thu, 28 Jul 2022 01:47:32 +0900 Subject: [PATCH 11/14] Update java version --- build.gradle.kts | 25 +------------------------ gradle.properties | 4 +--- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 4c552266..fd31f830 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,4 @@ import org.jetbrains.changelog.markdownToHTML -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile fun properties(key: String) = project.findProperty(key).toString() @@ -25,7 +24,7 @@ repositories { kotlin { jvmToolchain { - languageVersion.set(JavaLanguageVersion.of(11)) + languageVersion.set(JavaLanguageVersion.of(properties("javaVersion"))) } } @@ -53,28 +52,6 @@ qodana { } tasks { - // Set the JVM compatibility versions - withType { - kotlinOptions.jvmTarget = properties("javaVersion") - kotlinOptions.languageVersion = properties("languageVersion") - kotlinOptions.apiVersion = properties("apiVersion") - } - - // workaround - withType().all { - jvmArgs( - "--add-opens", "java.base/java.io=ALL-UNNAMED", - "--add-opens", "java.base/java.util=ALL-UNNAMED", - "--add-opens", "java.desktop/sun.awt=ALL-UNNAMED", - "--add-opens", "java.desktop/java.awt=ALL-UNNAMED", - "--add-opens", "java.desktop/javax.swing=ALL-UNNAMED", - "--add-opens", "java.desktop/java.awt.event=ALL-UNNAMED", - "--add-opens", "java.desktop/javax.swing.plaf.basic=ALL-UNNAMED", - "--add-opens", "java.desktop/sun.font=ALL-UNNAMED", - "--add-exports", "java.base/jdk.internal.vm=ALL-UNNAMED" - - ) - } wrapper { gradleVersion = properties("gradleVersion") } diff --git a/gradle.properties b/gradle.properties index b9057adb..c6f75611 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,9 +20,7 @@ platformVersion = 222.3345-EAP-CANDIDATE-SNAPSHOT platformPlugins = python-ce # Java language level used to compile sources and to generate the files for - Java 11 is required since 2020.3 -javaVersion = 17 -languageVersion = 1.7 -apiVersion = 1.7 +javaVersion = 11 # Gradle Releases -> https://github.com/gradle/gradle/releases gradleVersion = 7.5 From 9ac0a5d8daaddcfb1ef4aa7351cf85fbbd7e9afd Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Thu, 28 Jul 2022 01:56:56 +0900 Subject: [PATCH 12/14] remove plugin verifier option --- build.gradle.kts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index fd31f830..8cbae019 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -55,9 +55,7 @@ tasks { wrapper { gradleVersion = properties("gradleVersion") } - runPluginVerifier { - ideVersions.add("PCC-222.3345.99") - } + patchPluginXml { version.set(properties("pluginVersion")) sinceBuild.set(properties("pluginSinceBuild")) From 16df04baf780ee492a5f769749e793649be71e8f Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Thu, 28 Jul 2022 02:00:26 +0900 Subject: [PATCH 13/14] Revert "remove plugin verifier option" This reverts commit 9ac0a5d8daaddcfb1ef4aa7351cf85fbbd7e9afd. --- build.gradle.kts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8cbae019..fd31f830 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -55,7 +55,9 @@ tasks { wrapper { gradleVersion = properties("gradleVersion") } - + runPluginVerifier { + ideVersions.add("PCC-222.3345.99") + } patchPluginXml { version.set(properties("pluginVersion")) sinceBuild.set(properties("pluginSinceBuild")) From f896c52877144a70a6d5060f71a5fa1c14f9b36c Mon Sep 17 00:00:00 2001 From: Koudai Aono Date: Thu, 28 Jul 2022 03:31:43 +0900 Subject: [PATCH 14/14] bump version --- CHANGELOG.md | 6 ++++-- gradle.properties | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c2877389..33730913 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,11 @@ # Changelog ## [Unreleased] +### Features +- Support IntelliJ IDEA 2022.2.2 [[#517](https://github.com/koxudaxi/pydantic-pycharm-plugin/pull/517)] -## [0.3.12] -### Features +## 0.3.12 +### Features - Support SQLModel [[#450](https://github.com/koxudaxi/pydantic-pycharm-plugin/pull/450)] ## 0.3.11 diff --git a/gradle.properties b/gradle.properties index c6f75611..3c5ba9d8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ pluginGroup = com.koxudaxi.pydantic pluginName = Pydantic # SemVer format -> https://semver.org -pluginVersion = 0.3.12 +pluginVersion = 0.3.13 # See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html # for insight into build numbers and IntelliJ Platform versions.