Skip to content

Commit 1e87e11

Browse files
darthorimarintellij-monorepo-bot
authored andcommitted
[lsp] fix workspace.json generation so it provides OS-independent paths on Windows
GitOrigin-RevId: e19057c4c7661515e1fc861884499b892d25462b
1 parent 3432f0e commit 1e87e11

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

workspace-import/src/com/jetbrains/ls/imports/json/conversion.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,13 @@ private val userHome = Path.of(System.getProperty("user.home"))
200200

201201
private fun toPath(url: VirtualFileUrl, workspacePath: Path): String {
202202
val path = url.toPath()
203-
return when {
203+
var pathString = when {
204204
path.startsWith(workspacePath) -> WORKSPACE_PREFIX + workspacePath.relativize(path)
205205
path.startsWith(userHome) -> USER_HOME_PREFIX + userHome.relativize(path)
206206
else -> path.absolutePathString()
207207
}
208+
pathString = FileUtilRt.toSystemIndependentName(pathString)
209+
return pathString
208210
}
209211

210212

0 commit comments

Comments
 (0)