Skip to content

Commit

Permalink
Merge pull request #6 from DeveloperUtils/better-logo
Browse files Browse the repository at this point in the history
GH-2 prepare CHANGELOG.md for release pipeline, improved logo
  • Loading branch information
WorkingDevel authored Feb 9, 2021
2 parents 6e6c5d4 + 0397c75 commit 435b005
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 67 deletions.
22 changes: 5 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,20 @@ class KotlinFunctionArgumentsHelperIntention : SelfTargetingIntention<KtValueArg
val calleeExpression = getStrictParentOfType<KtCallExpression>()?.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<ValueParameterDescriptor>) {
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) {
Expand Down
194 changes: 150 additions & 44 deletions src/main/resources/META-INF/pluginIcon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 435b005

Please sign in to comment.