Allow extensions to suggest packages for /docs completions (#16185)

This PR gives extensions the ability to suggest packages to show up in
`/docs` completions by default.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers
2024-08-13 16:50:57 -04:00
committed by GitHub
parent c6a1d9aa33
commit aa12ae0e3c
5 changed files with 64 additions and 1 deletions
+11
View File
@@ -246,6 +246,17 @@ impl zed::Extension for GleamExtension {
}
}
fn suggest_docs_packages(&self, provider: String) -> Result<Vec<String>, String> {
match provider.as_str() {
"gleam-hexdocs" => Ok(vec![
"gleam_stdlib".to_string(),
"birdie".to_string(),
"startest".to_string(),
]),
_ => Ok(Vec::new()),
}
}
fn index_docs(
&self,
provider: String,