Skip to content

Commit

Permalink
Add more autocompletion tests
Browse files Browse the repository at this point in the history
  • Loading branch information
HolonProduction authored and MewPurPur committed Jun 29, 2024
1 parent 75be1d3 commit 3091354
Show file tree
Hide file tree
Showing 28 changed files with 301 additions and 0 deletions.
21 changes: 21 additions & 0 deletions modules/gdscript/tests/scripts/completion/common/identifiers.cfg
Original file line number Diff line number Diff line change
@@ -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"},
]
16 changes: 16 additions & 0 deletions modules/gdscript/tests/scripts/completion/common/identifiers.gd
Original file line number Diff line number Diff line change
@@ -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
21 changes: 21 additions & 0 deletions modules/gdscript/tests/scripts/completion/common/self.cfg
Original file line number Diff line number Diff line change
@@ -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"},
]
16 changes: 16 additions & 0 deletions modules/gdscript/tests/scripts/completion/common/self.gd
Original file line number Diff line number Diff line change
@@ -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.➡
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[output]
exclude=[
{"display": "Test Category"},
{"display": "Test Group"},
{"display": "Test Subgroup"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends CPUParticles2D

@export_category("Test Category")
@export_group("Test Group")
@export_subgroup("Test Subgroup")

func _init():
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[output]
exclude=[
{"display": "messages"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
func test():
var trans = Translation.new()
trans.➡
Original file line number Diff line number Diff line change
@@ -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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends Node

const A := preload("res://completion/class_a.notest.gd")

func a():
var test := A.new()
test.➡
pass
12 changes: 12 additions & 0 deletions modules/gdscript/tests/scripts/completion/types/local/no_type.cfg
Original file line number Diff line number Diff line change
@@ -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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends Node

const A := preload("res://completion/class_a.notest.gd")

func a():
var test = A.new()
test.➡
pass
12 changes: 12 additions & 0 deletions modules/gdscript/tests/scripts/completion/types/local/typehint.cfg
Original file line number Diff line number Diff line change
@@ -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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends Node

const A := preload("res://completion/class_a.notest.gd")

func a():
var test: A
test.➡
pass
Original file line number Diff line number Diff line change
@@ -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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends Node

const A := preload("res://completion/class_a.notest.gd")

func a():
var test: Node = A.new()
test.➡
pass
Original file line number Diff line number Diff line change
@@ -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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
extends Node

const A := preload("res://completion/class_a.notest.gd")

func a():
var test: A = Node.new()
test.➡
pass
Original file line number Diff line number Diff line change
@@ -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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends Node

const A := preload("res://completion/class_a.notest.gd")

var test := A.new()

func a():
test.➡
pass
12 changes: 12 additions & 0 deletions modules/gdscript/tests/scripts/completion/types/member/no_type.cfg
Original file line number Diff line number Diff line change
@@ -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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends Node

const A := preload("res://completion/class_a.notest.gd")

var test = A.new()

func a():
test.➡
pass
Original file line number Diff line number Diff line change
@@ -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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends Node

const A := preload("res://completion/class_a.notest.gd")

var test: A

func a():
test.➡
pass
Original file line number Diff line number Diff line change
@@ -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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends Node

const A := preload("res://completion/class_a.notest.gd")

var test: Node = A.new()

func a():
test.➡
pass
Original file line number Diff line number Diff line change
@@ -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"},
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends Node

const A := preload("res://completion/class_a.notest.gd")

var test: A = Node.new()

func a():
test.➡
pass

0 comments on commit 3091354

Please sign in to comment.