diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-08-27 16:55:31 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-08-27 16:55:31 +0200 |
commit | 3eba191c9efd121ad123b9348bd593db3bf4fc2e (patch) | |
tree | 1c556be0e39ffcb1f9156a7c986d1408ffa3edf3 /modules/gdscript/gdscript_parser.cpp | |
parent | 610a88789389a675972923cd26e09cce86403e16 (diff) | |
parent | c82440385374ac222fcebaa5cd89258528bc5a45 (diff) | |
download | redot-engine-3eba191c9efd121ad123b9348bd593db3bf4fc2e.tar.gz |
Merge pull request #96160 from HolonProduction/dict-fix
Autocompletion: Enable string literal completion in subscripts
Diffstat (limited to 'modules/gdscript/gdscript_parser.cpp')
-rw-r--r-- | modules/gdscript/gdscript_parser.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index ecef852b4b..6e32733faa 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -3122,6 +3122,12 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_subscript(ExpressionNode * subscript->base = p_previous_operand; subscript->index = parse_expression(false); +#ifdef TOOLS_ENABLED + if (subscript->index != nullptr && subscript->index->type == Node::LITERAL) { + override_completion_context(subscript->index, COMPLETION_SUBSCRIPT, subscript); + } +#endif + if (subscript->index == nullptr) { push_error(R"(Expected expression after "[".)"); } |