Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ResourceFormatLoaderGDScript::get_dependencies always returns an empty list #90643

Open
jamie-pate opened this issue Apr 13, 2024 · 2 comments · Fixed by #90860 · May be fixed by #89231
Open

ResourceFormatLoaderGDScript::get_dependencies always returns an empty list #90643

jamie-pate opened this issue Apr 13, 2024 · 2 comments · Fixed by #90860 · May be fixed by #89231

Comments

@jamie-pate
Copy link
Contributor

Tested versions

  • Reproducible in Godot_v4.3-dev5_linux.x86_64
  • Reproducible in Godot_v4.2.1-stable_linux.x86_64

System information

Godot v4.2.1.stable - Ubuntu 22.04.4 LTS 22.04 - X11 - Vulkan (Forward+) - integrated Intel(R) Graphics (ADL GT2) () - 12th Gen Intel(R) Core(TM) i7-12700H (14 Threads)

Issue description

When porting https://github.com/jamie-pate/godot-code-coverage to godot4 I found that ResourceLoader.get_dependencies("res://script.gd") now returns empty for all scripts.

In godot3 the dependencies were tracked in gdscript_parser.cpp, but now there is just a TODO comment in gdscript_parser.h:

	const List<String> get_dependencies() const {
		// TODO: Keep track of deps.
		return List<String>();
	}

Workaround: I guess I'll have to find preload and load using regex which won't work for dynamic loading

Steps to reproduce

  • Create a script "some_script.gd" with a preload("res://other_script.gd") statement
  • call var deps = ResourceLoader.get_dependencies("res://some_script.gd").
    The deps should have one member "res://other_script.gd"

Minimal reproduction project (MRP)

gdscript_parser_get_dependencies.zip

jamie-pate added a commit to jamie-pate/godot-code-coverage that referenced this issue Apr 13, 2024
Adds gdlint and formatting.

Work around some missing pieces of godot4

godotengine/godot#90646
godotengine/godot#90643
@vnen
Copy link
Member

vnen commented Apr 16, 2024

Yes, this is something that slipped my mind at the time and nobody else noticed, I guess. I didn't forget about it, just didn't come to it yet. But I'll put this on the top of my list, since it's an actually important feature.

@akien-mga
Copy link
Member

Reopening as #90860 caused regressions and was reverted for 4.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Fix pending review
4 participants