Merge pull request #96375 from HolonProduction/completion-callable-braces

Autocompletion: Don't add parenthesis if `Callable` is expected
This commit is contained in:
Thaddeus Crews
2025-04-10 16:53:45 -05:00
16 changed files with 260 additions and 89 deletions
@@ -0,0 +1,8 @@
[output]
include=[
{"display": "hello_world", "insert_text": "hello_world"},
]
exclude=[
{"insert_text": "hello_world()"},
{"insert_text": "hello_world("},
]
@@ -0,0 +1,8 @@
signal test
func _init() -> void:
test.connect(h)
pass
func hello_world():
pass
@@ -0,0 +1,8 @@
[output]
include=[
{"display": "hello_world", "insert_text": "hello_world"},
]
exclude=[
{"insert_text": "hello_world()"},
{"insert_text": "hello_world("},
]
@@ -0,0 +1,8 @@
var arr: Array
func _init() -> void:
arr.sort_custom(h
pass
func hello_world():
pass
@@ -0,0 +1,8 @@
[output]
include=[
{"display": "hello_world", "insert_text": "hello_world"},
]
exclude=[
{"insert_text": "hello_world()"},
{"insert_text": "hello_world("},
]
@@ -0,0 +1,9 @@
func test(a: Callable, b):
pass
func _init() -> void:
test(h)
pass
func hello_world():
pass
@@ -0,0 +1,8 @@
[output]
include=[
{"display": "hello_world", "insert_text": "hello_world"},
]
exclude=[
{"insert_text": "hello_world()"},
{"insert_text": "hello_world("},
]
@@ -0,0 +1,9 @@
func test(a, b: Callable):
pass
func _init() -> void:
test(hello_world(), h)
pass
func hello_world():
pass
@@ -0,0 +1,8 @@
[output]
include=[
{"display": "hello_world()", "insert_text": "hello_world()"},
]
exclude=[
{"insert_text": "hello_world"},
{"insert_text": "hello_world("},
]
@@ -0,0 +1,9 @@
func test(a, b: Callable):
pass
func _init() -> void:
test(h)
pass
func hello_world():
pass
@@ -0,0 +1,8 @@
[output]
include=[
{"display": "hello_world", "insert_text": "hello_world"},
]
exclude=[
{"display": "hello_world", "insert_text": "hello_world()"},
{"display": "hello_world", "insert_text": "hello_world("},
]
@@ -0,0 +1,8 @@
extends Node
func _init() -> void:
create_tween().tween_callback(h)
pass
func hello_world():
pass