Skip to content

Commit

Permalink
feat: init basic arch code completion builder
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 4, 2023
1 parent e9111ca commit 9e0e247
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package cc.unitmesh.core.arch

/**
*
*/
interface LayeredArchitecture {
val layerDefinitions: LayerDefinitions
}

data class LayerDefinition(
val name: String,
val optional: Boolean = false,
)

class LayerDefinitions {
private val layerDefinitions: MutableMap<String, LayerDefinition> = LinkedHashMap()

fun add(definition: LayerDefinition) {
layerDefinitions[definition.name] = definition
}

fun containLayer(layerName: String): Boolean {
return layerDefinitions.containsKey(layerName)
}

private fun get(layerNames: Collection<String>): List<LayerDefinition> {
return layerNames.mapNotNull(layerDefinitions::get)
}

operator fun iterator(): Iterator<LayerDefinition> {
return layerDefinitions.values.iterator()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package cc.unitmesh.core.prompts

import cc.unitmesh.core.ContextBuilder

class CodeCompletionBuilder: ContextBuilder {
override fun build(): String {
TODO("Not yet implemented")
}
}

0 comments on commit 9e0e247

Please sign in to comment.