Skip to content

Commit d175671

Browse files
committed
fix: remove unused import and adjust null checks
1 parent 800640b commit d175671

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/utils/ProjectFileUtil.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import com.intellij.openapi.vfs.VirtualFile
88
import com.intellij.openapi.vfs.VirtualFileManager
99
import com.intellij.psi.search.FilenameIndex
1010
import com.intellij.psi.search.ProjectScope
11-
import java.util.concurrent.TimeUnit
1211

1312
fun Project.lookupFile(path: String): VirtualFile? {
1413
val projectPath = this.guessProjectDir()?.toNioPath()

exts/devins-lang/src/test/kotlin/cc/unitmesh/devti/language/compiler/DevInCompilerTest.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,25 @@ package cc.unitmesh.devti.language.compiler
22

33
import cc.unitmesh.devti.language.psi.DevInFile
44
import com.intellij.testFramework.fixtures.LightJavaCodeInsightFixtureTestCase
5+
import org.intellij.lang.annotations.Language
56
import org.jetbrains.kotlin.konan.file.File
67

78
class DevInCompilerTest : LightJavaCodeInsightFixtureTestCase() {
89
fun testNormalString() {
9-
val code = "Normal String /"
10+
@Language("DevIn")
11+
val code = "Normal String"
1012
val file = myFixture.configureByText("test.devin", code)
1113

1214
val compile = DevInsCompiler(project, file as DevInFile, myFixture.editor).compile()
1315
assertEquals("Normal String /", compile.output)
1416
}
1517

1618
fun testForWriting() {
17-
// add fake code to project
1819
val projectPath = project.basePath + File.separator
19-
myFixture.configureByText("Sample.devin", "Sample Text")
20+
21+
@Language("DevIn")
2022
val code = "/write:${projectPath}Sample.devin#L1-L2\n```devin\nNormal String /\n```"
23+
myFixture.configureByText("Sample.devin", "Sample Text")
2124
val file = myFixture.configureByText("test.devin", code)
2225

2326
try {
@@ -29,6 +32,7 @@ class DevInCompilerTest : LightJavaCodeInsightFixtureTestCase() {
2932
}
3033

3134
fun testForRefactoring() {
35+
@Language("DevIn")
3236
val code = "/refactor:rename cc.unitmesh.devti.language.run.DevInsProgramRunner to cc.unitmesh.devti.language.run.DevInsProgramRunnerImpl"
3337
val file = myFixture.configureByText("test.devin", code)
3438

0 commit comments

Comments
 (0)