From 7822378293094837cbc6c8dd32d1205bc1cac289 Mon Sep 17 00:00:00 2001 From: Yuri Rubinsky Date: Sun, 2 Oct 2022 12:56:46 +0300 Subject: Fix completion of parameters in function call (2) --- modules/gdscript/gdscript_parser.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp index f1c841e9dc..980a946e23 100644 --- a/modules/gdscript/gdscript_parser.cpp +++ b/modules/gdscript/gdscript_parser.cpp @@ -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; } } -- cgit v1.2.3