Merge pull request #84706 from HolonProduction/completion-get-child
Fix autocompletion after DOLLAR token
This commit is contained in:
commit
ff018079a1
1 changed files with 4 additions and 1 deletions
|
@ -3199,6 +3199,9 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_call(ExpressionNode *p_pre
|
|||
}
|
||||
|
||||
GDScriptParser::ExpressionNode *GDScriptParser::parse_get_node(ExpressionNode *p_previous_operand, bool p_can_assign) {
|
||||
// We want code completion after a DOLLAR even if the current code is invalid.
|
||||
make_completion_context(COMPLETION_GET_NODE, nullptr, -1, true);
|
||||
|
||||
if (!current.is_node_name() && !check(GDScriptTokenizer::Token::LITERAL) && !check(GDScriptTokenizer::Token::SLASH) && !check(GDScriptTokenizer::Token::PERCENT)) {
|
||||
push_error(vformat(R"(Expected node path as string or identifier after "%s".)", previous.get_name()));
|
||||
return nullptr;
|
||||
|
@ -3254,7 +3257,7 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_get_node(ExpressionNode *p
|
|||
path_state = PATH_STATE_SLASH;
|
||||
}
|
||||
|
||||
make_completion_context(COMPLETION_GET_NODE, get_node, context_argument++);
|
||||
make_completion_context(COMPLETION_GET_NODE, get_node, context_argument++, true);
|
||||
|
||||
if (match(GDScriptTokenizer::Token::LITERAL)) {
|
||||
if (previous.literal.get_type() != Variant::STRING) {
|
||||
|
|
Loading…
Reference in a new issue