Merge pull request #71843 from Rindbee/do-not-cache

Do not cache the doc information written by user in the script in Inspector
This commit is contained in:
Yuri Sizov 2023-05-29 17:23:48 +02:00 committed by GitHub
commit fc83a2e323
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2809,18 +2809,22 @@ void EditorInspector::update_tree() {
category->label = label; category->label = label;
if (use_doc_hints) { if (use_doc_hints) {
String descr = "";
// Sets the category tooltip to show documentation. // Sets the category tooltip to show documentation.
if (!class_descr_cache.has(doc_name)) { if (!class_descr_cache.has(doc_name)) {
String descr;
DocTools *dd = EditorHelp::get_doc_data(); DocTools *dd = EditorHelp::get_doc_data();
HashMap<String, DocData::ClassDoc>::Iterator E = dd->class_list.find(doc_name); HashMap<String, DocData::ClassDoc>::Iterator E = dd->class_list.find(doc_name);
if (E) { if (E) {
descr = DTR(E->value.brief_description); descr = DTR(E->value.brief_description);
} }
class_descr_cache[doc_name] = descr; if (ClassDB::class_exists(doc_name)) {
class_descr_cache[doc_name] = descr; // Do not cache the class description of scripts.
}
} else {
descr = class_descr_cache[doc_name];
} }
category->set_tooltip_text(p.name + "::" + (class_descr_cache[doc_name].is_empty() ? "" : class_descr_cache[doc_name])); category->set_tooltip_text(p.name + "::" + descr);
} }
// Add editors at the start of a category. // Add editors at the start of a category.
@ -3213,7 +3217,9 @@ void EditorInspector::update_tree() {
} }
} }
doc_info_cache[classname][propname] = doc_info; if (ClassDB::class_exists(classname)) {
doc_info_cache[classname][propname] = doc_info; // Do not cache the doc information of scripts.
}
} }
} }