Skip to content

Commit b014315

Browse files
Fix VSCode extension for paths with special chars
1 parent c31a7bc commit b014315

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/dev/latvian/mods/kubejs/client/VSCodeExt.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public static boolean isInstalled() {
5151
}
5252

5353
public static void openFile(Path path, int line, int column) {
54-
Util.getPlatform().openUri(URI.create("vscode://file/" + path.toAbsolutePath().toString().replace('\\', '/') + ":" + line + ":" + column));
54+
var uri = path.toAbsolutePath().toUri();
55+
Util.getPlatform().openUri(URI.create("vscode://file" + uri.getRawPath() + ":" + line + ":" + column));
5556
}
5657
}

0 commit comments

Comments
 (0)