Merge pull request #103663 from pafuent/fixing_errors_warnings_output_on_tests

Fix `SCRIPT ERROR/ERROR/WARNING` on test output
This commit is contained in:
Thaddeus Crews
2025-03-07 15:12:11 -06:00
33 changed files with 30 additions and 13 deletions

View File

@ -1,3 +1,5 @@
extends Node
@onready var anim := $AnimationPlayer
func test():

View File

@ -1,3 +1,5 @@
extends Node
@onready var anim: AnimationPlayer = $AnimationPlayer
func test():

View File

@ -1,3 +1,5 @@
extends Node
@onready var anim = $AnimationPlayer
func test():

View File

@ -1,5 +1,5 @@
extends Node
func a():
%AnimationPlayer.
$UniqueAnimationPlayer.
pass

View File

@ -1,5 +1,5 @@
extends Node
func a():
$UniqueAnimationPlayer.
%AnimationPlayer.
pass

View File

@ -1,6 +1,6 @@
extends Node
var test = $A
@onready var test = $A
func a():
test.

View File

@ -1,6 +1,6 @@
extends Node
var test = $AnimationPlayer
@onready var test = $AnimationPlayer
func a():
test.

View File

@ -1,6 +1,6 @@
extends Node
var test: AnimationPlayer = $AnimationPlayer
@onready var test: AnimationPlayer = $AnimationPlayer
func a():
test.

View File

@ -1,6 +1,6 @@
extends Node
var test: Node = $A
@onready var test: Node = $A
func a():
test.

View File

@ -1,6 +1,6 @@
extends Node
var test: Node = $AnimationPlayer
@onready var test: Node = $AnimationPlayer
func a():
test.

View File

@ -1,6 +1,6 @@
extends Node
var test: Area2D = $A
@onready var test: Area2D = $A
func a():
test.

View File

@ -1,6 +1,6 @@
extends Node
var test: Area2D = $AnimationPlayer
@onready var test: Area2D = $AnimationPlayer
func a():
test.

View File

@ -161,6 +161,8 @@ static void test_directory(const String &p_dir) {
owner = scene->get_node(conf.get_value("input", "node_path", "."));
}
// The only requirement is for the script to be parsable, warnings and errors from the analyzer might happen and completion should still work.
ERR_PRINT_OFF;
if (owner != nullptr) {
// Remove the line which contains the sentinel char, to get a valid script.
Ref<GDScript> scr;
@ -184,6 +186,8 @@ static void test_directory(const String &p_dir) {
}
GDScriptLanguage::get_singleton()->complete_code(code, res_path, owner, &options, forced, call_hint);
ERR_PRINT_ON;
String contains_excluded;
for (ScriptLanguage::CodeCompletionOption &option : options) {
for (const Dictionary &E : exclude) {