diff --git a/build.gradle.kts b/build.gradle.kts index 5a9893a1..2c0e3504 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -111,8 +111,8 @@ configure(allprojects) { } } scm { - connection.set("scm:git:git://github.com/unit-mesh/unit-eval.git") - developerConnection.set("scm:git:ssh://github.com/unit-mesh/unit-eval.git") + connection.set("scm:git:git://github.com/unit-mesh/unit-pick.git") + developerConnection.set("scm:git:ssh://github.com/unit-mesh/unit-pick.git") url.set("https://github.com/unit-mesh/unit-eval/") } } diff --git a/gradlew b/gradlew index 1b6c7873..a3cdd3f6 100755 --- a/gradlew +++ b/gradlew @@ -216,7 +216,7 @@ set -- \ # # but POSIX shell has neither arrays nor command substitution, so instead we # post-process each arg (as a line of input to sed) to backslash-escape any -# character that might be a shell metacharacter, then use eval to reverse +# character that might be a shell metacharacter, then use pick to reverse # that process (while maintaining the separation between arguments), and wrap # the whole thing up as a single "set" statement. # diff --git a/settings.gradle.kts b/settings.gradle.kts index f003490c..7170c062 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -11,7 +11,7 @@ plugins { include( "unit-core", "unit-picker", - "unit-eval", + "unit-pick", "code-quality" ) diff --git a/unit-eval/build.gradle.kts b/unit-eval/build.gradle.kts index 40aec6ff..a5180218 100644 --- a/unit-eval/build.gradle.kts +++ b/unit-eval/build.gradle.kts @@ -29,13 +29,13 @@ tasks.test { application { - mainClass.set("cc.unitmesh.eval.checker.MainKt") + mainClass.set("cc.unitmesh.pick.checker.MainKt") } tasks { shadowJar { manifest { - attributes(Pair("Main-Class", "cc.unitmesh.eval.checker.MainKt")) + attributes(Pair("Main-Class", "cc.unitmesh.pick.checker.MainKt")) } // minimize() dependencies { diff --git a/unit-eval/src/main/kotlin/cc/unitmesh/eval/Main.kt b/unit-eval/src/main/kotlin/cc/unitmesh/pick/Main.kt similarity index 100% rename from unit-eval/src/main/kotlin/cc/unitmesh/eval/Main.kt rename to unit-eval/src/main/kotlin/cc/unitmesh/pick/Main.kt diff --git a/unit-picker/build.gradle.kts b/unit-picker/build.gradle.kts index a2f493f4..dd5f898c 100644 --- a/unit-picker/build.gradle.kts +++ b/unit-picker/build.gradle.kts @@ -42,13 +42,13 @@ tasks.test { } application { - mainClass.set("cc.unitmesh.eval.picker.MainKt") + mainClass.set("cc.unitmesh.pick.MainKt") } tasks { shadowJar { manifest { - attributes(Pair("Main-Class", "cc.unitmesh.eval.picker.MainKt")) + attributes(Pair("Main-Class", "cc.unitmesh.pick.MainKt")) } // minimize() dependencies { diff --git a/unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/Main.kt b/unit-picker/src/main/kotlin/cc/unitmesh/pick/Main.kt similarity index 80% rename from unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/Main.kt rename to unit-picker/src/main/kotlin/cc/unitmesh/pick/Main.kt index bbd49560..b9fda112 100644 --- a/unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/Main.kt +++ b/unit-picker/src/main/kotlin/cc/unitmesh/pick/Main.kt @@ -1,5 +1,7 @@ -package cc.unitmesh.eval.picker +package cc.unitmesh.pick +import cc.unitmesh.pick.picker.CodePicker +import cc.unitmesh.pick.picker.PickerConfig import com.github.ajalt.clikt.core.CliktCommand import com.github.ajalt.clikt.parameters.options.default import com.github.ajalt.clikt.parameters.options.option diff --git a/unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/CodePicker.kt b/unit-picker/src/main/kotlin/cc/unitmesh/pick/picker/CodePicker.kt similarity index 87% rename from unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/CodePicker.kt rename to unit-picker/src/main/kotlin/cc/unitmesh/pick/picker/CodePicker.kt index 114f1bf7..27776507 100644 --- a/unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/CodePicker.kt +++ b/unit-picker/src/main/kotlin/cc/unitmesh/pick/picker/CodePicker.kt @@ -1,4 +1,4 @@ -package cc.unitmesh.eval.picker +package cc.unitmesh.pick.picker import org.archguard.action.checkout.GitSourceSettings import org.archguard.action.checkout.executeGitCheckout @@ -68,10 +68,10 @@ class CodePicker(val config: PickerConfig) { * * for example: * - * - `https://github.com/unit-mesh/unit-eval` tobe `github.com/unit-mesh/unit-eval` - * - `git://github.com/unit-mesh/unit-eval` tobe `github.com/unit-mesh/unit-eval` - * - `git://github.com/unit-mesh/unit-eval.git` tobe `github.com/unit-mesh/unit-eval` - * - `http://github.com/unit-mesh/unit-eval` tobe `github.com/unit-mesh/unit-eval` + * - `https://github.com/unit-mesh/unit-pick` tobe `github.com/unit-mesh/unit-pick` + * - `git://github.com/unit-mesh/unit-pick` tobe `github.com/unit-mesh/unit-pick` + * - `git://github.com/unit-mesh/unit-pick.git` tobe `github.com/unit-mesh/unit-pick` + * - `http://github.com/unit-mesh/unit-pick` tobe `github.com/unit-mesh/unit-pick` * */ fun gitUrlToPath(url: String): String { diff --git a/unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/PickerConfig.kt b/unit-picker/src/main/kotlin/cc/unitmesh/pick/picker/PickerConfig.kt similarity index 78% rename from unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/PickerConfig.kt rename to unit-picker/src/main/kotlin/cc/unitmesh/pick/picker/PickerConfig.kt index 7ea032fa..61c5e1b5 100644 --- a/unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/PickerConfig.kt +++ b/unit-picker/src/main/kotlin/cc/unitmesh/pick/picker/PickerConfig.kt @@ -1,4 +1,4 @@ -package cc.unitmesh.eval.picker +package cc.unitmesh.pick.picker data class PickerConfig( val url: String, diff --git a/unit-picker/src/main/kotlin/cc/unitmesh/pick/picker/ToolingPromptType.kt b/unit-picker/src/main/kotlin/cc/unitmesh/pick/picker/ToolingPromptType.kt new file mode 100644 index 00000000..7f4587e0 --- /dev/null +++ b/unit-picker/src/main/kotlin/cc/unitmesh/pick/picker/ToolingPromptType.kt @@ -0,0 +1,25 @@ +package cc.unitmesh.pick.picker + +enum class ToolingPromptType { + /** + * like GitHub Copilot, use similar chunk of code to complete + */ + INLINE_CODE_COMPLETION, + + /** + * like GitHub Copilot, use similar chunk of code to complete + */ + IN_BLOCK_CODE_COMPLETION, + + /** + * like GitHub Copilot, use similar chunk of code to complete + */ + AFTER_BLOCK_CODE_COMPLETION, + + /** + * like AutoDev, use Static Program Analysis for code based on imports + */ + RELATED_CODE_COMPLETION, + CODE_DIFF, + REFACTOR, +} \ No newline at end of file diff --git a/unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/worker/AbstractWorker.kt b/unit-picker/src/main/kotlin/cc/unitmesh/pick/worker/AbstractWorker.kt similarity index 68% rename from unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/worker/AbstractWorker.kt rename to unit-picker/src/main/kotlin/cc/unitmesh/pick/worker/AbstractWorker.kt index 6a0bd739..33359277 100644 --- a/unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/worker/AbstractWorker.kt +++ b/unit-picker/src/main/kotlin/cc/unitmesh/pick/worker/AbstractWorker.kt @@ -1,4 +1,4 @@ -package cc.unitmesh.eval.picker.worker +package cc.unitmesh.pick.worker abstract class AbstractWorker { abstract suspend fun start(filePath: String) diff --git a/unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/worker/JavaFileWorker.kt b/unit-picker/src/main/kotlin/cc/unitmesh/pick/worker/JavaFileWorker.kt similarity index 93% rename from unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/worker/JavaFileWorker.kt rename to unit-picker/src/main/kotlin/cc/unitmesh/pick/worker/JavaFileWorker.kt index 6e996d29..3eabbe70 100644 --- a/unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/worker/JavaFileWorker.kt +++ b/unit-picker/src/main/kotlin/cc/unitmesh/pick/worker/JavaFileWorker.kt @@ -1,4 +1,4 @@ -package cc.unitmesh.eval.picker.worker +package cc.unitmesh.pick.worker import kotlinx.coroutines.coroutineScope import org.archguard.scanner.analyser.count.FileJob @@ -12,7 +12,7 @@ import org.archguard.scanner.analyser.count.FileJob * | b05d38f6 | 1 | 1 | 1 | 1 | * | 99ac469e | 1 | 1 | 1 | 1 | * - * We have different strategies to build the eval datasets. + * We have different strategies to build the pick datasets. * * - by Horizontal (with Import File): * - by Vertical (with History Change): diff --git a/unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/worker/WorkerDispatch.kt b/unit-picker/src/main/kotlin/cc/unitmesh/pick/worker/WorkerDispatch.kt similarity index 86% rename from unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/worker/WorkerDispatch.kt rename to unit-picker/src/main/kotlin/cc/unitmesh/pick/worker/WorkerDispatch.kt index 3a8b63a0..c818c53d 100644 --- a/unit-picker/src/main/kotlin/cc/unitmesh/eval/picker/worker/WorkerDispatch.kt +++ b/unit-picker/src/main/kotlin/cc/unitmesh/pick/worker/WorkerDispatch.kt @@ -1,4 +1,4 @@ -package cc.unitmesh.eval.picker.worker +package cc.unitmesh.pick.worker object WorkerDispatch { /** diff --git a/unit-picker/src/test/kotlin/cc/unitmesh/eval/picker/CodePickerTest.kt b/unit-picker/src/test/kotlin/cc/unitmesh/pick/picker/CodePickerTest.kt similarity index 97% rename from unit-picker/src/test/kotlin/cc/unitmesh/eval/picker/CodePickerTest.kt rename to unit-picker/src/test/kotlin/cc/unitmesh/pick/picker/CodePickerTest.kt index a1fe4af0..268987ee 100644 --- a/unit-picker/src/test/kotlin/cc/unitmesh/eval/picker/CodePickerTest.kt +++ b/unit-picker/src/test/kotlin/cc/unitmesh/pick/picker/CodePickerTest.kt @@ -1,4 +1,4 @@ -package cc.unitmesh.eval.picker; +package cc.unitmesh.pick.picker; import org.junit.jupiter.api.Test import kotlin.test.assertEquals @@ -8,7 +8,7 @@ class CodePickerTest { fun should_return_unique_path() { // based on: https://www.debuggex.com/r/fFggA8Uc4YYKjl34 assertEquals( - "github.com/unit-mesh/unit-eval", + "github.com/unit-mesh/unit-pick", CodePicker.gitUrlToPath("https://github.com/unit-mesh/unit-eval") ) assertEquals(