diff options
Diffstat (limited to 'modules/gdscript/tests/scripts/completion')
36 files changed, 363 insertions, 0 deletions
diff --git a/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_node_path_tween.cfg b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_node_path_tween.cfg new file mode 100644 index 0000000000..a8f26d83f9 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_node_path_tween.cfg @@ -0,0 +1,11 @@ +[input] +add_node_path_literals=true +[output] +include=[ + {"insert_text": "^\"property_of_a\""}, + {"insert_text": "^\"name\""}, +] +exclude=[ + {"insert_text": "\"property_of_a\""}, + {"insert_text": "\"name\""}, +] diff --git a/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_node_path_tween.gd b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_node_path_tween.gd new file mode 100644 index 0000000000..bfdb5c7995 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_node_path_tween.gd @@ -0,0 +1,8 @@ +extends Node + +const A = preload("res://completion/class_a.notest.gd") + +func _ready() -> void: + var a := A.new() + var tween := get_tree().create_tween() + tween.tween_property(a, ➡) diff --git a/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_string_name_input_event.cfg b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_string_name_input_event.cfg new file mode 100644 index 0000000000..309fa8ed38 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_string_name_input_event.cfg @@ -0,0 +1,9 @@ +[input] +add_string_name_literals=true +[output] +include=[ + {"insert_text": "&\"test_input_action\""}, +] +exclude=[ + {"insert_text": "\"test_input_action\""}, +] diff --git a/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_string_name_input_event.gd b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_string_name_input_event.gd new file mode 100644 index 0000000000..9b325e632d --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_string_name_input_event.gd @@ -0,0 +1,3 @@ +func _input(event: InputEvent) -> void: + event.is_action_pressed(➡) + pass diff --git a/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_node_path_tween.cfg b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_node_path_tween.cfg new file mode 100644 index 0000000000..45d0ad0f3b --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_node_path_tween.cfg @@ -0,0 +1,11 @@ +[input] +add_node_path_literals=false +[output] +include=[ + {"insert_text": "\"property_of_a\""}, + {"insert_text": "\"name\""}, +] +exclude=[ + {"insert_text": "^\"property_of_a\""}, + {"insert_text": "^\"name\""}, +] diff --git a/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_node_path_tween.gd b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_node_path_tween.gd new file mode 100644 index 0000000000..bfdb5c7995 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_node_path_tween.gd @@ -0,0 +1,8 @@ +extends Node + +const A = preload("res://completion/class_a.notest.gd") + +func _ready() -> void: + var a := A.new() + var tween := get_tree().create_tween() + tween.tween_property(a, ➡) diff --git a/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_string_name_input_event.cfg b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_string_name_input_event.cfg new file mode 100644 index 0000000000..7a388d54e1 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_string_name_input_event.cfg @@ -0,0 +1,9 @@ +[input] +add_string_name_literals=false +[output] +include=[ + {"insert_text": "\"test_input_action\""}, +] +exclude=[ + {"insert_text": "&\"test_input_action\""}, +] diff --git a/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_string_name_input_event.gd b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_string_name_input_event.gd new file mode 100644 index 0000000000..9b325e632d --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_string_name_input_event.gd @@ -0,0 +1,3 @@ +func _input(event: InputEvent) -> void: + event.is_action_pressed(➡) + pass diff --git a/modules/gdscript/tests/scripts/completion/common/identifiers.cfg b/modules/gdscript/tests/scripts/completion/common/identifiers.cfg new file mode 100644 index 0000000000..871a404e3a --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/common/identifiers.cfg @@ -0,0 +1,21 @@ +scene="res://completion/get_node/get_node.tscn" +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; GDScript: class_a.notest.gd + {"display": "property_of_a"}, + {"display": "func_of_a"}, + {"display": "signal_of_a"}, + + ; GDScript: self.gd + {"display": "test_signal_1"}, + {"display": "test_signal_2"}, + {"display": "test_var_1"}, + {"display": "test_var_2"}, + {"display": "test_func_1"}, + {"display": "test_func_2"}, +] diff --git a/modules/gdscript/tests/scripts/completion/common/identifiers.gd b/modules/gdscript/tests/scripts/completion/common/identifiers.gd new file mode 100644 index 0000000000..efbafbee8e --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/common/identifiers.gd @@ -0,0 +1,16 @@ +extends "res://completion/class_a.notest.gd" + +signal test_signal_1(a) +signal test_signal_2(a: int) + +var test_var_1 +var test_var_2: int + +func test_func_1(t): + pass + +func test_func_2(t: int) -> void: + pass + +func _init(): + t➡ diff --git a/modules/gdscript/tests/scripts/completion/common/self.cfg b/modules/gdscript/tests/scripts/completion/common/self.cfg new file mode 100644 index 0000000000..871a404e3a --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/common/self.cfg @@ -0,0 +1,21 @@ +scene="res://completion/get_node/get_node.tscn" +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; GDScript: class_a.notest.gd + {"display": "property_of_a"}, + {"display": "func_of_a"}, + {"display": "signal_of_a"}, + + ; GDScript: self.gd + {"display": "test_signal_1"}, + {"display": "test_signal_2"}, + {"display": "test_var_1"}, + {"display": "test_var_2"}, + {"display": "test_func_1"}, + {"display": "test_func_2"}, +] diff --git a/modules/gdscript/tests/scripts/completion/common/self.gd b/modules/gdscript/tests/scripts/completion/common/self.gd new file mode 100644 index 0000000000..9ad2fbea51 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/common/self.gd @@ -0,0 +1,16 @@ +extends "res://completion/class_a.notest.gd" + +signal test_signal_1(a) +signal test_signal_2(a: int) + +var test_var_1 +var test_var_2: int + +func test_func_1(t): + pass + +func test_func_2(t: int) -> void: + pass + +func _init(): + self.➡ diff --git a/modules/gdscript/tests/scripts/completion/filter/organized_export.cfg b/modules/gdscript/tests/scripts/completion/filter/organized_export.cfg new file mode 100644 index 0000000000..961a9ea58d --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/filter/organized_export.cfg @@ -0,0 +1,6 @@ +[output] +exclude=[ + {"display": "Test Category"}, + {"display": "Test Group"}, + {"display": "Test Subgroup"}, +] diff --git a/modules/gdscript/tests/scripts/completion/filter/organized_export.gd b/modules/gdscript/tests/scripts/completion/filter/organized_export.gd new file mode 100644 index 0000000000..189608904c --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/filter/organized_export.gd @@ -0,0 +1,8 @@ +extends CPUParticles2D + +@export_category("Test Category") +@export_group("Test Group") +@export_subgroup("Test Subgroup") + +func _init(): + ➡ diff --git a/modules/gdscript/tests/scripts/completion/filter/usage_internal.cfg b/modules/gdscript/tests/scripts/completion/filter/usage_internal.cfg new file mode 100644 index 0000000000..8c5bff5eac --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/filter/usage_internal.cfg @@ -0,0 +1,4 @@ +[output] +exclude=[ + {"display": "messages"}, +] diff --git a/modules/gdscript/tests/scripts/completion/filter/usage_internal.gd b/modules/gdscript/tests/scripts/completion/filter/usage_internal.gd new file mode 100644 index 0000000000..484c1c0d10 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/filter/usage_internal.gd @@ -0,0 +1,3 @@ +func test(): + var trans = Translation.new() + trans.➡ diff --git a/modules/gdscript/tests/scripts/completion/types/local/interfered.cfg b/modules/gdscript/tests/scripts/completion/types/local/interfered.cfg new file mode 100644 index 0000000000..8b68d51a89 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/local/interfered.cfg @@ -0,0 +1,12 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; GDScript: class_a.notest.gd + {"display": "property_of_a"}, + {"display": "func_of_a"}, + {"display": "signal_of_a"}, +] diff --git a/modules/gdscript/tests/scripts/completion/types/local/interfered.gd b/modules/gdscript/tests/scripts/completion/types/local/interfered.gd new file mode 100644 index 0000000000..f003c366a4 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/local/interfered.gd @@ -0,0 +1,8 @@ +extends Node + +const A := preload("res://completion/class_a.notest.gd") + +func a(): + var test := A.new() + test.➡ + pass diff --git a/modules/gdscript/tests/scripts/completion/types/local/no_type.cfg b/modules/gdscript/tests/scripts/completion/types/local/no_type.cfg new file mode 100644 index 0000000000..8b68d51a89 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/local/no_type.cfg @@ -0,0 +1,12 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; GDScript: class_a.notest.gd + {"display": "property_of_a"}, + {"display": "func_of_a"}, + {"display": "signal_of_a"}, +] diff --git a/modules/gdscript/tests/scripts/completion/types/local/no_type.gd b/modules/gdscript/tests/scripts/completion/types/local/no_type.gd new file mode 100644 index 0000000000..f6b5ae3aef --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/local/no_type.gd @@ -0,0 +1,8 @@ +extends Node + +const A := preload("res://completion/class_a.notest.gd") + +func a(): + var test = A.new() + test.➡ + pass diff --git a/modules/gdscript/tests/scripts/completion/types/local/typehint.cfg b/modules/gdscript/tests/scripts/completion/types/local/typehint.cfg new file mode 100644 index 0000000000..8b68d51a89 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/local/typehint.cfg @@ -0,0 +1,12 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; GDScript: class_a.notest.gd + {"display": "property_of_a"}, + {"display": "func_of_a"}, + {"display": "signal_of_a"}, +] diff --git a/modules/gdscript/tests/scripts/completion/types/local/typehint.gd b/modules/gdscript/tests/scripts/completion/types/local/typehint.gd new file mode 100644 index 0000000000..24bcfc04fc --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/local/typehint.gd @@ -0,0 +1,8 @@ +extends Node + +const A := preload("res://completion/class_a.notest.gd") + +func a(): + var test: A + test.➡ + pass diff --git a/modules/gdscript/tests/scripts/completion/types/local/typehint_broad.cfg b/modules/gdscript/tests/scripts/completion/types/local/typehint_broad.cfg new file mode 100644 index 0000000000..8b68d51a89 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/local/typehint_broad.cfg @@ -0,0 +1,12 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; GDScript: class_a.notest.gd + {"display": "property_of_a"}, + {"display": "func_of_a"}, + {"display": "signal_of_a"}, +] diff --git a/modules/gdscript/tests/scripts/completion/types/local/typehint_broad.gd b/modules/gdscript/tests/scripts/completion/types/local/typehint_broad.gd new file mode 100644 index 0000000000..88b4812c30 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/local/typehint_broad.gd @@ -0,0 +1,8 @@ +extends Node + +const A := preload("res://completion/class_a.notest.gd") + +func a(): + var test: Node = A.new() + test.➡ + pass diff --git a/modules/gdscript/tests/scripts/completion/types/local/typehint_incompatible.cfg b/modules/gdscript/tests/scripts/completion/types/local/typehint_incompatible.cfg new file mode 100644 index 0000000000..8b68d51a89 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/local/typehint_incompatible.cfg @@ -0,0 +1,12 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; GDScript: class_a.notest.gd + {"display": "property_of_a"}, + {"display": "func_of_a"}, + {"display": "signal_of_a"}, +] diff --git a/modules/gdscript/tests/scripts/completion/types/local/typehint_incompatible.gd b/modules/gdscript/tests/scripts/completion/types/local/typehint_incompatible.gd new file mode 100644 index 0000000000..8e226546f3 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/local/typehint_incompatible.gd @@ -0,0 +1,8 @@ +extends Node + +const A := preload("res://completion/class_a.notest.gd") + +func a(): + var test: A = Node.new() + test.➡ + pass diff --git a/modules/gdscript/tests/scripts/completion/types/member/interfered.cfg b/modules/gdscript/tests/scripts/completion/types/member/interfered.cfg new file mode 100644 index 0000000000..8b68d51a89 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/member/interfered.cfg @@ -0,0 +1,12 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; GDScript: class_a.notest.gd + {"display": "property_of_a"}, + {"display": "func_of_a"}, + {"display": "signal_of_a"}, +] diff --git a/modules/gdscript/tests/scripts/completion/types/member/interfered.gd b/modules/gdscript/tests/scripts/completion/types/member/interfered.gd new file mode 100644 index 0000000000..069abd7891 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/member/interfered.gd @@ -0,0 +1,9 @@ +extends Node + +const A := preload("res://completion/class_a.notest.gd") + +var test := A.new() + +func a(): + test.➡ + pass diff --git a/modules/gdscript/tests/scripts/completion/types/member/no_type.cfg b/modules/gdscript/tests/scripts/completion/types/member/no_type.cfg new file mode 100644 index 0000000000..8b68d51a89 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/member/no_type.cfg @@ -0,0 +1,12 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; GDScript: class_a.notest.gd + {"display": "property_of_a"}, + {"display": "func_of_a"}, + {"display": "signal_of_a"}, +] diff --git a/modules/gdscript/tests/scripts/completion/types/member/no_type.gd b/modules/gdscript/tests/scripts/completion/types/member/no_type.gd new file mode 100644 index 0000000000..9bb9549e97 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/member/no_type.gd @@ -0,0 +1,9 @@ +extends Node + +const A := preload("res://completion/class_a.notest.gd") + +var test = A.new() + +func a(): + test.➡ + pass diff --git a/modules/gdscript/tests/scripts/completion/types/member/typehint.cfg b/modules/gdscript/tests/scripts/completion/types/member/typehint.cfg new file mode 100644 index 0000000000..8b68d51a89 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/member/typehint.cfg @@ -0,0 +1,12 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; GDScript: class_a.notest.gd + {"display": "property_of_a"}, + {"display": "func_of_a"}, + {"display": "signal_of_a"}, +] diff --git a/modules/gdscript/tests/scripts/completion/types/member/typehint.gd b/modules/gdscript/tests/scripts/completion/types/member/typehint.gd new file mode 100644 index 0000000000..7763a2e898 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/member/typehint.gd @@ -0,0 +1,9 @@ +extends Node + +const A := preload("res://completion/class_a.notest.gd") + +var test: A + +func a(): + test.➡ + pass diff --git a/modules/gdscript/tests/scripts/completion/types/member/typehint_broad.cfg b/modules/gdscript/tests/scripts/completion/types/member/typehint_broad.cfg new file mode 100644 index 0000000000..81401316ec --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/member/typehint_broad.cfg @@ -0,0 +1,13 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, +] +exclude=[ + ; GDScript: class_a.notest.gd + {"display": "property_of_a"}, + {"display": "func_of_a"}, + {"display": "signal_of_a"}, +] diff --git a/modules/gdscript/tests/scripts/completion/types/member/typehint_broad.gd b/modules/gdscript/tests/scripts/completion/types/member/typehint_broad.gd new file mode 100644 index 0000000000..a8506705a1 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/member/typehint_broad.gd @@ -0,0 +1,9 @@ +extends Node + +const A := preload("res://completion/class_a.notest.gd") + +var test: Node = A.new() + +func a(): + test.➡ + pass diff --git a/modules/gdscript/tests/scripts/completion/types/member/typehint_incompatible.cfg b/modules/gdscript/tests/scripts/completion/types/member/typehint_incompatible.cfg new file mode 100644 index 0000000000..8b68d51a89 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/member/typehint_incompatible.cfg @@ -0,0 +1,12 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; GDScript: class_a.notest.gd + {"display": "property_of_a"}, + {"display": "func_of_a"}, + {"display": "signal_of_a"}, +] diff --git a/modules/gdscript/tests/scripts/completion/types/member/typehint_incompatible.gd b/modules/gdscript/tests/scripts/completion/types/member/typehint_incompatible.gd new file mode 100644 index 0000000000..8b5a80cfb3 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/types/member/typehint_incompatible.gd @@ -0,0 +1,9 @@ +extends Node + +const A := preload("res://completion/class_a.notest.gd") + +var test: A = Node.new() + +func a(): + test.➡ + pass |