Repository: godotengine/godot
File: editor/settings/editor_autoload_settings.cpp (C++)

Code before:
				info.node = old_info.node;
				if (info.node) {
					Ref<Script> scr = info.node->get_script();
					info.in_editor = scr.is_valid() && scr->is_tool();
					if (info.is_singleton == old_info.is_singleton && info.in_editor == old_info.in_editor) {
						to_remove.erase(name);
						need_to_add = false;
					} else {
						info.node = nullptr;
					}
				}
			}
		}

		autoload_cache.push_back(info);

		if (need_to_add) {
			to_add.push_back(&(autoload_cache.back()->get()));
		}

		TreeItem *item = tree->create_item(root);
		item->set_text(0, name);
		item->set_editable(0, true);

		//Set Text to show in Autoload Section
		String real_path = ResourceUID::get_singleton()->uid_to_path(scr_path);
		if (scr_path.begins_with("uid://")) {
			item->set_text(1, scr_path + " (PATH: " + real_path + ")");
		} else {
			item->set_text(1, scr_path);
		}

		item->set_selectable(1, true);

		item->set_cell_mode(2, TreeItem::CELL_MODE_CHECK);
		item->set_editable(2, true);
		item->set_text(2, TTRC("Enable"));
		item->set_checked(2, info.is_singleton);
		item->add_button(3, get_editor_theme_icon(SNAME("Load")), BUTTON_OPEN);
		item->add_button(3, get_editor_theme_icon(SNAME("MoveUp")), BUTTON_MOVE_UP);
		item->add_button(3, get_editor_theme_icon(SNAME("MoveDown")), BUTTON_MOVE_DOWN);
		item->add_button(3, get_editor_theme_icon(SNAME("Remove")), BUTTON_DELETE);
		item->set_selectable(3, false);
	}

	// Remove deleted/changed autoloads
	for (KeyValue<String, AutoloadInfo> &E : to_remove) {
		AutoloadInfo &info = E.value;
		if (info.is_singleton) {
			for (int i = 0; i < ScriptServer::get_language_count(); i++) {
				ScriptServer::get_language(i)->remove_named_global_constant(info.name);

Review comment (suggestion):
This is a static method.
```suggestion
		String real_path = ResourceUID::uid_to_path(scr_path);
```

Code after:
		autoload_cache.push_back(info);

		if (need_to_add) {
			to_add.push_back(&(autoload_cache.back()->get()));
		}

		TreeItem *item = tree->create_item(root);
		item->set_text(0, name);
		item->set_editable(0, true);

		item->set_text(1, ResourceUID::ensure_path(scr_path));
		item->set_selectable(1, true);

		item->set_cell_mode(2, TreeItem::CELL_MODE_CHECK);
		item->set_editable(2, true);
		item->set_text(2, TTRC("Enable"));
		item->set_checked(2, info.is_singleton);
		item->add_button(3, get_editor_theme_icon(SNAME("Load")), BUTTON_OPEN);
		item->add_button(3, get_editor_theme_icon(SNAME("MoveUp")), BUTTON_MOVE_UP);
		item->add_button(3, get_editor_theme_icon(SNAME("MoveDown")), BUTTON_MOVE_DOWN);
		item->add_button(3, get_editor_theme_icon(SNAME("Remove")), BUTTON_DELETE);
		item->set_selectable(3, false);
	}

	// Remove deleted/changed autoloads
	for (KeyValue<String, AutoloadInfo> &E : to_remove) {
		AutoloadInfo &info = E.value;
		if (info.is_singleton) {
			for (int i = 0; i < ScriptServer::get_language_count(); i++) {
				ScriptServer::get_language(i)->remove_named_global_constant(info.name);
			}
		}
		if (info.in_editor) {
			ERR_CONTINUE(!info.node);
			callable_mp((Node *)get_tree()->get_root(), &Node::remove_child).call_deferred(info.node);
		}

		if (info.node) {
			info.node->queue_free();
			info.node = nullptr;
		}
	}

	// Load new/changed autoloads
	List<Node *> nodes_to_add;
	for (AutoloadInfo *info : to_add) {
		info->node = _create_autoload(info->path);

		ERR_CONTINUE(!info->node);
		info->node->set_name(info->name);