Promote package suggestions to a first-class concept on IndexedDocsProviders (#16177)

This PR promotes package suggestions to a first-class concept on the
`IndexedDocsProvider` trait.

This will allow any implementer of `IndexedDocsProvider` to provide a
list of package names to suggest for use with `/docs`.

For the docs.rs provider we use the 250 most popular Rust crates (as
identified [here](https://lib.rs/std)), and for the rustdoc provider we
use the packages in the Cargo workspace.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-08-13 16:01:58 -04:00 committed by GitHub
parent bd71e9192c
commit a81e355dc5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 328 additions and 93 deletions

View file

@ -30,6 +30,10 @@ impl IndexedDocsProvider for ExtensionIndexedDocsProvider {
database_path
}
async fn suggest_packages(&self) -> Result<Vec<PackageName>> {
Ok(Vec::new())
}
async fn index(&self, package: PackageName, database: Arc<IndexedDocsDatabase>) -> Result<()> {
self.extension
.call({