shared-indexes: move PrettyWriter to shared-indexes plugin, where it is used.

GitOrigin-RevId: d86456e0f28177f8f918465b43f7ffb88b32816a
This commit is contained in:
Sergey Patrikeev
2020-05-07 16:30:40 +00:00
committed by intellij-monorepo-bot
parent 7ed3543a90
commit 2edf222e0e
@@ -1,32 +0,0 @@
package com.intellij.util.indexing.diagnostic.dump.output
import java.io.PrintStream
class PrettyWriter(private val out: PrintStream) : AutoCloseable {
private var indent = ""
inner class Object {
fun writeString(s: String) {
s.lineSequence().forEach {
out.println("$indent$it")
}
}
}
fun writeObject(name: String, block: Object.() -> Unit) {
out.println("$indent$name")
indent += " "
val obj = Object()
try {
obj.block()
}
finally {
indent = indent.removeSuffix(" ")
}
}
override fun close() {
out.close()
}
}