assistant: Auto-suggest crates for /docs
when using the docs.rs provider (#16169)
This PR improves the initial experience of using `/docs docs-rs` with an empty index. We now show a brief explainer of what is expected (a crate name) as well as list some popular Rust crates to try: <img width="540" alt="Screenshot 2024-08-13 at 12 25 39 PM" src="https://github.com/user-attachments/assets/942de250-2901-45df-9e3e-52ff3b3fc517"> Release Notes: - N/A
This commit is contained in:
parent
03796e79b0
commit
e3b0de5dda
2 changed files with 63 additions and 6 deletions
|
@ -98,6 +98,26 @@ pub struct DocsDotRsProvider {
|
|||
}
|
||||
|
||||
impl DocsDotRsProvider {
|
||||
/// The list of crates to auto-suggest for the docs.rs provider when
|
||||
/// the index is empty.
|
||||
///
|
||||
/// List has been chosen loosely based on [this list](https://lib.rs/std) of
|
||||
/// popular Rust libraries.
|
||||
///
|
||||
/// Keep this alphabetized.
|
||||
pub const AUTO_SUGGESTED_CRATES: &'static [&'static str] = &[
|
||||
"anyhow",
|
||||
"axum",
|
||||
"chrono",
|
||||
"itertools",
|
||||
"rand",
|
||||
"regex",
|
||||
"serde",
|
||||
"strum",
|
||||
"thiserror",
|
||||
"tokio",
|
||||
];
|
||||
|
||||
pub fn id() -> ProviderId {
|
||||
ProviderId("docs-rs".into())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue