summaryrefslogtreecommitdiffstats
path: root/editor/editor_help.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-04-28 17:08:05 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-04-28 17:08:05 +0200
commit012e2b741152e14bbe70297779b8029278690301 (patch)
tree00f7189ba7810646479ceeb42e46db23542bf8ba /editor/editor_help.cpp
parent1becfea37cd66ad0f13ba5770e5d5627b3fed23f (diff)
parent6f8113721d1025feb720bbcb163fb497c8b99972 (diff)
downloadredot-engine-012e2b741152e14bbe70297779b8029278690301.tar.gz
Merge pull request #76539 from anvilfolk/gddocsreg
Fix wrongly removing prefix when generating in-editor documentation
Diffstat (limited to 'editor/editor_help.cpp')
-rw-r--r--editor/editor_help.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 76a3f58702..dd2ee8c4ce 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -115,7 +115,13 @@ static String _contextualize_class_specifier(const String &p_class_specifier, co
return p_class_specifier.substr(rfind + 1);
}
- // Remove prefix
+ // They share a _name_ prefix but not a _class specifier_ prefix, e.g. Tree & TreeItem
+ // begins_with + lengths being different implies p_class_specifier.length() > p_edited_class.length() so this is safe
+ if (p_class_specifier[p_edited_class.length()] != '.') {
+ return p_class_specifier;
+ }
+
+ // Remove class specifier prefix
return p_class_specifier.substr(p_edited_class.length() + 1);
}