Skip to main content

Module project

Module project 

Source
Expand description

project.godot autoload parsing (Playbook §3.M4).

project.godot is a Godot ConfigFile (INI-like: [section] headers, key=value, typed-Variant values). We do not evaluate full Variant values — the analyzer needs only the [autoload] section, which is line-oriented Name="*res://path". This is a deliberate minimal scan (not a VariantParser port): track the current [section], and within [autoload] split each line on the first =, take the bare LHS as the autoload name and the dequoted RHS as the resource path. The leading * on the path is the singleton/global flag (project_settings.cpp: begins_with("*")is_singleton, then substr(1) strips it); a non-* autoload is loaded at /root/Name but is not a global identifier.

Pure (fn(&str) -> Vec<AutoloadEntry>) and wasm-clean — the host injects the text.

Structs§

AutoloadEntry
One [autoload] entry from project.godot.

Functions§

parse_autoloads
Parse the [autoload] entries from project.godot text. Robust to comments, blank lines, and other sections; never panics on malformed input (a bad line is skipped).
parse_engine_version
Parse the Godot engine (major, minor) version from project.godot’s [application] config/features=PackedStringArray("4.3", "Forward Plus", …) line. Godot writes the engine version as the first <major>.<minor> entry of that array; the rest are rendering/feature tags. Returns the first version-shaped entry, or None if the line is absent or carries none. A deliberate minimal scan (not a VariantParser port); robust to malformed input (never panics).
parse_warning_settings
Parse the debug/gdscript/warnings/* settings from project.godot into a WarningSettings, starting from the engine default for engine. Keys live under [debug] as gdscript/warnings/<tail> (Godot groups a setting by its first path segment). <tail> is enable / treat_warnings_as_errors / exclude_addons (bools) or a code’s lowercased setting-name mapped to a 0|1|2 (Ignore/Warn/Error) level. A deliberate minimal scan (not a VariantParser port); robust to malformed input (a bad line is skipped). directory_rules (Godot master, a typed-Variant dict) is not parsed — see TECH_DEBT.md.