@@ -443,23 +443,26 @@ bool GDScriptParser::refactor_rename_register(GDScriptParser::RefactorRenameType
443443 context.current_line = tokenizer->get_cursor_line ();
444444 context.parser = this ;
445445 context.node = p_node;
446- context.identifier = nullptr ;
446+ context.value = nullptr ;
447447 if (previous.has_cursor ()) {
448448 context.token = previous;
449449 }
450450 refactor_rename_context = context;
451451 return true ;
452452}
453453
454- bool GDScriptParser::refactor_rename_register_identifier (GDScriptParser::IdentifierNode *p_identifier ) {
454+ bool GDScriptParser::refactor_rename_register_value (GDScriptParser::Node *p_value_node ) {
455455 if (!is_for_refactor_rename ()) {
456456 return false ;
457457 }
458458 if (!previous.has_cursor ()) {
459459 return false ;
460460 }
461461 ERR_FAIL_NULL_V (refactor_rename_context.node , false );
462- refactor_rename_context.identifier = p_identifier;
462+ refactor_rename_context.value = p_value_node;
463+ if (previous.has_cursor ()) {
464+ refactor_rename_context.token = previous;
465+ }
463466 return true ;
464467}
465468
@@ -2855,7 +2858,7 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_identifier(ExpressionNode
28552858 ERR_FAIL_V_MSG (nullptr , " Parser bug: parsing identifier node without identifier token." );
28562859 }
28572860 IdentifierNode *identifier = alloc_node<IdentifierNode>();
2858- refactor_rename_register_identifier (identifier);
2861+ refactor_rename_register_value (identifier);
28592862 complete_extents (identifier);
28602863
28612864 identifier->name = previous.get_identifier ();
@@ -2913,7 +2916,7 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_literal(ExpressionNode *p_
29132916 }
29142917
29152918 LiteralNode *literal = alloc_node<LiteralNode>();
2916- refactor_rename_register (REFACTOR_RENAME_TYPE_LITERAL, literal);
2919+ refactor_rename_register_value ( literal);
29172920 literal->value = previous.literal ;
29182921 reset_extents (literal, p_previous_operand);
29192922 update_extents (literal);
@@ -3268,13 +3271,14 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_assignment(ExpressionNode
32683271
32693272GDScriptParser::ExpressionNode *GDScriptParser::parse_await (ExpressionNode *p_previous_operand, bool p_can_assign) {
32703273 AwaitNode *await = alloc_node<AwaitNode>();
3271- // TODO: refactor take token into account.
3274+ refactor_rename_register (REFACTOR_RENAME_TYPE_KEYWORD, await);
32723275 ExpressionNode *element = parse_precedence (PREC_AWAIT, false );
32733276 if (element == nullptr ) {
32743277 push_error (R"( Expected signal or coroutine after "await".)" );
32753278 }
32763279 await->to_await = element;
32773280 complete_extents (await);
3281+ refactor_rename_register (REFACTOR_RENAME_TYPE_KEYWORD, await);
32783282
32793283 if (current_function) { // Might be null in a getter or setter.
32803284 current_function->is_coroutine = true ;
0 commit comments