mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Fix completion of parameters in function call (2)
This commit is contained in:
@@ -2932,13 +2932,14 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_call(ExpressionNode *p_pre
|
|||||||
// Allow for trailing comma.
|
// Allow for trailing comma.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
bool use_identifier_completion = current.cursor_place == GDScriptTokenizer::CURSOR_END || current.cursor_place == GDScriptTokenizer::CURSOR_MIDDLE;
|
||||||
ExpressionNode *argument = parse_expression(false);
|
ExpressionNode *argument = parse_expression(false);
|
||||||
if (argument == nullptr) {
|
if (argument == nullptr) {
|
||||||
push_error(R"(Expected expression as the function argument.)");
|
push_error(R"(Expected expression as the function argument.)");
|
||||||
} else {
|
} else {
|
||||||
call->arguments.push_back(argument);
|
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;
|
completion_context.type = COMPLETION_IDENTIFIER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user