Skip to content

Commit

Permalink
feat(devins-android): init Android test service support
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Mar 25, 2024
1 parent c146e87 commit 24a5da1
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package cc.unitmesh.android.provider

import cc.unitmesh.devti.context.ClassContext
import cc.unitmesh.devti.provider.AutoTestService
import cc.unitmesh.devti.provider.context.TestFileContext
import com.intellij.execution.configurations.RunProfile
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElement
import com.intellij.psi.PsiFile
import org.jetbrains.android.util.AndroidUtils
import org.jetbrains.kotlin.psi.KtFile

class AndroidTestService: AutoTestService() {
override fun isApplicable(element: PsiElement): Boolean = AndroidUtils.hasAndroidFacets(element.project)
override fun psiFileClass(project: Project): Class<out PsiElement> = KtFile::class.java

override fun runConfigurationClass(project: Project): Class<out RunProfile>? {
TODO("Not yet implemented")
}

override fun findOrCreateTestFile(sourceFile: PsiFile, project: Project, element: PsiElement): TestFileContext? {
TODO("Not yet implemented")
}

override fun lookupRelevantClass(project: Project, element: PsiElement): List<ClassContext> {
TODO("Not yet implemented")
}
}
4 changes: 4 additions & 0 deletions exts/ext-android/src/main/resources/cc.unitmesh.android.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@

<extensions defaultExtensionNs="cc.unitmesh">
<chatContextProvider implementation="cc.unitmesh.android.provider.AndroidChatContextProvider"/>

<!-- <testContextProvider-->
<!-- language="kotlin"-->
<!-- implementation="cc.unitmesh.android.provider.AndroidTestService"/>-->
</extensions>
</idea-plugin>

0 comments on commit 24a5da1

Please sign in to comment.