Skip to content

Commit 9c4da21

Browse files
committed
fix(service): fix canonicalName generation in JavaAutoTestService #101
- Fixed a bug in the `JavaAutoTestService` where the `canonicalName` was not being generated correctly. - The `name.replace(".java", "")` was replaced with `virtualFile.nameWithoutExtension` to generate the correct `canonicalName`.
1 parent 8793f9f commit 9c4da21

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

java/src/main/kotlin/cc/unitmesh/idea/service/JavaAutoTestService.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class JavaAutoTestService : AutoTestService() {
3838
val name = virtualFile.name
3939

4040
val psiFile: PsiJavaFile = PsiManager.getInstance(project).findFile(virtualFile) as? PsiJavaFile ?: return null
41-
val canonicalName = psiFile.packageName + "." + psiFile.name.replace(".java", "")
41+
val canonicalName = psiFile.packageName + "." + virtualFile.nameWithoutExtension
4242

4343
val runManager = RunManager.getInstance(project)
4444

0 commit comments

Comments
 (0)