summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2021-09-21 16:44:46 +0300
committerGitHub <noreply@github.com>2021-09-21 16:44:46 +0300
commit26e3b3908d2ef9be41c34979afbb0da0ddb38445 (patch)
tree0c6e5f980d3c4bb590dfbadc077f6501c866dd43
parentb458feba243ab252eb70de79f86681e308923f73 (diff)
parent05331a5bb93ff33ace86e233e6fac9ed625fb083 (diff)
Merge pull request #52852 from Chaosus/gds_fix_constants
Prevent local constant default value from incorrect overriding by a global constant in GDScript autocompletion
-rw-r--r--modules/gdscript/gdscript_editor.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index f79e5726ce..2f8a054b2a 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -781,6 +781,9 @@ static void _find_identifiers_in_class(const GDScriptParser::ClassNode *p_class,
if (p_only_functions) {
continue;
}
+ if (r_result.has(member.constant->identifier->name)) {
+ continue;
+ }
option = ScriptCodeCompletionOption(member.constant->identifier->name, ScriptCodeCompletionOption::KIND_CONSTANT);
if (member.constant->initializer) {
option.default_value = member.constant->initializer->reduced_value;