Replace appendln with appendLine in project

This commit is contained in:
Alexander Udalov
2020-06-09 21:09:45 +02:00
parent d1c88798df
commit 6e67e1e78d
76 changed files with 405 additions and 402 deletions
@@ -23,28 +23,28 @@ open class ManyImplicitReceiversBenchmark : AbstractSimpleFileBenchmark() {
override fun buildText(): String {
return buildString {
appendln("inline fun <T, R> with(receiver: T, block: T.() -> R): R = block()")
appendLine("inline fun <T, R> with(receiver: T, block: T.() -> R): R = block()")
for (i in 1..size) {
appendln("interface A$i {")
appendln(" fun foo$i()")
appendln("}")
appendln()
appendLine("interface A$i {")
appendLine(" fun foo$i()")
appendLine("}")
appendLine()
}
appendln()
appendLine()
append("fun test(")
append((1..size).joinToString(", ") { "a$it: A$it" })
appendln(" {")
appendLine(" {")
for (i in 1..size) {
appendln("with(a$i) {")
appendLine("with(a$i) {")
}
for (i in 1..size) {
appendln("foo$i()")
appendLine("foo$i()")
}
for (i in 1..size) {
appendln("}")
appendLine("}")
}
appendln("}")
appendLine("}")
}
}
}
@@ -22,7 +22,7 @@ open class PlusAssignOperatorDesugaringBenchmark : AbstractInferenceBenchmark()
}
override fun buildText(): String = buildString {
appendln(
appendLine(
"""
class A {
operator fun <T : Number> plus(other: (Int) -> T): A = this
@@ -30,19 +30,20 @@ open class PlusAssignOperatorDesugaringBenchmark : AbstractInferenceBenchmark()
}
""".trimIndent()
)
appendln("fun test() {")
appendln("var a = A()")
appendLine("fun test() {")
appendLine("var a = A()")
for (i in 1..size) {
appendln("a += {")
appendLine("a += {")
}
for (i in 1..size) {
appendln(
appendLine(
"""
it.inc()
1
}
""".trimIndent())
""".trimIndent()
)
}
appendln()
appendLine()
}
}
@@ -685,13 +685,13 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
else -> "?"
}
val compiledPort: Int? = daemonInfo.trim().split(" ").last().toIntOrNull()
appendln("#$i\tcompiled on $daemonInfo, session ${daemonInfos[i]?.second}, result ${resultCodes[i]}; started daemon on port ${port2logs[i]?.first}, log: ${logFiles[i]?.canonicalPath}")
appendLine("#$i\tcompiled on $daemonInfo, session ${daemonInfos[i]?.second}, result ${resultCodes[i]}; started daemon on port ${port2logs[i]?.first}, log: ${logFiles[i]?.canonicalPath}")
if (resultCodes[i] != 0 || electionLogs[i] == null) {
appendln("--- out $i, result ${resultCodes[i]}:\n${outStreams[i].toByteArray().toString(Charset.defaultCharset())}\n---")
appendLine("--- out $i, result ${resultCodes[i]}:\n${outStreams[i].toByteArray().toString(Charset.defaultCharset())}\n---")
compiledPort?.let { port -> port2logs.find { it?.first == port } }?.second?.let { logFile ->
appendln("--- log file ${logFile.name}:\n${logFile.readText()}\n---")
appendLine("--- log file ${logFile.name}:\n${logFile.readText()}\n---")
}
?: appendln("--- log not found (port: $compiledPort)")
?: appendLine("--- log not found (port: $compiledPort)")
}
}
}
@@ -917,20 +917,20 @@ internal fun generateLargeKotlinFile(size: Int): String {
return buildString {
append("package large\n\n")
(0..size).forEach {
appendln("class Class$it")
appendln("{")
appendln("\tfun foo(): Long = $it")
appendln("}")
appendln("\n")
appendLine("class Class$it")
appendLine("{")
appendLine("\tfun foo(): Long = $it")
appendLine("}")
appendLine("\n")
repeat(2000) {
appendln("// kotlin rules ... and stuff")
appendLine("// kotlin rules ... and stuff")
}
}
appendln("fun main(args: Array<String>)")
appendln("{")
appendln("\tval result = Class5().foo() + Class$size().foo()")
appendln("\tprintln(result)")
appendln("}")
appendLine("fun main(args: Array<String>)")
appendLine("{")
appendLine("\tval result = Class5().foo() + Class$size().foo()")
appendLine("\tprintln(result)")
appendLine("}")
}
}
@@ -980,13 +980,13 @@ class CompilerDaemonTest : KotlinIntegrationTestBase() {
else -> "?"
}
val compiledPort: Int? = daemonInfo.trim().split(" ").last().toIntOrNull()
appendln("#$i\tcompiled on $daemonInfo, session ${daemonInfos[i]?.second}, result ${resultCodes[i]}; started daemon on port ${port2logs[i]?.first}, log: ${logFiles[i]?.canonicalPath}")
appendLine("#$i\tcompiled on $daemonInfo, session ${daemonInfos[i]?.second}, result ${resultCodes[i]}; started daemon on port ${port2logs[i]?.first}, log: ${logFiles[i]?.canonicalPath}")
if (resultCodes[i] != 0 || electionLogs[i] == null) {
appendln("--- out $i, result ${resultCodes[i]}:\n${outStreams[i].toByteArray().toString(Charset.defaultCharset())}\n---")
appendLine("--- out $i, result ${resultCodes[i]}:\n${outStreams[i].toByteArray().toString(Charset.defaultCharset())}\n---")
compiledPort?.let { port -> port2logs.find { it?.first == port } }?.second?.let { logFile ->
appendln("--- log file ${logFile.name}:\n${logFile.readText()}\n---")
appendLine("--- log file ${logFile.name}:\n${logFile.readText()}\n---")
}
?: appendln("--- log not found (port: $compiledPort)")
?: appendLine("--- log not found (port: $compiledPort)")
}
}
}
@@ -1371,20 +1371,20 @@ internal fun generateLargeKotlinFile(size: Int): String {
return buildString {
append("package large\n\n")
(0..size).forEach {
appendln("class Class$it")
appendln("{")
appendln("\tfun foo(): Long = $it")
appendln("}")
appendln("\n")
appendLine("class Class$it")
appendLine("{")
appendLine("\tfun foo(): Long = $it")
appendLine("}")
appendLine("\n")
repeat(2000) {
appendln("// kotlin rules ... and stuff")
appendLine("// kotlin rules ... and stuff")
}
}
appendln("fun main(args: Array<String>)")
appendln("{")
appendln("\tval result = Class5().foo() + Class$size().foo()")
appendln("\tprintln(result)")
appendln("}")
appendLine("fun main(args: Array<String>)")
appendLine("{")
appendLine("\tval result = Class5().foo() + Class$size().foo()")
appendLine("\tprintln(result)")
appendLine("}")
}
}
@@ -66,7 +66,7 @@ abstract class AbstractFirLoadCompiledKotlin : AbstractFirResolveWithSessionTest
for (name in provider.getAllCallableNamesInPackage(packageFqName)) {
for (symbol in provider.getTopLevelCallableSymbols(packageFqName, name)) {
symbol.fir.accept(firRenderer)
builder.appendln()
builder.appendLine()
}
}
@@ -75,7 +75,7 @@ abstract class AbstractFirLoadCompiledKotlin : AbstractFirResolveWithSessionTest
provider.getClassLikeSymbolByFqName(ClassId.topLevel(packageFqName.child(name))) as FirClassSymbol?
?: continue
classLikeSymbol.fir.accept(firRenderer)
builder.appendln()
builder.appendLine()
}
val testDataDirectoryPath =
@@ -42,7 +42,7 @@ class BuiltInsDeserializationForFirTestCase : AbstractFirResolveWithSessionTestC
for (name in provider.getAllCallableNamesInPackage(packageFqName)) {
for (symbol in provider.getTopLevelCallableSymbols(packageFqName, name)) {
symbol.fir.accept(firRenderer)
builder.appendln()
builder.appendLine()
}
}
@@ -51,7 +51,7 @@ class BuiltInsDeserializationForFirTestCase : AbstractFirResolveWithSessionTestC
provider.getClassLikeSymbolByFqName(ClassId.topLevel(packageFqName.child(name))) as FirClassSymbol?
?: continue
classLikeSymbol.fir.accept(firRenderer)
builder.appendln()
builder.appendLine()
}
@@ -44,7 +44,7 @@ abstract class AbstractFirOldFrontendLightClassesTest : AbstractFirOldFrontendDi
)
psiClass.appendMirrorText(0, stringBuilder)
stringBuilder.appendln()
stringBuilder.appendLine()
}
val expectedPath = testDataFile.path.replace(".kt", ".txt")
@@ -173,22 +173,22 @@ abstract class AbstractBuilderConfigurator<T : AbstractFirTreeBuilder>(val firTr
return if (type == null) {
allImplementations.filter { it.kind?.hasLeafBuilder == true }.singleOrNull() ?: this@AbstractBuilderConfigurator.run {
val message = buildString {
appendln("${this@extractImplementation} has multiple implementations:")
appendLine("${this@extractImplementation} has multiple implementations:")
for (implementation in allImplementations) {
appendln(" - ${implementation.type}")
appendLine(" - ${implementation.type}")
}
appendln("Please specify implementation is needed")
appendLine("Please specify implementation is needed")
}
throw IllegalArgumentException(message)
}
} else {
allImplementations.firstOrNull { it.type == type } ?: this@AbstractBuilderConfigurator.run {
val message = buildString {
appendln("${this@extractImplementation} has not implementation $type. Existing implementations:")
appendLine("${this@extractImplementation} has not implementation $type. Existing implementations:")
for (implementation in allImplementations) {
appendln(" - ${implementation.type}")
appendLine(" - ${implementation.type}")
}
appendln("Please specify implementation is needed")
appendLine("Please specify implementation is needed")
}
throw IllegalArgumentException(message)
}
@@ -64,11 +64,11 @@ class IncompatibleExpectedActualClassScopesRenderer(
open class MultiplatformDiagnosticRenderingMode {
open fun newLine(sb: StringBuilder) {
sb.appendln()
sb.appendLine()
}
open fun renderList(sb: StringBuilder, elements: List<() -> Unit>) {
sb.appendln()
sb.appendLine()
for (element in elements) {
element()
}
@@ -77,7 +77,7 @@ open class MultiplatformDiagnosticRenderingMode {
open fun renderDescriptor(sb: StringBuilder, descriptor: DeclarationDescriptor, context: RenderingContext, indent: String) {
sb.append(indent)
sb.append(INDENTATION_UNIT)
sb.appendln(Renderers.COMPACT_WITH_MODIFIERS.render(descriptor, context))
sb.appendLine(Renderers.COMPACT_WITH_MODIFIERS.render(descriptor, context))
}
}
@@ -14,12 +14,12 @@ fun getExceptionMessage(
location: String?
): String = ApplicationManager.getApplication().runReadAction<String> {
buildString {
append(subsystemName).append(" Internal error: ").appendln(message)
append(subsystemName).append(" Internal error: ").appendLine(message)
if (location != null) {
append("File being compiled: ").appendln(location)
append("File being compiled: ").appendLine(location)
} else {
appendln("File is unknown")
appendLine("File is unknown")
}
if (cause != null) {
@@ -104,20 +104,20 @@ fun dumpBuildLog(buildSteps: Iterable<BuildStep>): String {
for ((i, step) in buildSteps.withIndex()) {
if (i > 0) {
sb.appendln()
sb.appendLine()
}
sb.appendln("================ Step #${i + 1} =================")
sb.appendln()
sb.appendln(BEGIN_COMPILED_FILES)
step.compiledKotlinFiles.sorted().forEach { sb.appendln(it) }
step.compiledJavaFiles.sorted().forEach { sb.appendln(it) }
sb.appendln(END_COMPILED_FILES)
sb.appendln("------------------------------------------")
sb.appendLine("================ Step #${i + 1} =================")
sb.appendLine()
sb.appendLine(BEGIN_COMPILED_FILES)
step.compiledKotlinFiles.sorted().forEach { sb.appendLine(it) }
step.compiledJavaFiles.sorted().forEach { sb.appendLine(it) }
sb.appendLine(END_COMPILED_FILES)
sb.appendLine("------------------------------------------")
if (!step.compileSucceeded) {
sb.appendln(BEGIN_ERRORS)
step.compileErrors.forEach { sb.appendln(it) }
sb.appendLine(BEGIN_ERRORS)
step.compileErrors.forEach { sb.appendLine(it) }
}
}
@@ -33,7 +33,7 @@ fun BasicBlock.dump(builder: StringBuilder = StringBuilder(), indent: String = "
builder.append(indent)
builder.append(String.format("%3d ", index + 1))
val dump = element.cfgDump()
builder.appendln(dump.lines().first())
builder.appendLine(dump.lines().first())
}
return builder.toString()
}
@@ -41,7 +41,7 @@ fun BasicBlock.dump(builder: StringBuilder = StringBuilder(), indent: String = "
fun BlockConnector.dump(builder: StringBuilder = StringBuilder(), indent: String = ""): String {
builder.append(indent)
val dump = element.cfgDump()
builder.appendln(dump.lines().first())
builder.appendLine(dump.lines().first())
return builder.toString()
}
@@ -56,21 +56,21 @@ fun ControlFlowGraph.dump(): String {
}
val builder = StringBuilder()
for ((index, block) in blocks.withIndex()) {
builder.appendln("BB $index")
builder.appendLine("BB $index")
val incoming = block.incoming
if (incoming != null) {
builder.appendln(incoming.previousBlocks.joinToString(prefix = "INCOMING <- BB ") { blockIndex[it].toString() })
builder.appendLine(incoming.previousBlocks.joinToString(prefix = "INCOMING <- BB ") { blockIndex[it].toString() })
incoming.dump(builder, " ")
}
builder.appendln("CONTENT")
builder.appendLine("CONTENT")
block.dump(builder, " ")
val outgoing = block.outgoing
if (outgoing != null) {
if (outgoing.nextBlocks.isEmpty()) {
builder.appendln("OUTGOING -> NONE")
builder.appendLine("OUTGOING -> NONE")
}
else {
builder.appendln(outgoing.nextBlocks.joinToString(prefix = "OUTGOING -> BB ") { blockIndex[it].toString() })
builder.appendLine(outgoing.nextBlocks.joinToString(prefix = "OUTGOING -> BB ") { blockIndex[it].toString() })
}
outgoing.dump(builder, " ")
}
@@ -115,13 +115,13 @@ class MutableContextInfo private constructor(
this.entries.filter { it.value.isNotEmpty() }.forEach { (key, value) ->
append(key.toString())
append(" $separator ")
appendln(value.toString())
appendLine(value.toString())
}
}
append("Fired effects: ")
append(info.firedEffects.joinToString(separator = ", "))
appendln("")
appendLine("")
subtypes.printMapEntriesWithSeparator("is")
@@ -91,7 +91,7 @@ abstract class AbstractPseudoValueTest : AbstractPseudocodeTest() {
"%1$-${valueColumnWidth}s".format(valueDecl(value)) +
" " +
"%1$-${valueDescColumnWidth}s".format(description)
out.appendln(line.trimEnd())
out.appendLine(line.trimEnd())
}
}
@@ -74,12 +74,12 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() {
append(" : " + superTypes.joinToString())
}
appendln(" {")
appendLine(" {")
fields.joinTo(this, LINE_SEPARATOR.repeat(2)) { renderField(it, showTypeAnnotations).withMargin() }
if (fields.isNotEmpty()) {
appendln().appendln()
appendLine().appendLine()
}
methods.joinTo(this, LINE_SEPARATOR.repeat(2)) {
@@ -87,7 +87,7 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() {
renderMethod(it, showBytecode, showLocalVariables, showTypeAnnotations).withMargin()
}
appendln().append("}")
appendLine().append("}")
}
}
@@ -147,7 +147,7 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() {
val actualShowLocalVariables = showLocalVariables && method.localVariables?.takeIf { it.isNotEmpty() } != null
if (actualShowBytecode || actualShowLocalVariables) {
appendln(" {")
appendLine(" {")
if (actualShowLocalVariables) {
val localVariableTable = buildLocalVariableTable(method)
@@ -158,12 +158,12 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() {
if (actualShowBytecode) {
if (actualShowLocalVariables) {
appendln().appendln()
appendLine().appendLine()
}
append(renderBytecodeInstructions(method.instructions).trimEnd().withMargin())
}
appendln().append("}")
appendLine().append("}")
method.visibleTypeAnnotations
}
@@ -188,7 +188,7 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() {
return buildString {
append("Local variables:")
for (variable in localVariables) {
appendln().append((variable.index.toString() + " " + variable.name + ": " + variable.desc).withMargin())
appendLine().append((variable.index.toString() + " " + variable.name + ": " + variable.desc).withMargin())
}
}
}
@@ -205,12 +205,12 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() {
private fun StringBuilder.renderInstruction(node: AbstractInsnNode, labelMappings: LabelMappings) {
if (node is LabelNode) {
appendln("LABEL (L" + labelMappings[node.label] + ")")
appendLine("LABEL (L" + labelMappings[node.label] + ")")
return
}
if (node is LineNumberNode) {
appendln("LINENUMBER (" + node.line + ")")
appendLine("LINENUMBER (" + node.line + ")")
return
}
@@ -227,7 +227,7 @@ abstract class AbstractAsmLikeInstructionListingTest : CodegenTestCase() {
is LdcInsnNode -> append(" (" + node.cst + ")")
}
appendln()
appendLine()
}
private fun String.withMargin(margin: String = " "): String {
@@ -53,7 +53,7 @@ object SMAPTestUtil {
StringReader(file.content).forEachLine { line ->
// Strip comments
if (!line.startsWith("//")) {
appendln(line.trim())
appendLine(line.trim())
}
}
}.trim()
@@ -79,15 +79,15 @@ abstract class AbstractFirDiagnosticsWithLightTreeTest : AbstractFirDiagnosticsT
}
if (wasExpected.isNotEmpty()) {
appendln("Some diagnostics was expected:")
appendLine("Some diagnostics was expected:")
wasExpected.forEach {
appendln(it.errorMessage())
appendLine(it.errorMessage())
}
}
if (isActual.isNotEmpty()) {
appendln("Some new diagnostics:")
appendLine("Some new diagnostics:")
isActual.forEach {
appendln(it.errorMessage())
appendLine(it.errorMessage())
}
}
@@ -63,9 +63,9 @@ abstract class AbstractFirOldFrontendDiagnosticsTest : AbstractFirDiagnosticsTes
private fun checkFailureFile(failure: FirRuntimeException, failureFile: File) {
val failureMessage = buildString {
appendln(failure.message)
appendLine(failure.message)
append("Cause: ")
appendln(failure.cause)
appendLine(failure.cause)
}
KotlinTestUtils.assertEqualsToFile(failureFile, failureMessage)
}
@@ -80,7 +80,7 @@ class RTableContext {
out.append(HLINE.repeat(size))
}
out.append(postfix)
out.appendln()
out.appendLine()
}
appendHLine(CORNER_LU, TOP_T, CORNER_RU)
@@ -93,7 +93,7 @@ class RTableContext {
out.append(VLINE)
out.append(" ")
}
out.appendln()
out.appendLine()
}
is Row.Separator -> {
appendHLine(LEFT_T, CROSS, RIGHT_T)
@@ -31,10 +31,10 @@ abstract class AbstractIrCfgTestCase : AbstractIrGeneratorTestCase() {
val builder = StringBuilder()
for (declaration in this.declarations) {
if (declaration is IrFunction) {
builder.appendln("// FUN: ${declaration.name}")
builder.appendLine("// FUN: ${declaration.name}")
val cfg = FunctionGenerator(declaration).generate()
builder.appendln(cfg.dump())
builder.appendln("// END FUN: ${declaration.name}")
builder.appendLine(cfg.dump())
builder.appendLine("// END FUN: ${declaration.name}")
}
}
return builder.toString()
@@ -43,10 +43,10 @@ abstract class AbstractIrCfgTestCase : AbstractIrGeneratorTestCase() {
private fun IrModuleFragment.cfgDump(): String {
val builder = StringBuilder()
for (file in this.files) {
builder.appendln("// FILE: ${file.path}")
builder.appendln(file.cfgDump())
builder.appendln("// END FILE: ${file.path}")
builder.appendln()
builder.appendLine("// FILE: ${file.path}")
builder.appendLine(file.cfgDump())
builder.appendLine("// END FILE: ${file.path}")
builder.appendLine()
}
return builder.toString()
}
@@ -40,13 +40,13 @@ abstract class AbstractEnhancedSignaturesResolvedCallsTest : AbstractResolvedCal
return buildString {
lines.forEachIndexed { lineIndex, line ->
appendln(line)
appendLine(line)
callsByLine[lineIndex]?.let { calls ->
val indent = line.takeWhile(Char::isWhitespace) + " "
calls.forEach { resolvedCall ->
appendln("$indent// ${resolvedCall?.status}")
appendln("$indent// ORIGINAL: ${resolvedCall?.run { resultingDescriptor!!.original.getText() }}")
appendln("$indent// SUBSTITUTED: ${resolvedCall?.run { resultingDescriptor!!.getText() }}")
appendLine("$indent// ${resolvedCall?.status}")
appendLine("$indent// ORIGINAL: ${resolvedCall?.run { resultingDescriptor!!.original.getText() }}")
appendLine("$indent// SUBSTITUTED: ${resolvedCall?.run { resultingDescriptor!!.getText() }}")
}
}
}
@@ -131,30 +131,30 @@ internal fun DeclarationDescriptor.getText(): String = when (this) {
internal fun ResolvedCall<*>.renderToText(): String {
return buildString {
appendln("Resolved call:")
appendln()
appendLine("Resolved call:")
appendLine()
if (candidateDescriptor != resultingDescriptor) {
appendln("Candidate descriptor: ${candidateDescriptor!!.getText()}")
appendLine("Candidate descriptor: ${candidateDescriptor!!.getText()}")
}
appendln("Resulting descriptor: ${resultingDescriptor!!.getText()}")
appendln()
appendLine("Resulting descriptor: ${resultingDescriptor!!.getText()}")
appendLine()
appendln("Explicit receiver kind = ${explicitReceiverKind}")
appendln("Dispatch receiver = ${dispatchReceiver.getText()}")
appendln("Extension receiver = ${extensionReceiver.getText()}")
appendLine("Explicit receiver kind = ${explicitReceiverKind}")
appendLine("Dispatch receiver = ${dispatchReceiver.getText()}")
appendLine("Extension receiver = ${extensionReceiver.getText()}")
val valueArguments = call.valueArguments
if (!valueArguments.isEmpty()) {
appendln()
appendln("Value arguments mapping:")
appendln()
appendLine()
appendLine("Value arguments mapping:")
appendLine()
for (valueArgument in valueArguments) {
val argumentText = valueArgument!!.getText()
val argumentMappingText = getArgumentMapping(valueArgument).getText()
appendln("$argumentMappingText $argumentText")
appendLine("$argumentMappingText $argumentText")
}
}
}
@@ -32,7 +32,7 @@ class ServiceLoaderLiteTest : AbstractServiceLoaderLiteTest() {
}
fun testSeveralProcessors() {
val processorsContent = buildString { appendln("test.Foo").appendln("test.Bar") }
val processorsContent = buildString { appendLine("test.Foo").appendLine("test.Bar") }
applyForDirAndJar("test", processors(processorsContent)) { file ->
val impls = ServiceLoaderLite.findImplementations(Processor::class.java, listOf(file))
@@ -98,11 +98,11 @@ class ServiceLoaderLiteTest : AbstractServiceLoaderLiteTest() {
fun testCommentsAndWhitespaces() {
val processorsContent = buildString {
appendln(" test.Foo #comment")
appendln("#comment2")
appendln().appendln()
appendln("test.Bar #anotherComemnt")
appendln("test.Zoo ")
appendLine(" test.Foo #comment")
appendLine("#comment2")
appendLine().appendLine()
appendLine("test.Bar #anotherComemnt")
appendLine("test.Zoo ")
}
applyForDirAndJar("test", processors(processorsContent)) { file ->
@@ -127,7 +127,7 @@ class ServiceLoaderLiteTestWithClassLoader : AbstractServiceLoaderLiteTest() {
private inline fun <reified Intf : Any> impls(vararg impls: KClass<out Intf>): Entry {
val content = buildString {
for (impl in impls) {
appendln(impl.java.name)
appendLine(impl.java.name)
}
}
return Entry("META-INF/services/" + Intf::class.java.name, content)
@@ -206,8 +206,8 @@ class CodeConformanceTest : TestCase() {
for (test in tests) {
if (test.result.isNotEmpty()) {
append(test.message.format(test.result.size, test.result.joinToString("\n")))
appendln()
appendln()
appendLine()
appendLine()
}
}
})
@@ -55,10 +55,10 @@ class JvmModuleProtoBufTest : KtUsefulTestCase() {
)
val result = buildString {
for (annotationClassId in mapping.moduleData.annotations) {
appendln("@$annotationClassId")
appendLine("@$annotationClassId")
}
for ((fqName, packageParts) in mapping.packageFqName2Parts) {
appendln(fqName)
appendLine(fqName)
for (part in packageParts.parts) {
append(" ")
append(part)
@@ -68,7 +68,7 @@ class JvmModuleProtoBufTest : KtUsefulTestCase() {
append(facadeName)
append(")")
}
appendln()
appendLine()
}
}
}
@@ -38,20 +38,20 @@ class CompilerFileLimitTest : CompilerSmokeTestBase() {
return buildString {
append("package large\n\n")
(0..size).forEach {
appendln("class Class$it")
appendln("{")
appendln("\tfun foo(): Long = $it")
appendln("}")
appendln("\n")
appendLine("class Class$it")
appendLine("{")
appendLine("\tfun foo(): Long = $it")
appendLine("}")
appendLine("\n")
repeat(2000) {
appendln("// kotlin rules ... and stuff")
appendLine("// kotlin rules ... and stuff")
}
}
appendln("fun main()")
appendln("{")
appendln("\tval result = Class5().foo() + Class$size().foo()")
appendln("\tprintln(result)")
appendln("}")
appendLine("fun main()")
appendLine("{")
appendLine("\tval result = Class5().foo() + Class$size().foo()")
appendLine("\tprintln(result)")
appendLine("}")
}
}
@@ -81,33 +81,33 @@ class CompilerFileLimitTest : CompilerSmokeTestBase() {
return buildString {
append("package usesLarge\n\n")
append("import large.Large\n\n")
appendln("fun main()")
appendln("{")
appendln("\tval result = Large.Class0().foo() + Large.Class$size().foo()")
appendln("\tprintln(result)")
appendln("}")
appendLine("fun main()")
appendLine("{")
appendLine("\tval result = Large.Class0().foo() + Large.Class$size().foo()")
appendLine("\tprintln(result)")
appendLine("}")
}
}
private fun generateLargeJavaFile(size: Int): String {
return buildString {
append("package large;\n\n")
appendln("public class Large")
appendln("{")
appendLine("public class Large")
appendLine("{")
(0..size).forEach {
appendln("\tpublic static class Class$it")
appendln("\t{")
appendln("\t\tpublic long foo()")
appendln("\t\t{")
appendln("\t\t\t return $it;")
appendln("\t\t}")
appendln("\t}")
appendln("\n")
appendLine("\tpublic static class Class$it")
appendLine("\t{")
appendLine("\t\tpublic long foo()")
appendLine("\t\t{")
appendLine("\t\t\t return $it;")
appendLine("\t\t}")
appendLine("\t}")
appendLine("\n")
repeat(2000) {
appendln("// kotlin rules ... and stuff")
appendLine("// kotlin rules ... and stuff")
}
}
appendln("}")
appendLine("}")
}
}
@@ -54,31 +54,31 @@ abstract class AbstractMultiPlatformIntegrationTest : KtUsefulTestCase() {
val jvm2Dest = File(tmpdir, "jvm2").absolutePath.takeIf { jvm2Src != null }
val result = buildString {
appendln("-- Common --")
appendln(K2MetadataCompiler().compile(commonSrc, null, "-d", commonDest, *optionalStdlibCommon))
appendLine("-- Common --")
appendLine(K2MetadataCompiler().compile(commonSrc, null, "-d", commonDest, *optionalStdlibCommon))
if (jvmSrc != null) {
appendln()
appendln("-- JVM --")
appendln(K2JVMCompiler().compile(jvmSrc, commonSrc, "-d", jvmDest!!))
appendLine()
appendLine("-- JVM --")
appendLine(K2JVMCompiler().compile(jvmSrc, commonSrc, "-d", jvmDest!!))
}
if (jsSrc != null) {
appendln()
appendln("-- JS --")
appendln(K2JSCompiler().compile(jsSrc, commonSrc, "-output", jsDest!!))
appendLine()
appendLine("-- JS --")
appendLine(K2JSCompiler().compile(jsSrc, commonSrc, "-output", jsDest!!))
}
if (common2Src != null) {
appendln()
appendln("-- Common (2) --")
appendln(K2MetadataCompiler().compile(common2Src, null, "-d", common2Dest!!, "-cp", commonDest, *optionalStdlibCommon))
appendLine()
appendLine("-- Common (2) --")
appendLine(K2MetadataCompiler().compile(common2Src, null, "-d", common2Dest!!, "-cp", commonDest, *optionalStdlibCommon))
}
if (jvm2Src != null) {
appendln()
appendln("-- JVM (2) --")
appendln(
appendLine()
appendLine("-- JVM (2) --")
appendLine(
K2JVMCompiler().compile(
jvm2Src, common2Src, "-d", jvm2Dest!!,
"-cp", listOfNotNull(commonDest, common2Dest, jvmDest).joinToString(File.pathSeparator)
@@ -110,9 +110,9 @@ abstract class AbstractMultiPlatformIntegrationTest : KtUsefulTestCase() {
"-Xmulti-platform" + mainArguments +
loadExtraArguments(listOfNotNull(sources, commonSources))
)
appendln("Exit code: $exitCode")
appendln("Output:")
appendln(output)
appendLine("Exit code: $exitCode")
appendLine("Output:")
appendLine(output)
}.trimTrailingWhitespacesAndAddNewlineAtEOF().trimEnd('\r', '\n')
private fun loadExtraArguments(sources: List<File>): List<String> = sources.flatMap { source ->
@@ -74,7 +74,7 @@ abstract class AbstractReplInterpreterTest : KtUsefulTestCase() {
val value = StringBuilder()
while (lines.isNotEmpty() && !START_PATTERN.matcher(lines.peek()!!).matches()) {
value.appendln(lines.poll()!!)
value.appendLine(lines.poll()!!)
}
result.add(OneLine(code, value.toString()))
@@ -97,10 +97,10 @@ class CapturedTypeApproximationTest : KotlinTestWithEnvironment() {
val typeParameters = functionFoo.typeParameters
val type = functionFoo.returnType
appendln(testType)
appendLine(testType)
if (bindingContext.diagnostics.noSuppression().any { it.severity == Severity.ERROR }) {
appendln(" compiler error\n")
appendLine(" compiler error\n")
continue
}
@@ -119,9 +119,9 @@ class CapturedTypeApproximationTest : KotlinTestWithEnvironment() {
if (testSubstitution.size > 1) append("${typeParameter.name} = ")
append("${testSubstitution[typeParameter]}. ")
}
appendln("lower: $lower; upper: $upper; substitution: $substitution")
appendLine("lower: $lower; upper: $upper; substitution: $substitution")
}
if (testTypes.lastIndex != index) appendln()
if (testTypes.lastIndex != index) appendLine()
}
}
@@ -415,7 +415,7 @@ internal class DescriptorRendererImpl(
) {
append(renderAnnotation(annotation, target))
if (eachAnnotationOnNewLine) {
appendln()
appendLine()
} else {
append(" ")
}
@@ -86,7 +86,7 @@ fun findCorrespondingSupertype(
private fun KotlinType.approximate() = approximateCapturedTypes(this).upper
private fun TypeConstructor.debugInfo() = buildString {
operator fun String.unaryPlus() = appendln(this)
operator fun String.unaryPlus() = appendLine(this)
+ "type: ${this@debugInfo}"
+ "hashCode: ${this@debugInfo.hashCode()}"
@@ -120,7 +120,7 @@ private class KotlinIdeaResolutionException(
init {
withAttachment("info.txt", buildString {
append(resolvingWhat.description())
appendln("---------------------------------------------")
appendLine("---------------------------------------------")
append(creationPlace.description())
})
for (element in resolvingWhat.elements.withIndex()) {
@@ -137,15 +137,15 @@ private class CreationPlace(
private val platform: TargetPlatform?
) {
fun description() = buildString {
appendln("Resolver created for:")
appendLine("Resolver created for:")
for (element in elements) {
appendElement(element)
}
if (moduleInfo != null) {
appendln("Provided module info: $moduleInfo")
appendLine("Provided module info: $moduleInfo")
}
if (platform != null) {
appendln("Provided platform: $platform")
appendLine("Provided platform: $platform")
}
}
}
@@ -161,22 +161,22 @@ private class ResolvingWhat(
fun description(): String {
return buildString {
appendln("Failed performing task:")
appendLine("Failed performing task:")
if (serviceClass != null) {
appendln("Getting service: ${serviceClass.name}")
appendLine("Getting service: ${serviceClass.name}")
} else {
append("Analyzing code")
if (bodyResolveMode != null) {
append(" in BodyResolveMode.$bodyResolveMode")
}
appendln()
appendLine()
}
appendln("Elements:")
appendLine("Elements:")
for (element in elements) {
appendElement(element)
}
if (moduleDescriptor != null) {
appendln("Provided module descriptor for module ${moduleDescriptor.getCapability(ModuleInfo.Capability)}")
appendLine("Provided module descriptor for module ${moduleDescriptor.getCapability(ModuleInfo.Capability)}")
}
}
}
@@ -184,10 +184,10 @@ private class ResolvingWhat(
private fun StringBuilder.appendElement(element: PsiElement) {
fun info(key: String, value: String?) {
appendln(" $key = $value")
appendLine(" $key = $value")
}
appendln("Element of type: ${element.javaClass.simpleName}:")
appendLine("Element of type: ${element.javaClass.simpleName}:")
if (element is PsiNamedElement) {
info("name", element.name)
}
@@ -175,7 +175,7 @@ class PluginDeclarationProviderFactory(
append(it.name)
append(" isPhysical=${it.isPhysical}")
append(" modStamp=${it.modificationStamp}")
appendln()
appendLine()
}
}
}
@@ -100,7 +100,7 @@ class KotlinDecompilerServiceImpl : KotlinDecompilerService {
decompiledText.values.singleOrNull()?.let { return it }
return buildString {
for ((filename, content) in decompiledText) {
appendln("// $filename")
appendLine("// $filename")
append(content)
}
}
@@ -79,9 +79,9 @@ class ModulesEditorToolbarDecorator(
buildString {
val moduleName = selectedModule?.name!!
if (tree.selectedSettingItem.safeAs<Module>()?.kind != ModuleKind.target) {
appendln(KotlinNewProjectWizardUIBundle.message("editor.modules.remove.selected.module", moduleName))
appendLine(KotlinNewProjectWizardUIBundle.message("editor.modules.remove.selected.module", moduleName))
} else {
appendln(KotlinNewProjectWizardUIBundle.message("editor.modules.remove.selected.target", moduleName))
appendLine(KotlinNewProjectWizardUIBundle.message("editor.modules.remove.selected.target", moduleName))
}
},
KotlinNewProjectWizardUIBundle.message("editor.modules.remove.selected.question", moduleKindText),
@@ -59,9 +59,9 @@ abstract class AbstractAsyncStackTraceTest : KotlinDescriptorTestCaseWithSteppin
}
private fun renderAsyncStackTrace(trace: List<StackFrameItem>) = buildString {
appendln("Async stack trace:")
appendLine("Async stack trace:")
for (item in trace) {
append(MARGIN).appendln(item.toString())
append(MARGIN).appendLine(item.toString())
val declaredFields = listDeclaredFields(item.javaClass)
@Suppress("UNCHECKED_CAST")
@@ -77,7 +77,7 @@ abstract class AbstractAsyncStackTraceTest : KotlinDescriptorTestCaseWithSteppin
val name = descriptor.calcValueName()
val value = descriptor.calcValue(evaluationContext)
append(MARGIN).append(MARGIN).append(name).append(" = ").appendln(value)
append(MARGIN).append(MARGIN).append(name).append(" = ").appendLine(value)
}
}
}
@@ -52,7 +52,7 @@ abstract class AbstractCoroutineDumpTest : KotlinDescriptorTestCaseWithStepping(
private fun stringDump(infoData: List<CoroutineInfoData>) = buildString {
infoData.forEach {
appendln("\"${it.key.name}\", state: ${it.key.state}")
appendLine("\"${it.key.name}\", state: ${it.key.state}")
}
}
@@ -117,7 +117,7 @@ abstract class AbstractFileRankingTest : LowLevelDebuggerTestBase() {
if (problems.isNotEmpty()) {
throw AssertionError(buildString {
appendln("There were association errors:").appendln()
appendLine("There were association errors:").appendLine()
problems.joinTo(this, "\n\n")
})
}
@@ -258,9 +258,9 @@ class PerformanceNativeProjectsTest : AbstractPerformanceProjectsTest() {
buildString {
originalKtFileContents.forEachIndexed { index, line ->
if (index == packageLineIndex) {
appendln(line.replace("perfTestPackage1", "perfTestPackage$n"))
appendLine(line.replace("perfTestPackage1", "perfTestPackage$n"))
} else {
appendln(line)
appendLine(line)
}
}
}
@@ -36,7 +36,7 @@ class Stats(
init {
statsOutput = statsFile.bufferedWriter()
statsOutput.appendln(header.joinToString())
statsOutput.appendLine(header.joinToString())
PerformanceCounter.setTimeCounterEnabled(true)
}
@@ -110,7 +110,7 @@ class Stats(
private fun append(values: Array<Any>) {
require(values.size == header.size) { "Expected ${header.size} values, actual ${values.size} values" }
with(statsOutput) {
appendln(values.joinToString { it.toString() })
appendLine(values.joinToString { it.toString() })
flush()
}
}
@@ -52,20 +52,20 @@ class StatefulTestGradleProjectRefreshCallback(
val error = error ?: return
val failure = buildString {
appendln("Gradle import failed for ${project.name} at $projectPath")
appendLine("Gradle import failed for ${project.name} at $projectPath")
project.guessProjectDir()
append("=".repeat(40)).appendln(" Error message:")
appendln(error.message.trimEnd())
append("=".repeat(40)).appendLine(" Error message:")
appendLine(error.message.trimEnd())
append("=".repeat(40)).appendln(" Error details:")
appendln(error.details?.trimEnd().orEmpty())
append("=".repeat(40)).appendLine(" Error details:")
appendLine(error.details?.trimEnd().orEmpty())
append("=".repeat(40)).appendln(" Gradle process output:")
appendln(GradleProcessOutputInterceptor.getInstance()?.getOutput()?.trimEnd() ?: "<interceptor not installed>")
append("=".repeat(40)).appendLine(" Gradle process output:")
appendLine(GradleProcessOutputInterceptor.getInstance()?.getOutput()?.trimEnd() ?: "<interceptor not installed>")
appendln("=".repeat(40))
appendLine("=".repeat(40))
}
fail(failure)
@@ -120,7 +120,7 @@ class WrapValueParameterHandler(val base: DescriptorRenderer.ValueParametersHand
override fun appendAfterValueParameters(parameterCount: Int, builder: StringBuilder) {
if (parameterCount > 0) {
builder.appendln()
builder.appendLine()
}
base.appendAfterValueParameters(parameterCount, builder)
}
@@ -202,13 +202,13 @@ internal abstract class AbstractCompletionBenchmarkScenario(
if (result == JFileChooser.APPROVE_OPTION) {
val file = jfc.selectedFile
file.writeText(buildString {
appendln("n, file, lines, ff, full")
appendLine("n, file, lines, ff, full")
var i = 0
allResults.forEach {
append(i++)
append(", ")
it.toCSV(this)
appendln()
appendLine()
}
})
}
@@ -204,13 +204,13 @@ internal abstract class AbstractCompletionBenchmarkScenario(
if (result == JFileChooser.APPROVE_OPTION) {
val file = jfc.selectedFile
file.writeText(buildString {
appendln("n, file, lines, ff, full")
appendLine("n, file, lines, ff, full")
var i = 0
allResults.forEach {
append(i++)
append(", ")
it.toCSV(this)
appendln()
appendLine()
}
})
}
@@ -205,13 +205,13 @@ class HighlightingBenchmarkAction : AnAction() {
if (result == JFileChooser.APPROVE_OPTION) {
val file = jfc.selectedFile
file.writeText(buildString {
appendln("n, file, lines, status, time")
appendLine("n, file, lines, status, time")
var i = 0
allResults.forEach {
append(i++)
append(", ")
it.toCSV(this)
appendln()
appendLine()
}
})
}
@@ -64,7 +64,7 @@ class JavaContextDeclarationRenderer {
buildString {
for (member in this@render) {
renderJavaDeclaration(member)
appendln()
appendLine()
}
}
@@ -227,7 +227,7 @@ object KDocRenderer {
sb.append("<$tag>")
processChildren()
sb.append("</$tag>")
if (newline) sb.appendln()
if (newline) sb.appendLine()
}
val nodeType = node.type
@@ -51,12 +51,12 @@ abstract class AbstractKotlinTypeAliasByExpansionShortNameIndexTest : KotlinLigh
val result = index.get(key, project, scope)
if (value !in result.map { it.name }) {
Assert.fail(buildString {
appendln("Record $record not found in index")
appendln("Index contents:")
appendLine("Record $record not found in index")
appendLine("Index contents:")
index.getAllKeys(project).asSequence().forEach {
appendln("KEY: $it")
appendLine("KEY: $it")
index.get(it, project, scope).forEach {
appendln(" ${it.name}")
appendLine(" ${it.name}")
}
}
})
@@ -251,7 +251,7 @@ object UltraLightChecker {
val initializingClass = initializingClass ?: return name
return buildString {
appendln("$name {")
appendLine("$name {")
append(initializingClass.renderMembers())
append("}")
}
@@ -272,7 +272,7 @@ object UltraLightChecker {
append(typeParameters.renderTypeParams())
append(extendsList.renderRefList("extends"))
append(implementsList.renderRefList("implements"))
appendln(" {")
appendLine(" {")
if (isEnum) {
append(
@@ -212,12 +212,12 @@ abstract class AbstractLookupTrackerTest : TestWithWorkingDir() {
fun doTest(path: String) {
val sb = StringBuilder()
fun StringBuilder.indentln(string: String) {
appendln(" $string")
appendLine(" $string")
}
fun CompilerOutput.logOutput(stepName: String) {
sb.appendln("==== $stepName ====")
sb.appendLine("==== $stepName ====")
sb.appendln("Compiling files:")
sb.appendLine("Compiling files:")
for (compiledFile in compiledFiles.sortedBy { it.canonicalPath }) {
val lookupsFromFile = lookups[compiledFile]
val lookupStatus = when {
@@ -229,10 +229,10 @@ abstract class AbstractLookupTrackerTest : TestWithWorkingDir() {
sb.indentln("$relativePath$lookupStatus")
}
sb.appendln("Exit code: $exitCode")
sb.appendLine("Exit code: $exitCode")
errors.forEach(sb::indentln)
sb.appendln()
sb.appendLine()
}
val testDir = File(path)
@@ -716,12 +716,12 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() {
for (i in 0..classCount) {
val code = buildString {
appendln("package foo")
appendln("class Foo$i {")
appendLine("package foo")
appendLine("class Foo$i {")
for (j in 0..methodCount) {
appendln(" fun get${j*j}(): Int = square($j)")
appendLine(" fun get${j*j}(): Int = square($j)")
}
appendln("}")
appendLine("}")
}
File(srcDir, "Foo$i.kt").writeText(code)
@@ -716,12 +716,12 @@ open class KotlinJpsBuildTest : KotlinJpsBuildTestBase() {
for (i in 0..classCount) {
val code = buildString {
appendln("package foo")
appendln("class Foo$i {")
appendLine("package foo")
appendLine("class Foo$i {")
for (j in 0..methodCount) {
appendln(" fun get${j*j}(): Int = square($j)")
appendLine(" fun get${j*j}(): Int = square($j)")
}
appendln("}")
appendLine("}")
}
File(srcDir, "Foo$i.kt").writeText(code)
@@ -343,9 +343,9 @@ class MppJpsIncTestsGenerator(val txt: ModulesTxt, val testCaseDirProvider: (Tes
serviceKtFile(module, fileNameSuffix).setFileContent(buildString {
if (settings.generatePlatformDependent)
appendln("expect fun ${module.platformDependentFunName}(): String")
appendLine("expect fun ${module.platformDependentFunName}(): String")
appendln("fun ${module.platformIndependentFunName}() = \"common$fileNameSuffix\"")
appendLine("fun ${module.platformIndependentFunName}() = \"common$fileNameSuffix\"")
appendTestFun(module, settings)
})
@@ -364,14 +364,14 @@ class MppJpsIncTestsGenerator(val txt: ModulesTxt, val testCaseDirProvider: (Tes
serviceKtFile(module, fileNameSuffix).setFileContent(buildString {
if (settings.generatePlatformDependent) {
for (expectedBy in settings.generateActualDeclarationsFor) {
appendln(
appendLine(
"actual fun ${expectedBy.platformDependentFunName}(): String" +
" = \"${module.name}$fileNameSuffix\""
)
}
}
appendln(
appendLine(
"fun ${module.platformOnlyFunName}()" +
" = \"${module.name}$fileNameSuffix\""
)
@@ -398,29 +398,29 @@ class MppJpsIncTestsGenerator(val txt: ModulesTxt, val testCaseDirProvider: (Tes
module: ModulesTxt.Module,
settings: ModuleContentSettings
) {
appendln()
appendln("fun Test${module.serviceName}() {")
appendLine()
appendLine("fun Test${module.serviceName}() {")
val thisAndDependencies = mutableSetOf(module)
module.collectDependenciesRecursivelyTo(thisAndDependencies)
thisAndDependencies.forEach { thisOrDependent ->
if (thisOrDependent.isCommonModule) {
appendln(" ${thisOrDependent.platformIndependentFunName}()")
appendLine(" ${thisOrDependent.platformIndependentFunName}()")
if (settings.generatePlatformDependent) {
appendln(" ${thisOrDependent.platformDependentFunName}()")
appendLine(" ${thisOrDependent.platformDependentFunName}()")
}
} else {
// platform module
appendln(" ${thisOrDependent.platformOnlyFunName}()")
appendLine(" ${thisOrDependent.platformOnlyFunName}()")
if (thisOrDependent.isJvmModule && thisOrDependent.contentsSettings.generateJavaFile) {
appendln(" ${thisOrDependent.javaClassName}().doStuff()")
appendLine(" ${thisOrDependent.javaClassName}().doStuff()")
}
}
}
appendln("}")
appendLine("}")
}
private fun ModulesTxt.Module.collectDependenciesRecursivelyTo(
@@ -82,7 +82,7 @@ fun String.underlineAsText(from: Int, to: Int): String {
if (isEndOfLine(c.toInt())) {
if (lineWasMarked) {
lines.appendln(marks.toString().trimEnd())
lines.appendLine(marks.toString().trimEnd())
lineWasMarked = false
}
@@ -91,7 +91,7 @@ fun String.underlineAsText(from: Int, to: Int): String {
}
if (lineWasMarked) {
lines.appendln()
lines.appendLine()
lines.append(marks.toString())
}
@@ -51,15 +51,17 @@ class ExampleAnnotationProcessor : AbstractProcessor() {
val simpleName = element.simpleName.toString()
val generatedJavaClassName = generatedFilePrefix.capitalize() + simpleName.capitalize() + generatedFileSuffix
filer.createSourceFile(packageName + '.' + generatedJavaClassName).openWriter().use { with(it) {
appendln("package $packageName;")
appendln("public final class $generatedJavaClassName {}")
}}
filer.createSourceFile(packageName + '.' + generatedJavaClassName).openWriter().use {
with(it) {
appendLine("package $packageName;")
appendLine("public final class $generatedJavaClassName {}")
}
}
if (generateKotlinCode && kotlinGenerated != null && element.kind == ElementKind.CLASS) {
File(kotlinGenerated, "$simpleName.kt").writer().buffered().use {
it.appendln("package $packageName")
it.appendln("fun $simpleName.customToString() = \"$generatedJavaClassName: \" + toString()")
it.appendLine("package $packageName")
it.appendLine("fun $simpleName.customToString() = \"$generatedJavaClassName: \" + toString()")
}
}
}
@@ -33,26 +33,26 @@ fun main(args: Array<String>) {
val pkg = e.value.first().second
File(dir, fileName).bufferedWriter().use { w ->
w.appendln("package $pkg;")
w.appendln()
w.appendln()
w.appendLine("package $pkg;")
w.appendLine()
w.appendLine()
e.value.forEach { (url) ->
println("Loading $url...")
w.appendln("// Downloaded from $url")
w.appendLine("// Downloaded from $url")
val content = fetch(url)
if (content != null) {
if (url.endsWith(".idl")) {
w.appendln(content)
w.appendLine(content)
} else {
extractIDLText(content, w)
}
}
}
w.appendln()
w.appendLine()
}
}
}
@@ -69,9 +69,9 @@ private fun fetch(url: String): String? {
private fun Appendable.append(element: Element) {
val text = element.text()
appendln(text)
appendLine(text)
if (!text.trimEnd().endsWith(";")) {
appendln(";")
appendLine(";")
}
}
@@ -354,11 +354,11 @@ abstract class BaseGradleIT {
val errors = "(?m)^.*\\[ERROR] \\[\\S+] (.*)$".toRegex().findAll(output)
val errorMessage = buildString {
appendln("Gradle build failed")
appendln()
appendLine("Gradle build failed")
appendLine()
if (errors.any()) {
appendln("Possible errors:")
errors.forEach { match -> appendln(match.groupValues[1]) }
appendLine("Possible errors:")
errors.forEach { match -> appendLine(match.groupValues[1]) }
}
}
fail(errorMessage)
@@ -669,10 +669,10 @@ Finished executing task ':$taskName'|
}
val xmlString = buildString {
appendln("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
appendln("<results>")
appendLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>")
appendLine("<results>")
files.forEach {
appendln(
appendLine(
it.readText()
.trimTrailingWhitespaces()
.replace(projectDir.absolutePath, "/\$PROJECT_DIR$")
@@ -680,7 +680,7 @@ Finished executing task ':$taskName'|
.replace("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n", "")
)
}
appendln("</results>")
appendLine("</results>")
}
val doc = SAXBuilder().build(xmlString.reader())
@@ -70,7 +70,7 @@ class KotlinGradleIT : BaseGradleIT() {
wd1.deleteRecursively()
if (wd1.exists()) {
val files = buildString {
wd1.walk().forEach { appendln(" " + it.relativeTo(wd1).path) }
wd1.walk().forEach { appendLine(" " + it.relativeTo(wd1).path) }
}
error("Some files in $wd1 were not removed:\n$files")
}
@@ -52,11 +52,11 @@ class MppHighlightingTestDataWithGradleIT : BaseGradleIT() {
// create Gradle Kotlin source sets for project roots:
val scriptCustomization = buildString {
appendln()
appendln("kotlin {\n sourceSets {")
appendLine()
appendLine("kotlin {\n sourceSets {")
sourceRoots.forEach { sourceRoot ->
if (sourceRoot.kotlinSourceSetName != "commonMain") {
appendln(
appendLine(
""" create("${sourceRoot.kotlinSourceSetName}") {
| dependsOn(getByName("commonMain"))
| listOf(${cliCompiler.targets.joinToString { "$it()" }}).forEach {
@@ -67,7 +67,7 @@ class MppHighlightingTestDataWithGradleIT : BaseGradleIT() {
""".trimMargin()
)
} else {
appendln(" // commonMain source set used for common module")
appendLine(" // commonMain source set used for common module")
}
}
@@ -76,11 +76,11 @@ class MppHighlightingTestDataWithGradleIT : BaseGradleIT() {
sourceRoot.dependencies.forEach { dependency ->
sourceRoots.find { it.qualifiedName == dependency }?.let { depSourceRoot ->
val depSourceSet = depSourceRoot.kotlinSourceSetName
appendln(""" getByName("${sourceRoot.kotlinSourceSetName}").dependsOn(getByName("$depSourceSet"))""")
appendLine(""" getByName("${sourceRoot.kotlinSourceSetName}").dependsOn(getByName("$depSourceSet"))""")
}
}
}
appendln(" }\n}")
appendLine(" }\n}")
}
gradleBuildScript().appendText("\n" + scriptCustomization)
@@ -39,7 +39,7 @@ fun runProcess(
if (options?.forceOutputToStdout ?: false) {
println(it)
}
sb.appendln(it)
sb.appendLine(it)
}
val exitCode = process.waitFor()
@@ -20,8 +20,8 @@ class MyProcessor() : AbstractProcessor() {
fileCreated = true
val file = processingEnv.filer.createSourceFile("Check")
file.openWriter().use {
it.appendln("// $annotations")
it.appendln("public class Check {}")
it.appendLine("// $annotations")
it.appendLine("public class Check {}")
}
return true
}
@@ -17,12 +17,12 @@ class Kotlinp(private val settings: KotlinpSettings) {
is KotlinClassMetadata.FileFacade -> FileFacadePrinter(settings).print(classFile)
is KotlinClassMetadata.SyntheticClass -> {
if (classFile.isLambda) LambdaPrinter(settings).print(classFile)
else buildString { appendln("synthetic class") }
else buildString { appendLine("synthetic class") }
}
is KotlinClassMetadata.MultiFileClassFacade -> MultiFileClassFacadePrinter().print(classFile)
is KotlinClassMetadata.MultiFileClassPart -> MultiFileClassPartPrinter(settings).print(classFile)
is KotlinClassMetadata.Unknown -> buildString { appendln("unknown file (k=${classFile.header.kind})") }
null -> buildString { appendln("unsupported file") }
is KotlinClassMetadata.Unknown -> buildString { appendLine("unknown file (k=${classFile.header.kind})") }
null -> buildString { appendLine("unsupported file") }
}
internal fun readClassFile(file: File): KotlinClassMetadata? {
@@ -36,7 +36,7 @@ class Kotlinp(private val settings: KotlinpSettings) {
internal fun renderModuleFile(metadata: KotlinModuleMetadata?): String =
if (metadata != null) ModuleFilePrinter(settings).print(metadata)
else buildString { appendln("unsupported file") }
else buildString { appendLine("unsupported file") }
internal fun readModuleFile(file: File): KotlinModuleMetadata? =
KotlinModuleMetadata.read(file.readBytes())
@@ -57,15 +57,15 @@ private fun visitFunction(settings: KotlinpSettings, sb: StringBuilder, flags: F
}
override fun visitEnd() {
sb.appendln()
sb.appendLine()
if (lambdaClassOriginName != null) {
sb.appendln(" // lambda class origin: $lambdaClassOriginName")
sb.appendLine(" // lambda class origin: $lambdaClassOriginName")
}
for (versionRequirement in versionRequirements) {
sb.appendln(" // $versionRequirement")
sb.appendLine(" // $versionRequirement")
}
if (jvmSignature != null) {
sb.appendln(" // signature: $jvmSignature")
sb.appendLine(" // signature: $jvmSignature")
}
sb.append(" ")
sb.appendFlags(flags, FUNCTION_FLAGS_MAP)
@@ -82,9 +82,9 @@ private fun visitFunction(settings: KotlinpSettings, sb: StringBuilder, flags: F
if (returnType != null) {
sb.append(": ").append(returnType)
}
sb.appendln()
sb.appendLine()
if (contract != null) {
sb.appendln(" $contract")
sb.appendLine(" $contract")
}
}
}
@@ -141,24 +141,24 @@ private fun visitProperty(
}
override fun visitEnd() {
sb.appendln()
sb.appendLine()
for (versionRequirement in versionRequirements) {
sb.appendln(" // $versionRequirement")
sb.appendLine(" // $versionRequirement")
}
if (jvmFieldSignature != null) {
sb.appendln(" // field: $jvmFieldSignature")
sb.appendLine(" // field: $jvmFieldSignature")
}
if (jvmGetterSignature != null) {
sb.appendln(" // getter: $jvmGetterSignature")
sb.appendLine(" // getter: $jvmGetterSignature")
}
if (jvmSetterSignature != null) {
sb.appendln(" // setter: $jvmSetterSignature")
sb.appendLine(" // setter: $jvmSetterSignature")
}
if (jvmSyntheticMethodForAnnotationsSignature != null) {
sb.appendln(" // synthetic method for annotations: $jvmSyntheticMethodForAnnotationsSignature")
sb.appendLine(" // synthetic method for annotations: $jvmSyntheticMethodForAnnotationsSignature")
}
if (isMovedFromInterfaceCompanion) {
sb.appendln(" // is moved from interface companion")
sb.appendLine(" // is moved from interface companion")
}
sb.append(" ")
sb.appendFlags(flags, PROPERTY_FLAGS_MAP)
@@ -177,11 +177,11 @@ private fun visitProperty(
if (Flag.Property.HAS_CONSTANT(flags)) {
sb.append(" /* = ... */")
}
sb.appendln()
sb.appendLine()
if (Flag.Property.HAS_GETTER(flags)) {
sb.append(" ")
sb.appendFlags(getterFlags, PROPERTY_ACCESSOR_FLAGS_MAP)
sb.appendln("get")
sb.appendLine("get")
}
if (Flag.Property.HAS_SETTER(flags)) {
sb.append(" ")
@@ -190,7 +190,7 @@ private fun visitProperty(
if (setterParameter != null) {
sb.append("(").append(setterParameter).append(")")
}
sb.appendln()
sb.appendLine()
}
}
}
@@ -217,18 +217,18 @@ private fun visitConstructor(sb: StringBuilder, flags: Flags): KmConstructorVisi
}
override fun visitEnd() {
sb.appendln()
sb.appendLine()
for (versionRequirement in versionRequirements) {
sb.appendln(" // $versionRequirement")
sb.appendLine(" // $versionRequirement")
}
if (jvmSignature != null) {
sb.appendln(" // signature: $jvmSignature")
sb.appendLine(" // signature: $jvmSignature")
}
sb.append(" ")
sb.appendFlags(flags, CONSTRUCTOR_FLAGS_MAP)
sb.append("constructor(")
params.joinTo(sb)
sb.appendln(")")
sb.appendLine(")")
}
}
@@ -257,12 +257,12 @@ private fun visitTypeAlias(settings: KotlinpSettings, sb: StringBuilder, flags:
printVersionRequirement { versionRequirements.add(it) }
override fun visitEnd() {
sb.appendln()
sb.appendLine()
for (versionRequirement in versionRequirements) {
sb.appendln(" // $versionRequirement")
sb.appendLine(" // $versionRequirement")
}
for (annotation in annotations) {
sb.append(" ").append("@").append(renderAnnotation(annotation)).appendln()
sb.append(" ").append("@").append(renderAnnotation(annotation)).appendLine()
}
sb.append(" ")
sb.appendFlags(flags, VISIBILITY_FLAGS_MAP)
@@ -276,7 +276,7 @@ private fun visitTypeAlias(settings: KotlinpSettings, sb: StringBuilder, flags:
if (expandedType != null) {
sb.append(" /* = ").append(expandedType).append(" */")
}
sb.appendln()
sb.appendLine()
}
}
@@ -537,12 +537,12 @@ private fun StringBuilder.appendDeclarationContainerExtensions(
moduleName: String?
) {
for ((i, sb) in localDelegatedProperties.withIndex()) {
appendln()
appendln(" // local delegated property #$i")
appendLine()
appendLine(" // local delegated property #$i")
for (line in sb.lineSequence()) {
if (line.isBlank()) continue
// Comment all uncommented lines to not make it look like these properties are declared here
appendln(
appendLine(
if (line.startsWith(" ") && !line.startsWith(" //")) line.replaceFirst(" ", " // ")
else line
)
@@ -550,8 +550,8 @@ private fun StringBuilder.appendDeclarationContainerExtensions(
}
if (settings.isVerbose && moduleName != null) {
appendln()
appendln(" // module name: $moduleName")
appendLine()
appendLine(" // module name: $moduleName")
}
}
@@ -564,9 +564,9 @@ private fun printContract(output: (String) -> Unit): KmContractVisitor =
override fun visitEnd() {
output(buildString {
appendln("contract {")
appendLine("contract {")
for (effect in effects) {
appendln(" $effect")
appendLine(" $effect")
}
append(" }")
})
@@ -705,10 +705,10 @@ class ClassPrinter(private val settings: KotlinpSettings) : KmClassVisitor(), Ab
override fun visitEnd() {
if (anonymousObjectOriginName != null) {
result.appendln("// anonymous object origin: $anonymousObjectOriginName")
result.appendLine("// anonymous object origin: $anonymousObjectOriginName")
}
for (versionRequirement in versionRequirements) {
result.appendln("// $versionRequirement")
result.appendLine("// $versionRequirement")
}
result.appendFlags(flags!!, CLASS_FLAGS_MAP)
result.append(name)
@@ -719,9 +719,9 @@ class ClassPrinter(private val settings: KotlinpSettings) : KmClassVisitor(), Ab
result.append(" : ")
supertypes.joinTo(result)
}
result.appendln(" {")
result.appendLine(" {")
result.append(sb)
result.appendln("}")
result.appendLine("}")
}
override fun visitTypeParameter(flags: Flags, name: String, id: Int, variance: KmVariance): KmTypeParameterVisitor? =
@@ -743,23 +743,23 @@ class ClassPrinter(private val settings: KotlinpSettings) : KmClassVisitor(), Ab
visitTypeAlias(settings, sb, flags, name)
override fun visitCompanionObject(name: String) {
sb.appendln()
sb.appendln(" // companion object: $name")
sb.appendLine()
sb.appendLine(" // companion object: $name")
}
override fun visitNestedClass(name: String) {
sb.appendln()
sb.appendln(" // nested class: $name")
sb.appendLine()
sb.appendLine(" // nested class: $name")
}
override fun visitEnumEntry(name: String) {
sb.appendln()
sb.appendln(" $name,")
sb.appendLine()
sb.appendLine(" $name,")
}
override fun visitSealedSubclass(name: ClassName) {
sb.appendln()
sb.appendln(" // sealed subclass: $name")
sb.appendLine()
sb.appendLine(" // sealed subclass: $name")
}
override fun visitVersionRequirement(): KmVersionRequirementVisitor? =
@@ -799,11 +799,11 @@ class ClassPrinter(private val settings: KotlinpSettings) : KmClassVisitor(), Ab
abstract class PackagePrinter(private val settings: KotlinpSettings) : KmPackageVisitor() {
internal val sb = StringBuilder().apply {
appendln("package {")
appendLine("package {")
}
override fun visitEnd() {
sb.appendln("}")
sb.appendLine("}")
}
override fun visitFunction(flags: Flags, name: String): KmFunctionVisitor? =
@@ -843,14 +843,14 @@ class FileFacadePrinter(settings: KotlinpSettings) : PackagePrinter(settings), A
class LambdaPrinter(private val settings: KotlinpSettings) : KmLambdaVisitor(), AbstractPrinter<KotlinClassMetadata.SyntheticClass> {
private val sb = StringBuilder().apply {
appendln("lambda {")
appendLine("lambda {")
}
override fun visitFunction(flags: Flags, name: String): KmFunctionVisitor? =
visitFunction(settings, sb, flags, name)
override fun visitEnd() {
sb.appendln("}")
sb.appendLine("}")
}
override fun print(klass: KotlinClassMetadata.SyntheticClass): String {
@@ -863,7 +863,7 @@ class MultiFileClassPartPrinter(
settings: KotlinpSettings
) : PackagePrinter(settings), AbstractPrinter<KotlinClassMetadata.MultiFileClassPart> {
override fun print(klass: KotlinClassMetadata.MultiFileClassPart): String {
sb.appendln(" // facade: ${klass.facadeClassName}")
sb.appendLine(" // facade: ${klass.facadeClassName}")
klass.accept(this)
return sb.toString()
}
@@ -872,11 +872,11 @@ class MultiFileClassPartPrinter(
class MultiFileClassFacadePrinter : AbstractPrinter<KotlinClassMetadata.MultiFileClassFacade> {
override fun print(klass: KotlinClassMetadata.MultiFileClassFacade): String =
buildString {
appendln("multi-file class {")
appendLine("multi-file class {")
for (part in klass.partClassNames) {
appendln(" // $part")
appendLine(" // $part")
}
appendln("}")
appendLine("}")
}
}
@@ -884,19 +884,19 @@ class ModuleFilePrinter(private val settings: KotlinpSettings) : KmModuleVisitor
private val optionalAnnotations = mutableListOf<ClassPrinter>()
private val sb = StringBuilder().apply {
appendln("module {")
appendLine("module {")
}
override fun visitPackageParts(fqName: String, fileFacades: List<String>, multiFileClassParts: Map<String, String>) {
val presentableFqName = if (fqName.isEmpty()) "<root>" else fqName
sb.appendln(" package $presentableFqName {")
sb.appendLine(" package $presentableFqName {")
for (fileFacade in fileFacades) {
sb.appendln(" $fileFacade")
sb.appendLine(" $fileFacade")
}
for ((multiFileClassPart, facade) in multiFileClassParts) {
sb.appendln(" $multiFileClassPart ($facade)")
sb.appendLine(" $multiFileClassPart ($facade)")
}
sb.appendln(" }")
sb.appendLine(" }")
}
override fun visitAnnotation(annotation: KmAnnotation) {
@@ -908,14 +908,14 @@ class ModuleFilePrinter(private val settings: KotlinpSettings) : KmModuleVisitor
override fun visitEnd() {
if (optionalAnnotations.isNotEmpty()) {
sb.appendln()
sb.appendln(" // Optional annotations")
sb.appendln()
sb.appendLine()
sb.appendLine(" // Optional annotations")
sb.appendLine()
for (element in optionalAnnotations) {
sb.appendln(" " + element.result.toString().replace("\n", "\n ").trimEnd())
sb.appendLine(" " + element.result.toString().replace("\n", "\n ").trimEnd())
}
}
sb.appendln("}")
sb.appendLine("}")
}
fun print(metadata: KotlinModuleMetadata): String {
@@ -87,8 +87,8 @@ private fun compile(file: File, disposable: Disposable, tmpdir: File, forEachOut
}
private fun StringBuilder.appendFileName(file: File) {
appendln("// ${file.invariantSeparatorsPath}")
appendln("// ------------------------------------------")
appendLine("// ${file.invariantSeparatorsPath}")
appendLine("// ------------------------------------------")
}
// Reads the class file and writes it back with *Writer visitors.
@@ -34,7 +34,7 @@ internal class JKCommentPrinter(val printer: JKPrinter) {
for (comment in this@createText) {
if (comment.shouldBeDropped()) continue
val text = comment.createText() ?: continue
if (needNewLine && comment.indent?.let { StringUtil.containsLineBreak(it) } != true) appendln()
if (needNewLine && comment.indent?.let { StringUtil.containsLineBreak(it) } != true) appendLine()
append(comment.indent ?: ' ')
append(text)
needNewLine = text.startsWith("//") || '\n' in text
@@ -169,29 +169,29 @@ fun KaptOptions.collectJavaSourceFiles(sourcesToReprocess: SourcesToReprocess =
fun KaptOptions.logString(additionalInfo: String = "") = buildString {
val additionalInfoRendered = if (additionalInfo.isEmpty()) "" else " ($additionalInfo)"
appendln("Kapt3 is enabled$additionalInfoRendered.")
appendLine("Kapt3 is enabled$additionalInfoRendered.")
appendln("Annotation processing mode: ${mode.stringValue}")
appendln("Memory leak detection mode: ${detectMemoryLeaks.stringValue}")
KaptFlag.values().forEach { appendln(it.description + ": " + this@logString[it]) }
appendLine("Annotation processing mode: ${mode.stringValue}")
appendLine("Memory leak detection mode: ${detectMemoryLeaks.stringValue}")
KaptFlag.values().forEach { appendLine(it.description + ": " + this@logString[it]) }
appendln("Project base dir: $projectBaseDir")
appendln("Compile classpath: " + compileClasspath.joinToString())
appendln("Java source roots: " + javaSourceRoots.joinToString())
appendLine("Project base dir: $projectBaseDir")
appendLine("Compile classpath: " + compileClasspath.joinToString())
appendLine("Java source roots: " + javaSourceRoots.joinToString())
appendln("Sources output directory: $sourcesOutputDir")
appendln("Class files output directory: $classesOutputDir")
appendln("Stubs output directory: $stubsOutputDir")
appendln("Incremental data output directory: $incrementalDataOutputDir")
appendLine("Sources output directory: $sourcesOutputDir")
appendLine("Class files output directory: $classesOutputDir")
appendLine("Stubs output directory: $stubsOutputDir")
appendLine("Incremental data output directory: $incrementalDataOutputDir")
appendln("Annotation processing classpath: " + processingClasspath.joinToString())
appendln("Annotation processors: " + processors.joinToString())
appendLine("Annotation processing classpath: " + processingClasspath.joinToString())
appendLine("Annotation processors: " + processors.joinToString())
appendln("AP options: $processingOptions")
appendln("Javac options: $javacOptions")
appendLine("AP options: $processingOptions")
appendLine("Javac options: $javacOptions")
appendln("[incremental apt] Changed files: $changedFiles")
appendln("[incremental apt] Compiled sources directories: ${compiledSources.joinToString()}")
appendln("[incremental apt] Cache directory for incremental compilation: $incrementalCache")
appendln("[incremental apt] Changed classpath names: ${classpathChanges.joinToString()}")
appendLine("[incremental apt] Changed files: $changedFiles")
appendLine("[incremental apt] Compiled sources directories: ${compiledSources.joinToString()}")
appendLine("[incremental apt] Cache directory for incremental compilation: $incrementalCache")
appendLine("[incremental apt] Changed classpath names: ${classpathChanges.joinToString()}")
}
@@ -96,8 +96,8 @@ abstract class AbstractKaptToolIntegrationTest : TestCaseWithTmpdir() {
if (!process.waitFor(2, TimeUnit.MINUTES)) err("Process is still alive")
if (process.exitValue() != 0) {
throw GotResult(buildString {
append("Return code: ").appendln(process.exitValue()).appendln()
appendln(outputFile.readText())
append("Return code: ").appendLine(process.exitValue()).appendLine()
appendLine(outputFile.readText())
})
}
}
@@ -117,6 +117,6 @@ private val Section.args get() = readArgumentsFromArgFile(preprocessPathSeparato
private fun preprocessPathSeparators(text: String): String = buildString {
for (line in text.lineSequence()) {
val transformed = if (line.startsWith("-cp ")) line.replace(':', File.pathSeparatorChar) else line
appendln(transformed)
appendLine(transformed)
}
}
@@ -33,7 +33,7 @@ class Section(val name: String, val content: String) {
saveCurrent()
currentName = line.drop(2)
} else {
currentContent.appendln(line)
currentContent.appendLine(line)
}
}
@@ -45,8 +45,8 @@ class Section(val name: String, val content: String) {
fun List<Section>.render(): String = buildString {
for (section in this@render) {
append(SECTION_INDICATOR).appendln(section.name)
appendln(section.content).appendln()
append(SECTION_INDICATOR).appendLine(section.name)
appendLine(section.content).appendLine()
}
}.trim()
@@ -240,8 +240,8 @@ abstract class AbstractKapt3Extension(
for (leak in leaks) {
logger.warn(buildString {
appendln("Memory leak detected!")
appendln("Location: '${leak.className}', static field '${leak.fieldName}'")
appendLine("Memory leak detected!")
appendLine("Location: '${leak.className}', static field '${leak.fieldName}'")
append(leak.description)
})
}
@@ -42,9 +42,9 @@ class KotlinUSwitchExpression(
override fun asRenderString() = buildString {
val expr = expression?.let { "(" + it.asRenderString() + ") " } ?: ""
appendln("switch $expr {")
appendln(body.asRenderString())
appendln("}")
appendLine("switch $expr {")
appendLine(body.asRenderString())
appendLine("}")
}
override val switchIdentifier: UIdentifier
@@ -62,9 +62,9 @@ class KotlinUSwitchEntry(
override val body: UExpressionList by lz {
object : KotlinUExpressionList(sourcePsi, KotlinSpecialExpressionKinds.WHEN_ENTRY, this@KotlinUSwitchEntry) {
override fun asRenderString() = buildString {
appendln("{")
expressions.forEach { appendln(it.asRenderString().withMargin) }
appendln("}")
appendLine("{")
expressions.forEach { appendLine(it.asRenderString().withMargin) }
appendLine("}")
}
}.apply KotlinUExpressionList@{
val exprPsi = this@KotlinUSwitchEntry.sourcePsi.expression
@@ -43,7 +43,7 @@ class AlternativesRenderLogTest : AbstractKotlinUastTest() {
builder.append(" ".repeat(level))
builder.append("[${uElement.size}]:")
builder.append(uElement.joinToString(", ", "[", "]") { it.asLogString() })
builder.appendln()
builder.appendLine()
}
if (uElement.any()) level++
element.acceptChildren(this)
@@ -37,7 +37,7 @@ class MultiplesRequiredTypesTest : AbstractKotlinUastTest() {
if (uElement != null) {
builder.append(" ".repeat(level))
builder.append(uElement.asLogString())
builder.appendln()
builder.appendLine()
}
if (uElement != null) level++
element.acceptChildren(this)
@@ -23,7 +23,7 @@ abstract class IndentedPrintingVisitor(val shouldIndent: (PsiElement) -> Boolean
if (charSequence != null) {
builder.append(" ".repeat(level))
builder.append(charSequence)
builder.appendln()
builder.appendLine()
}
val shouldIndent = shouldIndent(element)
@@ -47,7 +47,7 @@ interface TypesTestBase {
val value = node.getExpressionType()
value?.let { builder.append(" : ").append(it) }
}
builder.appendln()
builder.appendLine()
level++
return false
}
@@ -54,7 +54,7 @@ interface ValuesTestBase {
val value = evaluationContext.valueOf(node)
builder.append(" = ").append(value)
}
builder.appendln()
builder.appendLine()
level++
return false
}