Skip to main content

script_scene_index

Function script_scene_index 

Source
pub fn script_scene_index<'db>(
    db: &'db dyn Db,
    root: SourceRoot,
) -> Arc<FxHashMap<SmolStr, SceneAttach>>
Expand description

The project-wide script → owning scene index (M1): each .gd’s res:// path → the (first) scene + node that attaches it. Built by scanning every scene’s ext_resources for a type="Script" reference. Keyed on the SourceRoot file-set + each scene file’s text (via scene_model); a .gd body edit never touches a .tscn text, so this backdates across .gd keystrokes — the firewall (a scene edit correctly invalidates it). A duplicate (one script in many scenes) keeps the first by FileId order (the slice’s single-scene policy).