Repository: godotengine/godot
File: editor/gui/editor_quick_open_dialog.cpp (C++)

Code before:
	success = true;
	return candidate;
}

QuickOpenResultCandidate QuickOpenResultCandidate::from_result(const FuzzySearchResult &p_result, bool &success) {
	ResourceUID::ID uid = EditorFileSystem::get_singleton()->get_file_uid(p_result.target);

	QuickOpenResultCandidate candidate = from_uid(uid, success);
	if (!success) {
		return QuickOpenResultCandidate();
	}

	candidate.result = &p_result;
	return candidate;
}

void QuickOpenResultContainer::_add_candidate(QuickOpenResultCandidate &p_candidate) {
	ERR_FAIL_COND(!ResourceUID::get_singleton()->has_id(p_candidate.uid));

	StringName actual_type;
	{
		StringName *actual_type_ptr = filetypes.getptr(p_candidate.uid);
		if (actual_type_ptr) {
			actual_type = *actual_type_ptr;
		} else {
			ERR_PRINT(vformat("EditorQuickOpenDialog: No type for uid %s.", ResourceUID::get_singleton()->id_to_text(p_candidate.uid)));
		}
	}

	String file_path = ResourceUID::get_singleton()->get_id_path(p_candidate.uid);
	EditorResourcePreview::PreviewItem item = EditorResourcePreview::get_singleton()->get_resource_preview_if_available(file_path);
	if (item.preview.is_valid()) {
		p_candidate.thumbnail = item.preview;
	} else if (file_type_icons.has(actual_type)) {
		p_candidate.thumbnail = *file_type_icons.getptr(actual_type);
	} else if (has_theme_icon(actual_type, EditorStringName(EditorIcons))) {
		p_candidate.thumbnail = get_editor_theme_icon(actual_type);
		file_type_icons.insert(actual_type, p_candidate.thumbnail);
	} else {
		p_candidate.thumbnail = *file_type_icons.getptr(SNAME("__default_icon"));
	}

	candidates.push_back(p_candidate);
	candidates_uids.insert(p_candidate.uid);
}

void QuickOpenResultContainer::update_results() {
	candidates.clear();
	candidates_uids.clear();

	if (query.is_empty()) {

Review comment (suggestion):
UIDs should be used only internally whenever possible, it's not useful to show one in an error message.

```suggestion
			ERR_PRINT(vformat("EditorQuickOpenDialog: No type for path %s.", ResourceUID::get_singleton()->get_id_path(p_candidate.uid)));
```

Code after:
	StringName actual_type;
	{
		StringName *actual_type_ptr = filetypes.getptr(p_candidate.uid);
		if (actual_type_ptr) {
			actual_type = *actual_type_ptr;
		} else {
			ERR_PRINT(vformat("EditorQuickOpenDialog: No type for path %s.", ResourceUID::get_singleton()->get_id_path(p_candidate.uid)));
		}
	}

	String file_path = ResourceUID::get_singleton()->get_id_path(p_candidate.uid);
	EditorResourcePreview::PreviewItem item = EditorResourcePreview::get_singleton()->get_resource_preview_if_available(file_path);
	if (item.preview.is_valid()) {
		p_candidate.thumbnail = item.preview;
	} else if (file_type_icons.has(actual_type)) {
		p_candidate.thumbnail = *file_type_icons.getptr(actual_type);
	} else if (has_theme_icon(actual_type, EditorStringName(EditorIcons))) {
		p_candidate.thumbnail = get_editor_theme_icon(actual_type);
		file_type_icons.insert(actual_type, p_candidate.thumbnail);
	} else {
		p_candidate.thumbnail = *file_type_icons.getptr(SNAME("__default_icon"));
	}

	candidates.push_back(p_candidate);
	candidates_uids.insert(p_candidate.uid);
}

void QuickOpenResultContainer::update_results() {
	candidates.clear();
	candidates_uids.clear();

	if (query.is_empty()) {
		_use_default_candidates();
	} else {
		_score_and_sort_candidates();
	}

	_update_result_items(MIN(candidates.size(), max_total_results), 0);
}

void QuickOpenResultContainer::_use_default_candidates() {
	HashSet<ResourceUID::ID> existing_uids;

	Vector<ResourceUID::ID> *history = _get_history();
	if (history) {
		for (const ResourceUID::ID &uid : *history) {
			bool success;
			QuickOpenResultCandidate candidate = QuickOpenResultCandidate::from_uid(uid, success);
			if (!success) {
				continue;
			}