-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: init basic arch code completion builder
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
unit-core/src/main/kotlin/cc/unitmesh/core/arch/LayeredArchitecture.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
unit-core/src/main/kotlin/cc/unitmesh/core/prompts/CodeCompletionBuilder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
} | ||
} |