diff --git a/ktlint-ruleset-standard/src/main/kotlin/com/github/shyiko/ktlint/ruleset/standard/ParameterListWrappingRule.kt b/ktlint-ruleset-standard/src/main/kotlin/com/github/shyiko/ktlint/ruleset/standard/ParameterListWrappingRule.kt index e2bc207b85..00aea29b42 100644 --- a/ktlint-ruleset-standard/src/main/kotlin/com/github/shyiko/ktlint/ruleset/standard/ParameterListWrappingRule.kt +++ b/ktlint-ruleset-standard/src/main/kotlin/com/github/shyiko/ktlint/ruleset/standard/ParameterListWrappingRule.kt @@ -88,7 +88,7 @@ class ParameterListWrappingRule : Rule("parameter-list-wrapping") { paramInnerIndentAdjustment = adjustedIndent.length - prevLeaf.textLength (prevLeaf as LeafPsiElement).rawReplaceWithText(adjustedIndent) } - } else { + } else if (prevLeaf?.prevLeafIgnoringWhitespaceAndComments()?.node?.elementType != KtTokens.LPAR) { emit(child.startOffset, errorMessage(child), true) if (autoCorrect) { paramInnerIndentAdjustment = intendedIndent.length - child.psi.column diff --git a/ktlint-ruleset-standard/src/test/kotlin/com/github/shyiko/ktlint/ruleset/standard/ParameterListWrappingRuleTest.kt b/ktlint-ruleset-standard/src/test/kotlin/com/github/shyiko/ktlint/ruleset/standard/ParameterListWrappingRuleTest.kt index 24c048e969..c7b98613ec 100644 --- a/ktlint-ruleset-standard/src/test/kotlin/com/github/shyiko/ktlint/ruleset/standard/ParameterListWrappingRuleTest.kt +++ b/ktlint-ruleset-standard/src/test/kotlin/com/github/shyiko/ktlint/ruleset/standard/ParameterListWrappingRuleTest.kt @@ -137,6 +137,8 @@ class ParameterListWrappingRuleTest { b: Any, c: Any) { } + fun f() {} + fun f(/**/) {} """.trimIndent() )).isEqualTo( listOf(