diff --git a/modules/gdscript/tests/scripts/completion/class_a.notest.gd b/modules/gdscript/tests/scripts/completion/class_a.notest.gd new file mode 100644 index 000000000000..47c64dc674a4 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/class_a.notest.gd @@ -0,0 +1,8 @@ +extends Node + +signal signal_of_a + +var property_of_a + +func func_of_a(): + pass diff --git a/modules/gdscript/tests/scripts/completion/get_node/get_node.tscn b/modules/gdscript/tests/scripts/completion/get_node/get_node.tscn new file mode 100644 index 000000000000..35ac66694171 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/get_node.tscn @@ -0,0 +1,19 @@ +[gd_scene load_steps=2 format=3 uid="uid://c8wekfd5ql7bc"] + +[ext_resource type="Script" path="res://completion/class_a.notest.gd" id="1_ldc4g"] + +[node name="GetNode" type="Node"] + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] + +[node name="UniqueNames" type="Node" parent="."] + +[node name="UniqueAnimationPlayer" type="AnimationPlayer" parent="UniqueNames"] +unique_name_in_owner = true + +[node name="UniqueA" type="Node" parent="UniqueNames"] +unique_name_in_owner = true +script = ExtResource("1_ldc4g") + +[node name="A" type="Node" parent="."] +script = ExtResource("1_ldc4g") diff --git a/modules/gdscript/tests/scripts/completion/get_node/get_node_member_annotated.cfg b/modules/gdscript/tests/scripts/completion/get_node/get_node_member_annotated.cfg deleted file mode 100644 index 27e695d245ea..000000000000 --- a/modules/gdscript/tests/scripts/completion/get_node/get_node_member_annotated.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[output] -include=[ - {"display": "autoplay"}, -] diff --git a/modules/gdscript/tests/scripts/completion/get_node/literal/dollar.cfg b/modules/gdscript/tests/scripts/completion/get_node/literal/dollar.cfg new file mode 100644 index 000000000000..ae7d34d87dcd --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/literal/dollar.cfg @@ -0,0 +1,7 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/literal/dollar.gd b/modules/gdscript/tests/scripts/completion/get_node/literal/dollar.gd new file mode 100644 index 000000000000..df458a9435c3 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/literal/dollar.gd @@ -0,0 +1,4 @@ +extends Node + +func a(): + %AnimationPlayer.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/literal/percent.cfg b/modules/gdscript/tests/scripts/completion/get_node/literal/percent.cfg new file mode 100644 index 000000000000..ae7d34d87dcd --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/literal/percent.cfg @@ -0,0 +1,7 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/literal/percent.gd b/modules/gdscript/tests/scripts/completion/get_node/literal/percent.gd new file mode 100644 index 000000000000..7050761b866b --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/literal/percent.gd @@ -0,0 +1,4 @@ +extends Node + +func a(): + $UniqueAnimationPlayer.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_class_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_class_scene.cfg new file mode 100644 index 000000000000..009ab9f9ce6b --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_class_scene.cfg @@ -0,0 +1,14 @@ +[input] +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"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_class_scene.gd b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_class_scene.gd new file mode 100644 index 000000000000..a84283a1dea0 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_class_scene.gd @@ -0,0 +1,4 @@ +extends Node + +func a(): + $A.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_native_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_native_scene.cfg new file mode 100644 index 000000000000..0fb46a470426 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_native_scene.cfg @@ -0,0 +1,14 @@ +[input] +scene="res://completion/get_node/get_node.tscn" +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; AnimationPlayer + {"display": "autoplay"}, + {"display": "play"}, + {"display": "animation_changed"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_native_scene.gd b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_native_scene.gd new file mode 100644 index 000000000000..6e3fee1696bf --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/dollar_native_scene.gd @@ -0,0 +1,4 @@ +extends Node + +func a(): + $AnimationPlayer.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_class_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_class_scene.cfg new file mode 100644 index 000000000000..009ab9f9ce6b --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_class_scene.cfg @@ -0,0 +1,14 @@ +[input] +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"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_class_scene.gd b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_class_scene.gd new file mode 100644 index 000000000000..27f059c944e1 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_class_scene.gd @@ -0,0 +1,4 @@ +extends Node + +func a(): + %UniqueA.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_native_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_native_scene.cfg new file mode 100644 index 000000000000..0fb46a470426 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_native_scene.cfg @@ -0,0 +1,14 @@ +[input] +scene="res://completion/get_node/get_node.tscn" +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; AnimationPlayer + {"display": "autoplay"}, + {"display": "play"}, + {"display": "animation_changed"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_native_scene.gd b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_native_scene.gd new file mode 100644 index 000000000000..07068fc5a41e --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/literal_scene/percent_native_scene.gd @@ -0,0 +1,4 @@ +extends Node + +func a(): + %UniqueAnimationPlayer.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/local/local.cfg b/modules/gdscript/tests/scripts/completion/get_node/local/local.cfg new file mode 100644 index 000000000000..ae7d34d87dcd --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local/local.cfg @@ -0,0 +1,7 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/local/local.gd b/modules/gdscript/tests/scripts/completion/get_node/local/local.gd new file mode 100644 index 000000000000..596ad80ef23f --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local/local.gd @@ -0,0 +1,5 @@ +extends Node + +func a(): + var test = $AnimationPlayer + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_interfered/local_interfered.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_interfered/local_interfered.cfg new file mode 100644 index 000000000000..ae7d34d87dcd --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_interfered/local_interfered.cfg @@ -0,0 +1,7 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_interfered/local_interfered.gd b/modules/gdscript/tests/scripts/completion/get_node/local_interfered/local_interfered.gd new file mode 100644 index 000000000000..6f87af3c857d --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_interfered/local_interfered.gd @@ -0,0 +1,5 @@ +extends Node + +func a(): + var test := $AnimationPlayer + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/class_local_interfered_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/class_local_interfered_scene.cfg new file mode 100644 index 000000000000..009ab9f9ce6b --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/class_local_interfered_scene.cfg @@ -0,0 +1,14 @@ +[input] +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"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/class_local_interfered_scene.gd b/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/class_local_interfered_scene.gd new file mode 100644 index 000000000000..a710c8bbd7bd --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/class_local_interfered_scene.gd @@ -0,0 +1,5 @@ +extends Node + +func a(): + var test := $A + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/native_local_interfered_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/native_local_interfered_scene.cfg new file mode 100644 index 000000000000..0fb46a470426 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/native_local_interfered_scene.cfg @@ -0,0 +1,14 @@ +[input] +scene="res://completion/get_node/get_node.tscn" +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; AnimationPlayer + {"display": "autoplay"}, + {"display": "play"}, + {"display": "animation_changed"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/native_local_interfered_scene.gd b/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/native_local_interfered_scene.gd new file mode 100644 index 000000000000..6f87af3c857d --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_interfered_scene/native_local_interfered_scene.gd @@ -0,0 +1,5 @@ +extends Node + +func a(): + var test := $AnimationPlayer + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_scene/class_local_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_scene/class_local_scene.cfg new file mode 100644 index 000000000000..009ab9f9ce6b --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_scene/class_local_scene.cfg @@ -0,0 +1,14 @@ +[input] +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"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_scene/class_local_scene.gd b/modules/gdscript/tests/scripts/completion/get_node/local_scene/class_local_scene.gd new file mode 100644 index 000000000000..2fc88f93ddfc --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_scene/class_local_scene.gd @@ -0,0 +1,5 @@ +extends Node + +func a(): + var test = $A + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_scene/native_local_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_scene/native_local_scene.cfg new file mode 100644 index 000000000000..0fb46a470426 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_scene/native_local_scene.cfg @@ -0,0 +1,14 @@ +[input] +scene="res://completion/get_node/get_node.tscn" +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; AnimationPlayer + {"display": "autoplay"}, + {"display": "play"}, + {"display": "animation_changed"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_scene/native_local_scene.gd b/modules/gdscript/tests/scripts/completion/get_node/local_scene/native_local_scene.gd new file mode 100644 index 000000000000..596ad80ef23f --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_scene/native_local_scene.gd @@ -0,0 +1,5 @@ +extends Node + +func a(): + var test = $AnimationPlayer + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_typehint/class_local_typehint.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_typehint/class_local_typehint.cfg new file mode 100644 index 000000000000..a72b489be6c6 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint/class_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/get_node/local_typehint/class_local_typehint.gd b/modules/gdscript/tests/scripts/completion/get_node/local_typehint/class_local_typehint.gd new file mode 100644 index 000000000000..b6d2074939a6 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint/class_local_typehint.gd @@ -0,0 +1,7 @@ +extends Node + +const A := preload("res://completion/class_a.notest.gd") + +func a(): + var test: A = $A + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_typehint/native_local_typehint.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_typehint/native_local_typehint.cfg new file mode 100644 index 000000000000..adf06c870729 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint/native_local_typehint.cfg @@ -0,0 +1,12 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; AnimationPlayer + {"display": "autoplay"}, + {"display": "play"}, + {"display": "animation_changed"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_typehint/native_local_typehint.gd b/modules/gdscript/tests/scripts/completion/get_node/local_typehint/native_local_typehint.gd new file mode 100644 index 000000000000..13b541a35dee --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint/native_local_typehint.gd @@ -0,0 +1,5 @@ +extends Node + +func a(): + var test: AnimationPlayer = $AnimationPlayer + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene/class_local_typehint_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene/class_local_typehint_scene.cfg new file mode 100644 index 000000000000..9c580b711d8a --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene/class_local_typehint_scene.cfg @@ -0,0 +1,14 @@ +[input] +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"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene/class_local_typehint_scene.gd b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene/class_local_typehint_scene.gd new file mode 100644 index 000000000000..b6d2074939a6 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene/class_local_typehint_scene.gd @@ -0,0 +1,7 @@ +extends Node + +const A := preload("res://completion/class_a.notest.gd") + +func a(): + var test: A = $A + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene/native_local_typehint_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene/native_local_typehint_scene.cfg new file mode 100644 index 000000000000..446198dd3538 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene/native_local_typehint_scene.cfg @@ -0,0 +1,14 @@ +[input] +scene="res://completion/get_node/get_node.tscn" +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; AnimationPlayer + {"display": "autoplay"}, + {"display": "play"}, + {"display": "animation_changed"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene/native_local_typehint_scene.gd b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene/native_local_typehint_scene.gd new file mode 100644 index 000000000000..13b541a35dee --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene/native_local_typehint_scene.gd @@ -0,0 +1,5 @@ +extends Node + +func a(): + var test: AnimationPlayer = $AnimationPlayer + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_broad/class_local_typehint_scene_broad.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_broad/class_local_typehint_scene_broad.cfg new file mode 100644 index 000000000000..9c580b711d8a --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_broad/class_local_typehint_scene_broad.cfg @@ -0,0 +1,14 @@ +[input] +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"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_broad/class_local_typehint_scene_broad.notest.gd b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_broad/class_local_typehint_scene_broad.notest.gd new file mode 100644 index 000000000000..5c785b3ddc69 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_broad/class_local_typehint_scene_broad.notest.gd @@ -0,0 +1,6 @@ +# TODO +extends Node + +func a(): + var test: Node = $A + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_broad/native_local_typehint_scene_broad.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_broad/native_local_typehint_scene_broad.cfg new file mode 100644 index 000000000000..446198dd3538 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_broad/native_local_typehint_scene_broad.cfg @@ -0,0 +1,14 @@ +[input] +scene="res://completion/get_node/get_node.tscn" +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; AnimationPlayer + {"display": "autoplay"}, + {"display": "play"}, + {"display": "animation_changed"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_broad/native_local_typehint_scene_broad.notest.gd b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_broad/native_local_typehint_scene_broad.notest.gd new file mode 100644 index 000000000000..57f4e16e3c49 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_broad/native_local_typehint_scene_broad.notest.gd @@ -0,0 +1,6 @@ +# TODO +extends Node + +func a(): + var test: Node = $AnimationPlayer + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_incompatible/class_local_typehint_scene_incompatible.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_incompatible/class_local_typehint_scene_incompatible.cfg new file mode 100644 index 000000000000..1894e72c651c --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_incompatible/class_local_typehint_scene_incompatible.cfg @@ -0,0 +1,20 @@ +[input] +scene="res://completion/get_node/get_node.tscn" +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; Area2D + {"display": "get_overlapping_areas"}, + {"display": "linear_damp"}, + {"display": "area_entered"}, +] +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/get_node/local_typehint_scene_incompatible/class_local_typehint_scene_incompatible.gd b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_incompatible/class_local_typehint_scene_incompatible.gd new file mode 100644 index 000000000000..c6adfe0dd3f2 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_incompatible/class_local_typehint_scene_incompatible.gd @@ -0,0 +1,5 @@ +extends Node + +func a(): + var test: Area2D = $A + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_incompatible/native_local_typehint_scene_incompatible.cfg b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_incompatible/native_local_typehint_scene_incompatible.cfg new file mode 100644 index 000000000000..c8ab63f6d602 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_incompatible/native_local_typehint_scene_incompatible.cfg @@ -0,0 +1,20 @@ +[input] +scene="res://completion/get_node/get_node.tscn" +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; Area2D + {"display": "get_overlapping_areas"}, + {"display": "linear_damp"}, + {"display": "area_entered"}, +] +exclude=[ + ; AnimationPlayer + {"display": "autoplay"}, + {"display": "play"}, + {"display": "animation_changed"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_incompatible/native_local_typehint_scene_incompatible.gd b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_incompatible/native_local_typehint_scene_incompatible.gd new file mode 100644 index 000000000000..f53fce9bfef2 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/local_typehint_scene_incompatible/native_local_typehint_scene_incompatible.gd @@ -0,0 +1,5 @@ +extends Node + +func a(): + var test: Area2D = $AnimationPlayer + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/member/member.cfg b/modules/gdscript/tests/scripts/completion/get_node/member/member.cfg new file mode 100644 index 000000000000..ae7d34d87dcd --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member/member.cfg @@ -0,0 +1,7 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/member/member.gd b/modules/gdscript/tests/scripts/completion/get_node/member/member.gd new file mode 100644 index 000000000000..6bcc0a02981f --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member/member.gd @@ -0,0 +1,6 @@ +extends Node + +var test = $AnimationPlayer + +func a(): + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_interfered/member_interfered.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_interfered/member_interfered.cfg new file mode 100644 index 000000000000..ae7d34d87dcd --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_interfered/member_interfered.cfg @@ -0,0 +1,7 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_interfered/member_interfered.gd b/modules/gdscript/tests/scripts/completion/get_node/member_interfered/member_interfered.gd new file mode 100644 index 000000000000..542197e64393 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_interfered/member_interfered.gd @@ -0,0 +1,6 @@ +extends Node + +var test := $AnimationPlayer + +func a(): + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/class_member_interfered_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/class_member_interfered_scene.cfg new file mode 100644 index 000000000000..009ab9f9ce6b --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/class_member_interfered_scene.cfg @@ -0,0 +1,14 @@ +[input] +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"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/class_member_interfered_scene.gd b/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/class_member_interfered_scene.gd new file mode 100644 index 000000000000..da0b1b11d420 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/class_member_interfered_scene.gd @@ -0,0 +1,6 @@ +extends Node + +var test := $A + +func a(): + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/native_member_interfered_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/native_member_interfered_scene.cfg new file mode 100644 index 000000000000..0fb46a470426 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/native_member_interfered_scene.cfg @@ -0,0 +1,14 @@ +[input] +scene="res://completion/get_node/get_node.tscn" +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; AnimationPlayer + {"display": "autoplay"}, + {"display": "play"}, + {"display": "animation_changed"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/native_member_interfered_scene.gd b/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/native_member_interfered_scene.gd new file mode 100644 index 000000000000..542197e64393 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_interfered_scene/native_member_interfered_scene.gd @@ -0,0 +1,6 @@ +extends Node + +var test := $AnimationPlayer + +func a(): + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_scene/class_member_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_scene/class_member_scene.cfg new file mode 100644 index 000000000000..009ab9f9ce6b --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_scene/class_member_scene.cfg @@ -0,0 +1,14 @@ +[input] +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"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_scene/class_member_scene.gd b/modules/gdscript/tests/scripts/completion/get_node/member_scene/class_member_scene.gd new file mode 100644 index 000000000000..4a35661e94f4 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_scene/class_member_scene.gd @@ -0,0 +1,6 @@ +extends Node + +var test = $A + +func a(): + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_scene/native_member_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_scene/native_member_scene.cfg new file mode 100644 index 000000000000..0fb46a470426 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_scene/native_member_scene.cfg @@ -0,0 +1,14 @@ +[input] +scene="res://completion/get_node/get_node.tscn" +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; AnimationPlayer + {"display": "autoplay"}, + {"display": "play"}, + {"display": "animation_changed"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_scene/native_member_scene.gd b/modules/gdscript/tests/scripts/completion/get_node/member_scene/native_member_scene.gd new file mode 100644 index 000000000000..6bcc0a02981f --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_scene/native_member_scene.gd @@ -0,0 +1,6 @@ +extends Node + +var test = $AnimationPlayer + +func a(): + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_typehint/class_member_typehint.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_typehint/class_member_typehint.cfg new file mode 100644 index 000000000000..a72b489be6c6 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint/class_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/get_node/member_typehint/class_member_typehint.gd b/modules/gdscript/tests/scripts/completion/get_node/member_typehint/class_member_typehint.gd new file mode 100644 index 000000000000..e4edc3a4e487 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint/class_member_typehint.gd @@ -0,0 +1,8 @@ +extends Node + +const A := preload("res://completion/class_a.notest.gd") + +var test: A = $A + +func a(): + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_typehint/native_member_typehint.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_typehint/native_member_typehint.cfg new file mode 100644 index 000000000000..adf06c870729 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint/native_member_typehint.cfg @@ -0,0 +1,12 @@ +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; AnimationPlayer + {"display": "autoplay"}, + {"display": "play"}, + {"display": "animation_changed"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/get_node_member_annotated.gd b/modules/gdscript/tests/scripts/completion/get_node/member_typehint/native_member_typehint.gd similarity index 82% rename from modules/gdscript/tests/scripts/completion/get_node/get_node_member_annotated.gd rename to modules/gdscript/tests/scripts/completion/get_node/member_typehint/native_member_typehint.gd index d41bbb970c33..eda94ae34d26 100644 --- a/modules/gdscript/tests/scripts/completion/get_node/get_node_member_annotated.gd +++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint/native_member_typehint.gd @@ -2,5 +2,5 @@ extends Node var test: AnimationPlayer = $AnimationPlayer -func _ready(): +func a(): test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene/class_member_typehint_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene/class_member_typehint_scene.cfg new file mode 100644 index 000000000000..9c580b711d8a --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene/class_member_typehint_scene.cfg @@ -0,0 +1,14 @@ +[input] +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"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene/class_member_typehint_scene.gd b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene/class_member_typehint_scene.gd new file mode 100644 index 000000000000..8f68f5407211 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene/class_member_typehint_scene.gd @@ -0,0 +1,8 @@ +extends Node + +const A := preload("res://completion/class_a.notest.gd") + +@onready var test: A = $A + +func a(): + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene/native_member_typehint_scene.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene/native_member_typehint_scene.cfg new file mode 100644 index 000000000000..446198dd3538 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene/native_member_typehint_scene.cfg @@ -0,0 +1,14 @@ +[input] +scene="res://completion/get_node/get_node.tscn" +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; AnimationPlayer + {"display": "autoplay"}, + {"display": "play"}, + {"display": "animation_changed"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene/native_member_typehint_scene.gd b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene/native_member_typehint_scene.gd new file mode 100644 index 000000000000..eda94ae34d26 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene/native_member_typehint_scene.gd @@ -0,0 +1,6 @@ +extends Node + +var test: AnimationPlayer = $AnimationPlayer + +func a(): + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_broad/class_member_typehint_scene_broad.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_broad/class_member_typehint_scene_broad.cfg new file mode 100644 index 000000000000..502038bef7a5 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_broad/class_member_typehint_scene_broad.cfg @@ -0,0 +1,16 @@ +[input] +scene="res://completion/get_node/get_node.tscn" +[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/get_node/member_typehint_scene_broad/class_member_typehint_scene_broad.gd b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_broad/class_member_typehint_scene_broad.gd new file mode 100644 index 000000000000..7b0ed4ecd854 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_broad/class_member_typehint_scene_broad.gd @@ -0,0 +1,6 @@ +extends Node + +var test: Node = $A + +func a(): + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_broad/native_member_typehint_scene_broad.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_broad/native_member_typehint_scene_broad.cfg new file mode 100644 index 000000000000..1810e9fe5f55 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_broad/native_member_typehint_scene_broad.cfg @@ -0,0 +1,16 @@ +[input] +scene="res://completion/get_node/get_node.tscn" +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + +] +exclude=[ + ; AnimationPlayer + {"display": "autoplay"}, + {"display": "play"}, + {"display": "animation_changed"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_broad/native_member_typehint_scene_broad.gd b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_broad/native_member_typehint_scene_broad.gd new file mode 100644 index 000000000000..87342f9a21a4 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_broad/native_member_typehint_scene_broad.gd @@ -0,0 +1,6 @@ +extends Node + +var test: Node = $AnimationPlayer + +func a(): + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_incompatible/class_member_typehint_scene_incompatible.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_incompatible/class_member_typehint_scene_incompatible.cfg new file mode 100644 index 000000000000..1894e72c651c --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_incompatible/class_member_typehint_scene_incompatible.cfg @@ -0,0 +1,20 @@ +[input] +scene="res://completion/get_node/get_node.tscn" +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; Area2D + {"display": "get_overlapping_areas"}, + {"display": "linear_damp"}, + {"display": "area_entered"}, +] +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/get_node/member_typehint_scene_incompatible/class_member_typehint_scene_incompatible.gd b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_incompatible/class_member_typehint_scene_incompatible.gd new file mode 100644 index 000000000000..5f78bcdf04f2 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_incompatible/class_member_typehint_scene_incompatible.gd @@ -0,0 +1,6 @@ +extends Node + +var test: Area2D = $A + +func a(): + test.➡ diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_incompatible/native_member_typehint_scene_incompatible.cfg b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_incompatible/native_member_typehint_scene_incompatible.cfg new file mode 100644 index 000000000000..c8ab63f6d602 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_incompatible/native_member_typehint_scene_incompatible.cfg @@ -0,0 +1,20 @@ +[input] +scene="res://completion/get_node/get_node.tscn" +[output] +include=[ + ; Node + {"display": "add_child"}, + {"display": "owner"}, + {"display": "child_entered_tree"}, + + ; Area2D + {"display": "get_overlapping_areas"}, + {"display": "linear_damp"}, + {"display": "area_entered"}, +] +exclude=[ + ; AnimationPlayer + {"display": "autoplay"}, + {"display": "play"}, + {"display": "animation_changed"}, +] diff --git a/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_incompatible/native_member_typehint_scene_incompatible.gd b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_incompatible/native_member_typehint_scene_incompatible.gd new file mode 100644 index 000000000000..c14df5cd1b92 --- /dev/null +++ b/modules/gdscript/tests/scripts/completion/get_node/member_typehint_scene_incompatible/native_member_typehint_scene_incompatible.gd @@ -0,0 +1,6 @@ +extends Node + +var test: Area2D = $AnimationPlayer + +func a(): + test.➡ diff --git a/modules/gdscript/tests/test_completion.h b/modules/gdscript/tests/test_completion.h index fd6b5321e6d9..ac9ffcd9153b 100644 --- a/modules/gdscript/tests/test_completion.h +++ b/modules/gdscript/tests/test_completion.h @@ -139,7 +139,7 @@ static void test_directory(const String &p_dir) { Node *owner = nullptr; if (conf.has_section_key("input", "scene")) { - Ref scene = ResourceLoader::load(conf.get_value("input", "scene"), "PackedScene"); + Ref scene = ResourceLoader::load(conf.get_value("input", "scene"), "PackedScene", ResourceFormatLoader::CACHE_MODE_IGNORE_DEEP); if (scene.is_valid()) { owner = scene->instantiate(); }