mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 07:53:26 +00:00
Merge pull request #104509 from HolonProduction/completion-super-method
GDScript: Return early when parsing invalid super call
This commit is contained in:
commit
c687e4f692
5 changed files with 29 additions and 1 deletions
|
@ -3301,7 +3301,11 @@ GDScriptParser::ExpressionNode *GDScriptParser::parse_call(ExpressionNode *p_pre
|
|||
IdentifierNode *identifier = parse_identifier();
|
||||
call->callee = identifier;
|
||||
call->function_name = identifier->name;
|
||||
consume(GDScriptTokenizer::Token::PARENTHESIS_OPEN, R"(Expected "(" after function name.)");
|
||||
if (!consume(GDScriptTokenizer::Token::PARENTHESIS_OPEN, R"(Expected "(" after function name.)")) {
|
||||
pop_multiline();
|
||||
complete_extents(call);
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
call->callee = p_previous_operand;
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
[output]
|
||||
include=[
|
||||
; GDScript: class_a.notest.gd
|
||||
{"display": "func_of_a()"},
|
||||
]
|
|
@ -0,0 +1,7 @@
|
|||
extends "res://completion/class_a.notest.gd"
|
||||
|
||||
func test():
|
||||
super.➡
|
||||
|
||||
if true:
|
||||
pass
|
|
@ -0,0 +1,5 @@
|
|||
[output]
|
||||
include=[
|
||||
; GDScript: class_a.notest.gd
|
||||
{"display": "func_of_a()"},
|
||||
]
|
|
@ -0,0 +1,7 @@
|
|||
extends "res://completion/class_a.notest.gd"
|
||||
|
||||
func test():
|
||||
super.f➡
|
||||
|
||||
if true:
|
||||
pass
|
Loading…
Add table
Add a link
Reference in a new issue