summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-30 09:58:30 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-30 09:58:30 +0200
commit4c73e8ba1a4c0533056c04e709611a67c0edf16a (patch)
treeeb0a90ad91a0c6b69d38e15ce8058aa55071e29c /editor
parent7a0500d9a3fbabf553bd26e5f36fae4f908a62b4 (diff)
parentdc3990fea45b9c90f5e18cf05347f09204e16a5f (diff)
Merge pull request #66632 from RedMser/script-override-gutter-docs-fix
Fix wrong docs opening in script override gutter
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/script_text_editor.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp
index e3459775ff..c21b4356f8 100644
--- a/editor/plugins/script_text_editor.cpp
+++ b/editor/plugins/script_text_editor.cpp
@@ -1056,14 +1056,22 @@ void ScriptTextEditor::_update_connected_methods() {
inherited_script = inherited_script->get_base_script();
}
- if (found_base_class.is_empty() && base_class) {
- List<MethodInfo> methods;
- ClassDB::get_method_list(base_class, &methods);
- for (int j = 0; j < methods.size(); j++) {
- if (methods[j].name == name) {
- found_base_class = "builtin:" + base_class;
+ if (found_base_class.is_empty()) {
+ while (base_class) {
+ List<MethodInfo> methods;
+ ClassDB::get_method_list(base_class, &methods, true);
+ for (int j = 0; j < methods.size(); j++) {
+ if (methods[j].name == name) {
+ found_base_class = "builtin:" + base_class;
+ break;
+ }
+ }
+
+ ClassDB::ClassInfo *base_class_ptr = ClassDB::classes.getptr(base_class)->inherits_ptr;
+ if (base_class_ptr == nullptr) {
break;
}
+ base_class = base_class_ptr->name;
}
}