Skip to content

Commit a16f7cf

Browse files
committed
fix(FileIns): use relative path in file output
Replace the file property with the relative path in the output for better readability and consistency.
1 parent d330927 commit a16f7cf

File tree

1 file changed

+4
-1
lines changed
  • exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec

1 file changed

+4
-1
lines changed

exts/devins-lang/src/main/kotlin/cc/unitmesh/devti/language/compiler/exec/FileInsCommand.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import cc.unitmesh.devti.language.compiler.model.LineInfo
99
import cc.unitmesh.devti.language.utils.findFile
1010
import cc.unitmesh.devti.language.utils.lookupFile
1111
import cc.unitmesh.devti.sketch.ui.patch.readText
12+
import cc.unitmesh.devti.util.relativePath
1213
import com.intellij.openapi.project.Project
1314
import com.intellij.openapi.vfs.VirtualFile
1415
import com.intellij.psi.PsiManager
@@ -60,8 +61,10 @@ class FileInsCommand(private val myProject: Project, private val prop: String) :
6061
}
6162
}
6263

64+
val realPath = virtualFile.relativePath(myProject)
65+
6366
val output = StringBuilder()
64-
output.append("## file: $prop")
67+
output.append("## file: $realPath")
6568
output.append("\n```$lang\n")
6669
output.append(fileContent)
6770
output.append("\n```\n")

0 commit comments

Comments
 (0)