Skip to content

Commit 70fdadd

Browse files
authored
Merge pull request #4 from takemikami/support_liststyle_argnames
Support liststyle argnames
2 parents 8e83906 + 3130531 commit 70fdadd

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group = "com.github.takemikami.intellij.plugin.pytestparametrize"
8-
version = "0.0.1"
8+
version = "0.0.2"
99

1010
repositories {
1111
mavenCentral()
@@ -14,7 +14,7 @@ repositories {
1414
// Configure Gradle IntelliJ Plugin
1515
// Read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
1616
intellij {
17-
version.set("2021.3")
17+
version.set("2023.1")
1818
type.set("PC") // Target IDE Platform
1919

2020
// plugins.set(listOf(/* Plugin Dependencies */))
@@ -33,7 +33,7 @@ tasks {
3333

3434
patchPluginXml {
3535
sinceBuild.set("213")
36-
untilBuild.set("223.*")
36+
untilBuild.set("231.*")
3737
}
3838

3939
signPlugin {

src/main/kotlin/com/github/takemikami/intellij/plugin/pytestparametrize/PytestParametrizeInlayHintsCollector.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,13 @@ class PytestParametrizeInlayHintsCollector(
2424
&& element.arguments.size >= 2) {
2525
val names = element.arguments[0]
2626
val valList = element.arguments[1]
27-
if (names !is PyStringLiteralExpression || valList !is PyListLiteralExpression) { return true }
27+
if (valList !is PyListLiteralExpression
28+
|| (names !is PyStringLiteralExpression && names !is PyListLiteralExpression)) { return true }
2829

29-
val nameKeys = names.stringValue.split(",").map{it.trim()}
30+
val nameKeys = if (names is PyStringLiteralExpression)
31+
names.stringValue.split(",").map{it.trim()}
32+
else
33+
names.children.map{it.text.removeSurrounding("\"").removeSurrounding("\'")}
3034
val hintName: InlayPresentation = factory.seq()
3135
for ((idx, paramset) in valList.elements.withIndex()) {
3236
if (paramset !is PyParenthesizedExpression) { continue }

0 commit comments

Comments
 (0)