Merge pull request #62731 from akien-mga/Janglee123-autocompletion-underscore

This commit is contained in:
Rémi Verschelde 2022-07-05 13:31:43 +02:00 committed by GitHub
commit 32ef964b0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -1838,6 +1838,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);
}