Also port hte previous fix to cscript.

This commit is contained in:
Relintai 2022-07-29 19:55:28 +02:00
parent 47ddf3a7c9
commit 8fb683fe5d

View File

@ -1829,6 +1829,9 @@ static void _find_enumeration_candidates(const String p_enum_hint, Map<String, S
ClassDB::get_enum_constants(class_name, enum_name, &enum_constants);
for (List<StringName>::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);
}