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

Support 2022.2 #517

Merged
merged 14 commits into from
Jul 27, 2022
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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
20 changes: 11 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

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
Expand All @@ -23,6 +22,12 @@ repositories {
mavenCentral()
}

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(properties("javaVersion")))
}
}

// Configure Gradle IntelliJ Plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
intellij {
pluginName.set(properties("pluginName"))
Expand All @@ -47,15 +52,12 @@ qodana {
}

tasks {
// Set the JVM compatibility versions
withType<KotlinCompile> {
kotlinOptions.jvmTarget = properties("javaVersion")
}

wrapper {
gradleVersion = properties("gradleVersion")
}

runPluginVerifier {
ideVersions.add("PCC-222.3345.99")
}
patchPluginXml {
version.set(properties("pluginVersion"))
sinceBuild.set(properties("pluginSinceBuild"))
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
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.
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-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
Expand All @@ -23,11 +23,11 @@ platformPlugins = python-ce
javaVersion = 11

# 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.
# 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
#org.gradle.jvmargs=-XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx1024m -Dfile.encoding=utf-8
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion src/com/koxudaxi/pydantic/PydanticConfigPanel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/com/koxudaxi/pydantic/PydanticConfigurable.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion testData/typeinspectionv18/genericModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class OuterT(GenericModel, Generic[T]):
OuterT[int](outer=1, nested=nested)

nested = InnerT[str](inner='a')
OuterT[int](<warning descr="Expected type 'int', got 'str' instead">outer='a'</warning>, nested=nested)
OuterT[int](<warning descr="Expected type 'int', got 'str' instead">outer='a'</warning>, <warning descr="Expected type 'InnerT[int]', got 'InnerT[str]' instead">nested=nested</warning>)

AT = TypeVar('AT')
BT = TypeVar('BT')
Expand Down
2 changes: 1 addition & 1 deletion testSrc/com/koxudaxi/pydantic/PydanticTestCase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down