context servers: Show configuration modal when extension is installed (#29309)
WIP Release Notes: - N/A --------- Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com> Co-authored-by: Danilo Leal <daniloleal09@gmail.com> Co-authored-by: Marshall Bowers <git@maxdeviant.com> Co-authored-by: Cole Miller <m@cole-miller.net> Co-authored-by: Antonio Scandurra <me@as-cii.com> Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>
This commit is contained in:
parent
bffa53d706
commit
24eb039752
35 changed files with 1866 additions and 437 deletions
|
@ -18,6 +18,7 @@ pub use wit::{
|
|||
CodeLabel, CodeLabelSpan, CodeLabelSpanLiteral, Command, DownloadedFileType, EnvVars,
|
||||
KeyValueStore, LanguageServerInstallationStatus, Project, Range, Worktree, download_file,
|
||||
make_file_executable,
|
||||
zed::extension::context_server::ContextServerConfiguration,
|
||||
zed::extension::github::{
|
||||
GithubRelease, GithubReleaseAsset, GithubReleaseOptions, github_release_by_tag_name,
|
||||
latest_github_release,
|
||||
|
@ -159,6 +160,15 @@ pub trait Extension: Send + Sync {
|
|||
Err("`context_server_command` not implemented".to_string())
|
||||
}
|
||||
|
||||
/// Returns the configuration options for the specified context server.
|
||||
fn context_server_configuration(
|
||||
&mut self,
|
||||
_context_server_id: &ContextServerId,
|
||||
_project: &Project,
|
||||
) -> Result<Option<ContextServerConfiguration>> {
|
||||
Ok(None)
|
||||
}
|
||||
|
||||
/// Returns a list of package names as suggestions to be included in the
|
||||
/// search results of the `/docs` slash command.
|
||||
///
|
||||
|
@ -342,6 +352,14 @@ impl wit::Guest for Component {
|
|||
extension().context_server_command(&context_server_id, project)
|
||||
}
|
||||
|
||||
fn context_server_configuration(
|
||||
context_server_id: String,
|
||||
project: &Project,
|
||||
) -> Result<Option<ContextServerConfiguration>, String> {
|
||||
let context_server_id = ContextServerId(context_server_id);
|
||||
extension().context_server_configuration(&context_server_id, project)
|
||||
}
|
||||
|
||||
fn suggest_docs_packages(provider: String) -> Result<Vec<String>, String> {
|
||||
extension().suggest_docs_packages(provider)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue