summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/tests/scripts/completion/argument_options
diff options
context:
space:
mode:
authorHolonProduction <holonproduction@gmail.com>2024-06-11 22:28:18 +0200
committerHolonProduction <holonproduction@gmail.com>2024-06-12 20:38:43 +0200
commit51f74af2ac57e23164bf3a41e50a544fd481a917 (patch)
tree6f5bc9105d6cbcfafb51ffe8bc91ed1774400d62 /modules/gdscript/tests/scripts/completion/argument_options
parent292e50e17e3f6e2509d3178a00204f964a907460 (diff)
downloadredot-engine-51f74af2ac57e23164bf3a41e50a544fd481a917.tar.gz
Autocompletion: Add support for string name option in more places
Diffstat (limited to 'modules/gdscript/tests/scripts/completion/argument_options')
-rw-r--r--modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_node_path_tween.cfg11
-rw-r--r--modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_node_path_tween.gd8
-rw-r--r--modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_string_name_input_event.cfg9
-rw-r--r--modules/gdscript/tests/scripts/completion/argument_options/string_literals/add_string_name_input_event.gd3
-rw-r--r--modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_node_path_tween.cfg11
-rw-r--r--modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_node_path_tween.gd8
-rw-r--r--modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_string_name_input_event.cfg9
-rw-r--r--modules/gdscript/tests/scripts/completion/argument_options/string_literals/dont_add_string_name_input_event.gd3
8 files changed, 62 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