Skip to content

Commit

Permalink
fix: modifies workspace->root_uri so that p_uri is symmetrical to oth…
Browse files Browse the repository at this point in the history
…er operating systems. godotengine#63388
  • Loading branch information
A-Lamia committed Aug 8, 2022
1 parent c8cdc10 commit 42a16ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 1 addition & 3 deletions modules/gdscript/language_server/gdscript_workspace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 42a16ef

Please sign in to comment.