From e38eacf2fcb04557a8ab3adbd3718983aab90f6c Mon Sep 17 00:00:00 2001 From: Christoph Graupner Date: Tue, 9 Feb 2021 07:13:14 +0100 Subject: [PATCH 1/2] GH-2 prepare CHANGELOG.md for release pipeline, improved logo --- CHANGELOG.md | 22 +- .../KotlinFunctionArgumentsHelperIntention.kt | 13 +- src/main/resources/META-INF/pluginIcon.svg | 194 ++++++++++++++---- 3 files changed, 163 insertions(+), 66 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 473a798..168c4fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,32 +2,20 @@ # Kotlin Function Arguments Helper Changelog -## [2021.1.1] +## [Unreleased] ### Added - plugin logo ### Changed -- dropped support for IDEA before `2020.3` +- rebased plugin on [IntelliJ Platform Plugin Template](https://github.com/JetBrains/intellij-platform-plugin-template) - build with kotlin `1.4.30` -### Fixed -- runs now with IDEA `2021.*` - -## [Unreleased] -### Added - -### Changed - -### Deprecated - ### Removed +- dropped support for IDEA before `2020.3` ### Fixed - -### Security -## [unspecified] -### Changed -- rebased plugin on [IntelliJ Platform Plugin Template](https://github.com/JetBrains/intellij-platform-plugin-template) +- runs now with IDEA `2021.*` +- Release build pipeline ## [2020.1.2] ### Added diff --git a/src/main/kotlin/com/github/developerutils/kotlinfunctionargumentshelper/KotlinFunctionArgumentsHelperIntention.kt b/src/main/kotlin/com/github/developerutils/kotlinfunctionargumentshelper/KotlinFunctionArgumentsHelperIntention.kt index 01d4144..a90bde9 100644 --- a/src/main/kotlin/com/github/developerutils/kotlinfunctionargumentshelper/KotlinFunctionArgumentsHelperIntention.kt +++ b/src/main/kotlin/com/github/developerutils/kotlinfunctionargumentshelper/KotlinFunctionArgumentsHelperIntention.kt @@ -47,17 +47,20 @@ class KotlinFunctionArgumentsHelperIntention : SelfTargetingIntention()?.calleeExpression ?: return null val context = calleeExpression.analyze(BodyResolveMode.PARTIAL) val descriptor = calleeExpression.getReferenceTargets(context).firstOrNull() as? FunctionDescriptor - if (descriptor is JavaCallableMemberDescriptor) return null - return descriptor.takeIf { it is ClassConstructorDescriptor || it is SimpleFunctionDescriptor } + return if (descriptor is JavaCallableMemberDescriptor) { + null + } else { + descriptor.takeIf { it is ClassConstructorDescriptor || it is SimpleFunctionDescriptor } + } } private fun KtValueArgumentList.fillArguments(parameters: List) { - val arguments = this.arguments val argumentNames = arguments.mapNotNull { it.getArgumentName()?.asName?.identifier } val factory = KtPsiFactory(this) parameters.forEachIndexed { index, parameter -> - if (arguments.size > index && !arguments[index].isNamed()) return@forEachIndexed - if (parameter.name.identifier in argumentNames) return@forEachIndexed + if (arguments.size > index && !arguments[index].isNamed()) return + if (parameter.name.identifier in argumentNames) return + val added = addArgument(createDefaultValueArgument(parameter, factory)) val argumentExpression = added.getArgumentExpression() if (argumentExpression is KtQualifiedExpression) { diff --git a/src/main/resources/META-INF/pluginIcon.svg b/src/main/resources/META-INF/pluginIcon.svg index 8240059..70284a7 100644 --- a/src/main/resources/META-INF/pluginIcon.svg +++ b/src/main/resources/META-INF/pluginIcon.svg @@ -5,6 +5,7 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="81" @@ -37,19 +38,79 @@ guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:window-width="1711" - inkscape:window-height="1018" + inkscape:window-width="1920" + inkscape:window-height="1056" id="namedview96" showgrid="false" inkscape:zoom="8.34386" - inkscape:cx="9.8931173" + inkscape:cx="24.334874" inkscape:cy="42.157274" inkscape:window-x="0" inkscape:window-y="0" - inkscape:window-maximized="0" - inkscape:current-layer="text3809-6" /> + inkscape:window-maximized="1" + inkscape:current-layer="layer2" /> + + + + + + + + + + + + + + + + + + + + + + + + + - - + + id="g4594" + transform="matrix(0.90308308,0,0,1,0.26176185,3.5954582)" + style="fill:#f26522;fill-opacity:1"> + + + + id="g4602" + style="fill:#f4af3d;fill-opacity:1"> + id="g4648" + style="fill:url(#radialGradient4656);fill-opacity:1"> - - + id="path4752" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:'DejaVu Sans Mono';-inkscape-font-specification:'DejaVu Sans Mono Bold';fill:url(#radialGradient4680);fill-opacity:1;stroke-width:0.9067961" + d="m 51.42426,20.351045 q -2.337834,4.232896 -3.471329,8.20013 -1.133496,3.967233 -1.133496,7.934466 0,3.931812 1.133496,7.934467 1.133495,3.984944 3.471329,8.235551 h -4.038077 q -2.816027,-4.091209 -4.179764,-8.058443 -1.363736,-3.984944 -1.363736,-8.111575 0,-4.10892 1.363736,-8.093864 1.381448,-4.002655 4.179764,-8.040732 z" /> + + + id="path4754" + style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-family:'DejaVu Sans Mono';-inkscape-font-specification:'DejaVu Sans Mono Bold';fill:url(#radialGradient4692);fill-opacity:1;stroke-width:0.9067961" + d="m 62.369573,20.351045 h 4.038077 q 2.798316,4.038077 4.162052,8.040732 1.381448,3.984944 1.381448,8.093864 0,4.126631 -1.363737,8.111575 -1.363736,3.967234 -4.179763,8.058443 h -4.038077 q 2.337834,-4.250607 3.471329,-8.235551 1.133495,-4.002655 1.133495,-7.934467 0,-3.967233 -1.133495,-7.934466 -1.133495,-3.967234 -3.471329,-8.20013 z" /> - - From 0397c754083d8c0481c3245f0537ce80009ef394 Mon Sep 17 00:00:00 2001 From: Christoph Graupner Date: Tue, 9 Feb 2021 07:16:24 +0100 Subject: [PATCH 2/2] GH-2 bump version to v2021.1.2 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index e3751df..31dcdfa 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ pluginGroup = com.github.developerutils.kotlin-function-arguments-helper pluginName_ = Kotlin Function Arguments Helper -pluginVersion = 2021.1.1 +pluginVersion = 2021.1.2 pluginSinceBuild = 203 pluginUntilBuild = 213.* # Plugin Verifier integration -> https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl