Skip to content

Commit ad143ee

Browse files
support for 2025.2.0.1+ (#53)
1 parent ec611aa commit ad143ee

File tree

5 files changed

+34
-25
lines changed

5 files changed

+34
-25
lines changed

build.gradle.kts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import org.jetbrains.changelog.Changelog
22
import org.jetbrains.changelog.markdownToHTML
3+
import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform
34

45
fun properties(key: String) = providers.gradleProperty(key)
56
fun environment(key: String) = providers.environmentVariable(key)
@@ -17,6 +18,17 @@ version = properties("pluginVersion").get()
1718
// Configure project's dependencies
1819
repositories {
1920
mavenCentral()
21+
intellijPlatform {
22+
defaultRepositories()
23+
}
24+
}
25+
26+
dependencies {
27+
intellijPlatform {
28+
create(properties("platformType"), properties("platformVersion"))
29+
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
30+
bundledPlugins(properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) })
31+
}
2032
}
2133

2234
// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
@@ -28,13 +40,11 @@ kotlin {
2840
}
2941

3042
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
31-
intellij {
32-
pluginName = properties("pluginName")
33-
version = properties("platformVersion")
34-
type = properties("platformType")
35-
36-
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
37-
plugins = properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }
43+
intellijPlatform {
44+
pluginConfiguration {
45+
name = properties("pluginName")
46+
version = properties("pluginVersion")
47+
}
3848
}
3949

4050
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
@@ -49,7 +59,6 @@ tasks {
4959
}
5060

5161
patchPluginXml {
52-
version = properties("pluginVersion")
5362
sinceBuild = properties("pluginSinceBuild")
5463
untilBuild = properties("pluginUntilBuild")
5564

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ pluginGroup = space.whitememory.pythoninlayparams
22
pluginName = Python Inlay Params
33
pluginRepositoryUrl = https://github.com/WhiteMemory99/Intellij-Python-Inlay-Params
44

5-
pluginVersion = 0.3.6
5+
pluginVersion = 0.3.8
66

77
# See https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html
88
# for insight into build numbers and IntelliJ Platform versions.
9-
pluginSinceBuild = 223
10-
pluginUntilBuild = 242.*
9+
pluginSinceBuild = 252
10+
pluginUntilBuild = 299.*
1111

1212
# IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension
1313
platformType = PC
14-
platformVersion = 2022.3.3
14+
platformVersion = 2025.2.0.1
1515

1616
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
1717
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
1818
platformPlugins = PythonCore
1919

2020
# Gradle Releases -> https://github.com/gradle/gradle/releases
21-
gradleVersion = 8.5
21+
gradleVersion = 8.6
2222

2323
# Opt-out flag for bundling Kotlin standard library -> https://jb.gg/intellij-platform-kotlin-stdlib
2424
kotlin.stdlib.default.dependency = false

gradle/libs.versions.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
annotations = "24.1.0"
44

55
# plugins
6-
kotlin = "1.9.21"
6+
kotlin = "2.1.21"
77
changelog = "2.2.0"
8-
gradleIntelliJPlugin = "1.16.1"
8+
gradleIntelliJPlugin = "2.7.2"
99

1010
[libraries]
1111
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
1212

1313
[plugins]
1414
changelog = { id = "org.jetbrains.changelog", version.ref = "changelog" }
15-
gradleIntelliJPlugin = { id = "org.jetbrains.intellij", version.ref = "gradleIntelliJPlugin" }
15+
gradleIntelliJPlugin = { id = "org.jetbrains.intellij.platform", version.ref = "gradleIntelliJPlugin" }
1616
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

src/main/kotlin/space/whitememory/pythoninlayparams/types/hints/HintResolver.kt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import com.jetbrains.python.PyNames
55
import com.jetbrains.python.PyTokenTypes
66
import com.jetbrains.python.codeInsight.typing.PyTypingTypeProvider
77
import com.jetbrains.python.psi.*
8-
import com.jetbrains.python.psi.impl.PyCallExpressionHelper
8+
import com.jetbrains.python.psi.impl.PyCallExpressionNavigator
99
import com.jetbrains.python.psi.types.*
1010
import space.whitememory.pythoninlayparams.types.variables.PythonVariablesInlayTypeHintsProvider
1111

@@ -172,7 +172,7 @@ enum class HintResolver {
172172

173173
if (
174174
assignedValue is PyCallExpression
175-
&& PyCallExpressionHelper.resolveCalleeClass(assignedValue) != null
175+
&& PyCallExpressionNavigator.getPyCallExpressionByCallee(assignedValue) != null
176176
) {
177177
// Handle case like User().get_name() and list()
178178
if (typeAnnotation.isBuiltin || assignedValue.callee?.reference?.resolve() is PyFunction) {
@@ -216,8 +216,8 @@ enum class HintResolver {
216216
}
217217

218218
if (expressionOperands.leftOperand is PyCallExpression && expressionOperands.rightOperand is PyCallExpression) {
219-
val isFalsePartClass = PyCallExpressionHelper.resolveCalleeClass(expressionOperands.leftOperand) != null
220-
val isTruePartClass = PyCallExpressionHelper.resolveCalleeClass(expressionOperands.rightOperand) != null
219+
val isFalsePartClass = PyCallExpressionNavigator.getPyCallExpressionByCallee(expressionOperands.leftOperand) != null
220+
val isTruePartClass = PyCallExpressionNavigator.getPyCallExpressionByCallee(expressionOperands.rightOperand) != null
221221

222222
if (isFalsePartClass && isTruePartClass) return false
223223
}
@@ -264,9 +264,9 @@ enum class HintResolver {
264264

265265
if (assignmentValue !is PyCallExpression) return true
266266

267-
if (typeAnnotation is PyNoneType) return true
267+
if (typeAnnotation is PyNoneLiteralExpression) return true
268268

269-
val resolvedClass = PyCallExpressionHelper.resolveCalleeClass(assignmentValue) ?: return true
269+
val resolvedClass = PyCallExpressionNavigator.getPyCallExpressionByCallee(assignmentValue) ?: return true
270270

271271
if (!collectionNames.contains(resolvedClass.name)) {
272272
return resolvedClass.name != typeAnnotation?.name
@@ -424,7 +424,7 @@ enum class HintResolver {
424424

425425
if (
426426
typeAnnotation == null
427-
|| (element is PyFunction && typeAnnotation is PyNoneType)
427+
|| (element is PyFunction && typeAnnotation is PyNoneLiteralExpression)
428428
|| ((element is PyFunction || element is PyTargetExpression) && (element as PyTypeCommentOwner).typeCommentAnnotation != null)
429429
|| (element is PyAnnotationOwner && element.annotation != null)
430430
) {
@@ -433,7 +433,7 @@ enum class HintResolver {
433433

434434
if (typeAnnotation is PyUnionType) {
435435
return !typeAnnotation.members.all {
436-
PyTypeChecker.isUnknown(it, false, typeEvalContext) || (it is PyNoneType || it == null)
436+
PyTypeChecker.isUnknown(it, false, typeEvalContext) || (it is PyNoneLiteralExpression || it == null)
437437
}
438438
}
439439

0 commit comments

Comments
 (0)