CE fix
This commit is contained in:
parent
4f9fba5237
commit
ffaa932127
@ -1,6 +1,6 @@
|
||||
package documentBuilder
|
||||
|
||||
public class GraphManager(private val graph: DependencyGraph) {
|
||||
public class GraphManager(public val graph: DependencyGraph) {
|
||||
fun buildDocument(file: FileName) {
|
||||
val list = graph.nodes[file]
|
||||
if (list != null) {
|
||||
|
@ -1,6 +1,8 @@
|
||||
package documentBuilder
|
||||
|
||||
import kotlinx.coroutines.coroutineScope
|
||||
import kotlin.collections.MutableList
|
||||
|
||||
|
||||
public typealias FileName = String
|
||||
|
||||
@ -38,14 +40,29 @@ public data class IncludeDependency(
|
||||
) : DependencyGraphEdge {
|
||||
override fun visit(graphManager: GraphManager) {
|
||||
val parent = parentNode
|
||||
val childs: MutableList<MdAstElement> = mutableListOf()
|
||||
for (file in includeList) {
|
||||
graphManager.buildDocument(file)
|
||||
parent.children.add(graphManager.graph.nodes[file].mdAst)
|
||||
childs.addAll(graphManager.graph.nodes[file]!!.mdAst.children)
|
||||
}
|
||||
dependentNode = parent
|
||||
val elements: MutableList<MdAstElement> = parent.children.toMutableList()
|
||||
val index = parent.children.indexOf(dependentNode)
|
||||
elements.removeAt(index)
|
||||
elements.addAll(index, childs)
|
||||
parent.children = elements
|
||||
}
|
||||
}
|
||||
|
||||
// parent - List<MdAstElement> --------------------------------------
|
||||
// | \
|
||||
// | \
|
||||
// \ \
|
||||
// | \
|
||||
// | \
|
||||
// dependentNode - MdAstElement \
|
||||
// |
|
||||
// List<FileName> -> List<MdAstRoot> --> List<List<MdAstElement>> ===> List<MdAstElement>
|
||||
|
||||
/**
|
||||
* Whole dependency graph.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user