1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Autocompletion: Push empty call for lambdas

This commit is contained in:
HolonProduction
2025-07-25 20:26:26 +02:00
parent 0dd9178269
commit 926cab9027
5 changed files with 28 additions and 0 deletions

View File

@@ -3618,6 +3618,8 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_lambda(ExpressionNode *p_p
bool multiline_context = multiline_stack.back()->get();
push_completion_call(nullptr);
// Reset the multiline stack since we don't want the multiline mode one in the lambda body.
push_multiline(false);
if (multiline_context) {
@@ -3665,6 +3667,8 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_lambda(ExpressionNode *p_p
pop_multiline();
pop_completion_call();
if (multiline_context) {
// If we're in multiline mode, we want to skip the spurious DEDENT and NEWLINE tokens.
while (check(GDScriptTokenizer::Token::DEDENT) || check(GDScriptTokenizer::Token::INDENT) || check(GDScriptTokenizer::Token::NEWLINE)) {