diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/JoinParameterListIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/JoinParameterListIntention.kt index 926c52eb75a..c6fe14333a0 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/JoinParameterListIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/JoinParameterListIntention.kt @@ -6,10 +6,13 @@ package org.jetbrains.kotlin.idea.intentions import com.intellij.openapi.editor.Editor +import com.intellij.psi.PsiComment import com.intellij.psi.PsiDocumentManager import com.intellij.psi.codeStyle.CodeStyleManager import org.jetbrains.kotlin.idea.KotlinBundle +import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.psi.* +import org.jetbrains.kotlin.psi.psiUtil.allChildren import org.jetbrains.kotlin.psi.psiUtil.createSmartPointer import org.jetbrains.kotlin.psi.psiUtil.endOffset import org.jetbrains.kotlin.psi.psiUtil.startOffset @@ -22,7 +25,8 @@ abstract class AbstractJoinListIntention1, // comment + 2 +) \ No newline at end of file diff --git a/idea/testData/intentions/joinParameterList/hasEndOfLineComment.kt b/idea/testData/intentions/joinParameterList/hasEndOfLineComment.kt new file mode 100644 index 00000000000..48c0744541a --- /dev/null +++ b/idea/testData/intentions/joinParameterList/hasEndOfLineComment.kt @@ -0,0 +1,5 @@ +// IS_APPLICABLE: false +fun foo( + a: Int, // comment + b: Int +) = 1 \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java index 8df4d86e983..8f32c5e64d1 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java @@ -10412,6 +10412,11 @@ public class IntentionTestGenerated extends AbstractIntentionTest { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/intentions/joinArgumentList"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), null, true); } + @TestMetadata("hasEndOfLineComment.kt") + public void testHasEndOfLineComment() throws Exception { + runTest("idea/testData/intentions/joinArgumentList/hasEndOfLineComment.kt"); + } + @TestMetadata("hasLineBreakBeforeFirstArg.kt") public void testHasLineBreakBeforeFirstArg() throws Exception { runTest("idea/testData/intentions/joinArgumentList/hasLineBreakBeforeFirstArg.kt"); @@ -10613,6 +10618,11 @@ public class IntentionTestGenerated extends AbstractIntentionTest { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/intentions/joinParameterList"), Pattern.compile("^([\\w\\-_]+)\\.(kt|kts)$"), null, true); } + @TestMetadata("hasEndOfLineComment.kt") + public void testHasEndOfLineComment() throws Exception { + runTest("idea/testData/intentions/joinParameterList/hasEndOfLineComment.kt"); + } + @TestMetadata("hasLineBreakBeforeFirstParam.kt") public void testHasLineBreakBeforeFirstParam() throws Exception { runTest("idea/testData/intentions/joinParameterList/hasLineBreakBeforeFirstParam.kt");