You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-15 13:51:40 +00:00
LSP: Improve handling of file URI scheme
Fixes #63205. (cherry picked from commits3fa943fe23,42a16ef76eand2ff69d6181) (cherry picked from commita412922c2b)
This commit is contained in:
@@ -183,7 +183,9 @@ Dictionary GDScriptLanguageProtocol::initialize(const Dictionary &p_params) {
|
|||||||
if (root_uri.length() && is_same_workspace) {
|
if (root_uri.length() && is_same_workspace) {
|
||||||
workspace->root_uri = root_uri;
|
workspace->root_uri = root_uri;
|
||||||
} else {
|
} else {
|
||||||
workspace->root_uri = "file://" + workspace->root;
|
String r_root = workspace->root;
|
||||||
|
r_root = r_root.lstrip("/");
|
||||||
|
workspace->root_uri = "file:///" + r_root;
|
||||||
|
|
||||||
Dictionary params;
|
Dictionary params;
|
||||||
params["path"] = workspace->root;
|
params["path"] = workspace->root;
|
||||||
|
|||||||
@@ -496,9 +496,9 @@ Error GDScriptWorkspace::parse_local_script(const String &p_path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String GDScriptWorkspace::get_file_path(const String &p_uri) const {
|
String GDScriptWorkspace::get_file_path(const String &p_uri) const {
|
||||||
String path = p_uri;
|
String path = p_uri.http_unescape();
|
||||||
path = path.replace(root_uri + "/", "res://");
|
String base_uri = root_uri.http_unescape();
|
||||||
path = path.http_unescape();
|
path = path.replacen(base_uri + "/", "res://");
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user