Merge pull request #64099 from A-Lamia/lsp_uri_path_fixes

This commit is contained in:
Rémi Verschelde 2022-08-08 23:04:33 +02:00 committed by GitHub
commit f8383a7c72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -184,7 +184,9 @@ Dictionary GDScriptLanguageProtocol::initialize(const Dictionary &p_params) {
if (root_uri.length() && is_same_workspace) {
workspace->root_uri = root_uri;
} 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;
params["path"] = workspace->root;

View File

@ -500,10 +500,8 @@ 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("///", "//");
path = path.replace("%3A", ":");
path = path.replacen(root_uri + "/", "res://");
path = path.uri_decode();
path = path.replacen(root_uri + "/", "res://");
return path;
}