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:
parent
f22e56ff42
commit
608addf641
30 changed files with 675 additions and 236 deletions
|
@ -30,6 +30,7 @@ paths.workspace = true
|
|||
serde.workspace = true
|
||||
strum.workspace = true
|
||||
util.workspace = true
|
||||
extension_host.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
indoc.workspace = true
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue