diff options
author | poohcom1 <pooh677@gmail.com> | 2023-01-16 00:25:24 +0700 |
---|---|---|
committer | poohcom1 <pooh677@gmail.com> | 2023-01-16 00:25:24 +0700 |
commit | aa4bceff3edc766f94cbadaca8ff6adfbf52735d (patch) | |
tree | dab96ff482d4301c71ea74425d237d2a94b91586 /modules/gdscript | |
parent | bc5d67c61345758741fe087c6b5282402b0b2465 (diff) |
Add identifier completion for custom classes.
Previously, custom class would only auto-complete for types in GDScript.
This applies it to identifiers as well.
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript_editor.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 79387d1bf6..f6c1821288 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -1271,6 +1271,14 @@ static void _find_identifiers(const GDScriptParser::CompletionContext &p_context } r_result.insert(option.display, option); } + + // Global classes + List<StringName> global_classes; + ScriptServer::get_global_class_list(&global_classes); + for (const StringName &E : global_classes) { + ScriptLanguage::CodeCompletionOption option(E, ScriptLanguage::CODE_COMPLETION_KIND_CLASS, ScriptLanguage::LOCATION_OTHER_USER_CODE); + r_result.insert(option.display, option); + } } static GDScriptCompletionIdentifier _type_from_variant(const Variant &p_value) { |