From e0fe0c3d82fa1efbc519977ff7974c611b76dfa6 Mon Sep 17 00:00:00 2001 From: janglee Date: Thu, 30 Jan 2020 18:13:07 +0530 Subject: [PATCH] GDScript: Fix autocompletetion showing class names with an underscore Fixes #35469. (cherry picked from commit 00c6cdd7939e32ce99c17e7ad8eb4f1243266e25) --- modules/gdscript/gdscript_editor.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 4ffca497819..a3b0bbe18e0 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -1838,6 +1838,9 @@ static void _find_enumeration_candidates(const String p_enum_hint, Map::Element *E = enum_constants.front(); E; E = E->next()) { String candidate = class_name + "." + E->get(); + if (candidate[0] == '_') { // Trim leading underscore. + candidate = candidate.substr(1); + } ScriptCodeCompletionOption option(candidate, ScriptCodeCompletionOption::KIND_ENUM); r_result.insert(option.display, option); }