Add handler for document_cache for REPL

This commit is contained in:
Sebastian authored and Hakan Seven committed 2026-07-24 00:30:22 +03:00
1 parent 0e61836e91
commit b7dc62ffa5
1 file changed
+6 -1
+6 -1
View File
@@ -139,7 +139,12 @@ impl HostApi for PluginHostApi {
fn add_entity(&mut self, entity: EntityType) -> Handle {
match self.client.request(PluginRequest::AddEntity(entity)) {
Ok(PluginResponse::Handle(h)) => h,
Ok(PluginResponse::Handle(h)) => {
// The cached snapshot is now stale; drop it so a later
// document() re-fetches the host's post-edit truth.
self.document_cache = OnceCell::new();
h
}
Ok(other) => {
eprintln!("[plugin] unexpected AddEntity response: {other:?}");
Handle::default()