New J2K: Fix formatting saving
This commit is contained in:
committed by
Ilya Kirillov
parent
13a9a56e85
commit
c1ed2e020c
@@ -39,8 +39,9 @@ object ConversionsRunner {
|
|||||||
+AssignmentStatementSimplifyValConversion()
|
+AssignmentStatementSimplifyValConversion()
|
||||||
+AssignmentStatementSimplifyAlsoConversion()
|
+AssignmentStatementSimplifyAlsoConversion()
|
||||||
+AssignmentStatementSplitAlsoConversion()
|
+AssignmentStatementSplitAlsoConversion()
|
||||||
+PolyadicExpressionConversion(context)
|
+PolyadicExpressionConversion()
|
||||||
+OperatorExpressionConversion(context)
|
+OperatorExpressionConversion(context)
|
||||||
|
+AddParenthesisForLineBreaksInBinaryExpression()
|
||||||
+ThrowStatementConversion()
|
+ThrowStatementConversion()
|
||||||
+ArrayInitializerConversion(context)
|
+ArrayInitializerConversion(context)
|
||||||
+TryStatementConversion(context)
|
+TryStatementConversion(context)
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class NewCodeBuilder {
|
|||||||
private fun List<JKNonCodeElement>.createText(): String {
|
private fun List<JKNonCodeElement>.createText(): String {
|
||||||
val text = joinToString("") { token -> token.createText() }
|
val text = joinToString("") { token -> token.createText() }
|
||||||
val needNewLine = text.lastIndexOf('\n') < text.lastIndexOf("//")
|
val needNewLine = text.lastIndexOf('\n') < text.lastIndexOf("//")
|
||||||
return text +"\n".takeIf { needNewLine }.orEmpty()
|
return text + "\n".takeIf { needNewLine }.orEmpty()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun JKNonCodeElementsListOwner.needPreserveSpacesAfterLastCommit() =
|
private fun JKNonCodeElementsListOwner.needPreserveSpacesAfterLastCommit() =
|
||||||
|
|||||||
Reference in New Issue
Block a user