mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
shared-indexes: move PrettyWriter to shared-indexes plugin, where it is used.
GitOrigin-RevId: d86456e0f28177f8f918465b43f7ffb88b32816a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7ed3543a90
commit
2edf222e0e
-32
@@ -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()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user