Add support for external references in RojoTree and syncback process

- Introduced REF_EXTERNAL_ATTRIBUTE_PREFIX for attributes pointing to external instances.
- Enhanced PatchApplyContext to track external references and apply them during patch application.
- Implemented get_instance_by_path method in RojoTree for resolving paths to external instances.
- Updated collect_referents function to handle external references and preserve their paths during syncback.
- Refactored link_referents to include external reference handling in the linking process.
This commit is contained in:
Joe 2026-01-20 21:05:28 -06:00
parent 9e270bd847
commit a1e270949d
5 changed files with 217 additions and 27 deletions

View file

@ -4,6 +4,9 @@ use serde::{Deserialize, Serialize};
pub const REF_ID_ATTRIBUTE_NAME: &str = "Rojo_Id";
pub const REF_POINTER_ATTRIBUTE_PREFIX: &str = "Rojo_Target_";
/// Prefix for attributes storing paths to external references (instances outside
/// the sync tree, like SoundGroups in SoundService).
pub const REF_EXTERNAL_ATTRIBUTE_PREFIX: &str = "Rojo_External_";
// TODO add an internment strategy for RojoRefs
// Something like what rbx-dom does for SharedStrings probably works