Skip to content

Commit ea37212

Browse files
committed
fix(service): modify JavaWriteTestService to use JavaLanguage
The JavaWriteTestService in the service package has been modified to use the JavaLanguage class instead of the deprecated Language class. This change ensures compatibility with the latest version of IntelliJ IDEA.
1 parent 961acb6 commit ea37212

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ package cc.unitmesh.idea.service
22

33
import cc.unitmesh.devti.context.ClassContext
44
import cc.unitmesh.devti.context.ClassContextProvider
5-
import cc.unitmesh.devti.provider.context.TestFileContext
65
import cc.unitmesh.devti.provider.WriteTestService
6+
import cc.unitmesh.devti.provider.context.TestFileContext
77
import com.intellij.execution.configurations.RunProfile
8-
import com.intellij.lang.Language
8+
import com.intellij.lang.java.JavaLanguage
99
import com.intellij.openapi.application.ReadAction
1010
import com.intellij.openapi.application.runReadAction
1111
import com.intellij.openapi.command.WriteCommandAction
@@ -27,7 +27,7 @@ class JavaWriteTestService : WriteTestService() {
2727
}
2828

2929
override fun isApplicable(element: PsiElement): Boolean {
30-
return element.language == Language.findLanguageByID("JAVA")
30+
return element.language is JavaLanguage
3131
}
3232

3333
override fun findOrCreateTestFile(sourceFile: PsiFile, project: Project, element: PsiElement): TestFileContext? {

0 commit comments

Comments
 (0)