Extension refactor (#20305)

This contains the main changes to the extensions crate from #20049. The
primary goal here is removing dependencies that we can't include on the
remote.


Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
This commit is contained in:
Conrad Irwin
2024-11-06 10:06:25 -07:00
committed by GitHub
co-authored by Mikayla Marshall Bowers Marshall
parent f22e56ff42
commit 608addf641
30 changed files with 675 additions and 236 deletions
+2 -1
View File
@@ -2,6 +2,7 @@ mod item;
mod to_markdown;
use cargo_metadata::MetadataCommand;
use extension_host::DocsDatabase;
use futures::future::BoxFuture;
pub use item::*;
use parking_lot::RwLock;
@@ -208,7 +209,7 @@ impl IndexedDocsProvider for DocsDotRsProvider {
async fn index_rustdoc(
package: PackageName,
database: Arc<IndexedDocsDatabase>,
database: Arc<dyn DocsDatabase>,
fetch_page: impl Fn(&PackageName, Option<&RustdocItem>) -> BoxFuture<'static, Result<Option<String>>>
+ Send
+ Sync,
+3 -1
View File
@@ -324,8 +324,10 @@ impl IndexedDocsDatabase {
Ok(any)
})
}
}
pub fn insert(&self, key: String, docs: String) -> Task<Result<()>> {
impl extension_host::DocsDatabase for IndexedDocsDatabase {
fn insert(&self, key: String, docs: String) -> Task<Result<()>> {
let env = self.env.clone();
let entries = self.entries;