summaryrefslogtreecommitdiff
path: root/modules/gdscript/language_server
diff options
context:
space:
mode:
authorLamia <git@lamia.io>2022-07-24 21:42:32 +1000
committerLamia <git@lamia.io>2022-07-28 02:25:05 +1000
commit3fa943fe2320f28fd6c7a6910f27cf9c91f41e46 (patch)
tree2d77f93ce0adb8c722ca28211cc70bff76f818d9 /modules/gdscript/language_server
parent4e9640b3ec2bea8e659607137ea87f40c2a7e498 (diff)
LSP: Sanitizes protocol URI `file:///c%3A` in file path
Fixes #63205.
Diffstat (limited to 'modules/gdscript/language_server')
-rw-r--r--modules/gdscript/language_server/gdscript_workspace.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp
index 8d484a43b3..959651c024 100644
--- a/modules/gdscript/language_server/gdscript_workspace.cpp
+++ b/modules/gdscript/language_server/gdscript_workspace.cpp
@@ -499,7 +499,9 @@ Error GDScriptWorkspace::parse_local_script(const String &p_path) {
String GDScriptWorkspace::get_file_path(const String &p_uri) const {
String path = p_uri;
- path = path.replace(root_uri + "/", "res://");
+ path = path.replace("///", "//");
+ path = path.replace("%3A", ":");
+ path = path.replacen(root_uri + "/", "res://");
path = path.uri_decode();
return path;
}