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:
parent
c6a1d9aa33
commit
aa12ae0e3c
5 changed files with 64 additions and 1 deletions
|
@ -291,6 +291,19 @@ impl Extension {
|
|||
}
|
||||
}
|
||||
|
||||
pub async fn call_suggest_docs_packages(
|
||||
&self,
|
||||
store: &mut Store<WasmState>,
|
||||
provider: &str,
|
||||
) -> Result<Result<Vec<String>, String>> {
|
||||
match self {
|
||||
Extension::V010(ext) => ext.call_suggest_docs_packages(store, provider).await,
|
||||
Extension::V001(_) | Extension::V004(_) | Extension::V006(_) => Err(anyhow!(
|
||||
"`suggest_docs_packages` not available prior to v0.1.0"
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn call_index_docs(
|
||||
&self,
|
||||
store: &mut Store<WasmState>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue