Merge pull request #66759 from Chaosus/gds_fix_param_completion

This commit is contained in:
Yuri Rubinsky 2022-10-03 17:44:20 +03:00 committed by GitHub
commit 321251a133
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -2932,13 +2932,14 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_call(ExpressionNode *p_pre
// Allow for trailing comma.
break;
}
bool use_identifier_completion = current.cursor_place == GDScriptTokenizer::CURSOR_END || current.cursor_place == GDScriptTokenizer::CURSOR_MIDDLE;
ExpressionNode *argument = parse_expression(false);
if (argument == nullptr) {
push_error(R"(Expected expression as the function argument.)");
} else {
call->arguments.push_back(argument);
if (argument->type == Node::IDENTIFIER && current.cursor_place == GDScriptTokenizer::CURSOR_BEGINNING) {
if (argument->type == Node::IDENTIFIER && use_identifier_completion) {
completion_context.type = COMPLETION_IDENTIFIER;
}
}