Repository: godotengine/godot (language: cpp)

Issue:
Autocompletion disappear when using `super.`
### Tested versions

- Reproducible 4.4 dev 2 and up
- Not reproducible: 4.4 dev 1

### System information

Godot v4.4.stable - Windows 10 (build 19045) - Multi-window, 2 monitors - Vulkan (Forward+) - dedicated AMD Radeon RX 580 2048SP (Advanced Micro Devices, Inc.; 31.0.21921.1000) - AMD Ryzen 5 3600 6-Core Processor (12 threads)

### Issue description

Same problem as issue #96082. When you type `super.` in a gdscript the autocompletion appears as expected, but if you type anything else the autocompletion disappear even if you type something that matches the suggestions. 

#96082 was fixed by pr #94082 in 4.4 dev 1, but pr #96326 reintroduced this bug in 4.4 dev 2.

CC @HolonProduction 

![Image](https://github.com/user-attachments/assets/2ca562f8-b6ac-4f0f-b69c-8ee8ab6eb019)

### Steps to reproduce

- Type `super.` in any gdscript
- Type any new key, the autocompletion suggestion will disappear even if you type a valid property/function.

### Minimal reproduction project (MRP)

N/A


Discussion / hints:

Fix patch:
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index a7a1c076be4b..7cc23601405d 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -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;


Test patch:
diff --git a/modules/gdscript/tests/scripts/completion/common/invalid_super_call_1.cfg b/modules/gdscript/tests/scripts/completion/common/invalid_super_call_1.cfg
new file mode 100644
index 000000000000..cd0153fb78b5
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/common/invalid_super_call_1.cfg
@@ -0,0 +1,5 @@
+[output]
+include=[
+    ; GDScript: class_a.notest.gd
+    {"display": "func_of_a()"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/common/invalid_super_call_1.gd b/modules/gdscript/tests/scripts/completion/common/invalid_super_call_1.gd
new file mode 100644
index 000000000000..443df9fb874f
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/common/invalid_super_call_1.gd
@@ -0,0 +1,7 @@
+extends "res://completion/class_a.notest.gd"
+
+func test():
+	super.➡
+
+	if true:
+		pass
diff --git a/modules/gdscript/tests/scripts/completion/common/invalid_super_call_2.cfg b/modules/gdscript/tests/scripts/completion/common/invalid_super_call_2.cfg
new file mode 100644
index 000000000000..cd0153fb78b5
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/common/invalid_super_call_2.cfg
@@ -0,0 +1,5 @@
+[output]
+include=[
+    ; GDScript: class_a.notest.gd
+    {"display": "func_of_a()"},
+]
diff --git a/modules/gdscript/tests/scripts/completion/common/invalid_super_call_2.gd b/modules/gdscript/tests/scripts/completion/common/invalid_super_call_2.gd
new file mode 100644
index 000000000000..de5c4b16d821
--- /dev/null
+++ b/modules/gdscript/tests/scripts/completion/common/invalid_super_call_2.gd
@@ -0,0 +1,7 @@
+extends "res://completion/class_a.notest.gd"
+
+func test():
+	super.f➡
+
+	if true:
+		pass