summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-07-18 16:13:29 +0200
committerGitHub <noreply@github.com>2022-07-18 16:13:29 +0200
commitd2df09d02b13cb9c6cc74e8c40d85c6c39fcdef2 (patch)
treee3034b501c85f7b44583abc5e458bcc6fbc35f8d
parent58c1391e733fdaf8f858c319eabfe90a07efab71 (diff)
parente9a5beeb01fe246b555ccf4b6ff0d90684cdddef (diff)
Merge pull request #63037 from cdemirer/fix-non-global-autoload-code-completion-crash
-rw-r--r--modules/gdscript/gdscript_editor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index 0a1e1a22fb..90dcfa307e 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -2004,8 +2004,8 @@ static bool _guess_identifier_type(GDScriptParser::CompletionContext &p_context,
return false;
}
- // Check autoloads.
- if (ProjectSettings::get_singleton()->has_autoload(p_identifier)) {
+ // Check global variables (including autoloads).
+ if (GDScriptLanguage::get_singleton()->get_named_globals_map().has(p_identifier)) {
r_type = _type_from_variant(GDScriptLanguage::get_singleton()->get_named_globals_map()[p_identifier]);
return true;
}