Revert "RemoveBracesIntention: add new line for long expression"

This reverts commit f4b9c477
This commit is contained in:
Yan Zhulanow
2020-10-24 00:19:21 +09:00
parent f615ed2f26
commit d735637f1e
6 changed files with 0 additions and 51 deletions
@@ -62,13 +62,6 @@ class RemoveBracesIntention : SelfTargetingIntention<KtElement>(KtElement::class
if (construct is KtDoWhileExpression) {
newElement.parent!!.addAfter(factory.createNewLine(), newElement)
} else if (editor != null) {
val document = editor.document
val line = document.getLineNumber(newElement.startOffset)
val rightMargin = editor.settings.getRightMargin(editor.project)
if (document.getLineEndOffset(line) - document.getLineStartOffset(line) >= rightMargin) {
newElement.parent.addBefore(factory.createNewLine(), newElement)
}
}
if (construct is KtIfExpression &&
-8
View File
@@ -1,8 +0,0 @@
fun foo(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: Boolean
): Int {
if (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {<caret>
return 1
}
return 2
}
-7
View File
@@ -1,7 +0,0 @@
fun foo(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: Boolean
): Int {
if (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
return 1
return 2
}
-10
View File
@@ -1,10 +0,0 @@
fun foo(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: Boolean
): Int {
when {
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -> {<caret>
return 1
}
else -> return 2
}
}
@@ -1,9 +0,0 @@
fun foo(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: Boolean
): Int {
when {
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ->
return 1
else -> return 2
}
}
@@ -13781,11 +13781,6 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
runTest("idea/testData/intentions/removeBraces/ifLambda2.kt");
}
@TestMetadata("ifLong.kt")
public void testIfLong() throws Exception {
runTest("idea/testData/intentions/removeBraces/ifLong.kt");
}
@TestMetadata("ifWithComment.kt")
public void testIfWithComment() throws Exception {
runTest("idea/testData/intentions/removeBraces/ifWithComment.kt");
@@ -13831,11 +13826,6 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
runTest("idea/testData/intentions/removeBraces/whenLambda3.kt");
}
@TestMetadata("whenLong.kt")
public void testWhenLong() throws Exception {
runTest("idea/testData/intentions/removeBraces/whenLong.kt");
}
@TestMetadata("whenMultiple.kt")
public void testWhenMultiple() throws Exception {
runTest("idea/testData/intentions/removeBraces/whenMultiple.kt");