mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +00:00
Autocompletion: enable string literal completion in subscripts
This commit is contained in:
parent
db76de5de8
commit
c824403853
19 changed files with 181 additions and 0 deletions
|
|
@ -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 "[".)");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue