Reload extensions more robustly when manually modifying installed extensions directory (#7749)

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
This commit is contained in:
Max Brunsfeld 2024-02-13 16:15:19 -08:00 committed by GitHub
parent c3176392c6
commit c357e37dde
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 335 additions and 260 deletions

View file

@ -257,10 +257,7 @@ async fn test_extension_store(cx: &mut TestAppContext) {
},
);
store
.update(cx, |store, cx| store.reload(cx))
.await
.unwrap();
store.update(cx, |store, cx| store.reload(cx));
cx.executor().run_until_parked();
store.read_with(cx, |store, _| {
@ -331,13 +328,11 @@ async fn test_extension_store(cx: &mut TestAppContext) {
assert_eq!(fs.metadata_call_count(), prev_fs_metadata_call_count + 2);
});
store
.update(cx, |store, cx| {
store.uninstall_extension("zed-ruby".into(), cx)
})
.await
.unwrap();
store.update(cx, |store, cx| {
store.uninstall_extension("zed-ruby".into(), cx)
});
cx.executor().run_until_parked();
expected_manifest.extensions.remove("zed-ruby");
expected_manifest.languages.remove("Ruby");
expected_manifest.languages.remove("ERB");