Add handler for document_cache for REPL
This commit is contained in:
parent
0e61836e91
commit
b7dc62ffa5
1 changed files with 6 additions and 1 deletions
|
|
@ -139,7 +139,12 @@ impl HostApi for PluginHostApi {
|
||||||
|
|
||||||
fn add_entity(&mut self, entity: EntityType) -> Handle {
|
fn add_entity(&mut self, entity: EntityType) -> Handle {
|
||||||
match self.client.request(PluginRequest::AddEntity(entity)) {
|
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) => {
|
Ok(other) => {
|
||||||
eprintln!("[plugin] unexpected AddEntity response: {other:?}");
|
eprintln!("[plugin] unexpected AddEntity response: {other:?}");
|
||||||
Handle::default()
|
Handle::default()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue