diff options
author | Yuri Roubinsky <chaosus89@gmail.com> | 2021-09-21 16:44:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-21 16:44:46 +0300 |
commit | 26e3b3908d2ef9be41c34979afbb0da0ddb38445 (patch) | |
tree | 0c6e5f980d3c4bb590dfbadc077f6501c866dd43 | |
parent | b458feba243ab252eb70de79f86681e308923f73 (diff) | |
parent | 05331a5bb93ff33ace86e233e6fac9ed625fb083 (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.cpp | 3 |
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; |