Skip to content

Commit

Permalink
fix: fix more options issues
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 25, 2023
1 parent dd25185 commit 77ae49b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import cc.unitmesh.core.Instruction
import cc.unitmesh.core.SupportedLang
import cc.unitmesh.core.unittest.TestCodeBuilderType
import cc.unitmesh.core.unittest.TypedTestIns
import cc.unitmesh.pick.builder.ins.RelatedCodeIns
import kotlinx.serialization.Serializable
import kotlinx.serialization.json.Json

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package cc.unitmesh.pick.builder.unittest.lang

import cc.unitmesh.core.completion.CompletionBuilderType
import cc.unitmesh.core.unittest.TypedTestIns
import cc.unitmesh.pick.builder.testBuilders
import cc.unitmesh.pick.builder.unittest.ClassTestCodeBuilder
import cc.unitmesh.pick.builder.unittest.MethodTestCodeBuilder
import cc.unitmesh.pick.worker.job.InstructionFileJob
Expand Down Expand Up @@ -65,6 +67,10 @@ class JavaTestCodeService(val context: JobContext) : UnitTestService {
}.flatten()

override fun build(dataStruct: CodeDataStruct): List<TypedTestIns> {
if (!context.completionBuilderTypes.contains(CompletionBuilderType.TEST_CODE_GEN)) {
return emptyList()
}

val underTestFile = this.findUnderTestFile(dataStruct).firstOrNull() ?: return emptyList()
val relevantClasses = this.lookupRelevantClass(dataStruct)
val classTestIns = ClassTestCodeBuilder(context)
Expand Down

0 comments on commit 77ae49b

Please sign in to comment.