Persist index for /rustdoc in LMDB (#12988)

This PR updates the `/rustdoc` command with persistence for the
documented rustdoc items.

Now when you run `/rustdoc --index <CRATE_NAME>` it will index the crate
and store the results in LMDB.

The documented items will then be read from the database when searching
using `/rustdoc` and persist across restarts of Zed.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-06-13 12:07:26 -04:00 committed by GitHub
parent 6c70a809ec
commit 85acc2be44
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 174 additions and 38 deletions

View file

@ -1,8 +1,12 @@
use std::sync::Arc;
use serde::{Deserialize, Serialize};
use strum::EnumIter;
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, EnumIter)]
#[derive(
Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, Serialize, Deserialize, EnumIter,
)]
#[serde(rename_all = "snake_case")]
pub enum RustdocItemKind {
Mod,
Macro,