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
|
@ -121,6 +121,12 @@ pub trait Extension: Send + Sync + 'static {
|
|||
project: Arc<dyn ProjectDelegate>,
|
||||
) -> Result<Command>;
|
||||
|
||||
async fn context_server_configuration(
|
||||
&self,
|
||||
context_server_id: Arc<str>,
|
||||
project: Arc<dyn ProjectDelegate>,
|
||||
) -> Result<Option<ContextServerConfiguration>>;
|
||||
|
||||
async fn suggest_docs_packages(&self, provider: Arc<str>) -> Result<Vec<String>>;
|
||||
|
||||
async fn index_docs(
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
use std::sync::Arc;
|
||||
|
||||
use gpui::{App, AppContext as _, Context, Entity, EventEmitter, Global};
|
||||
|
||||
use crate::ExtensionManifest;
|
||||
|
||||
pub fn init(cx: &mut App) {
|
||||
let extension_events = cx.new(ExtensionEvents::new);
|
||||
cx.set_global(GlobalExtensionEvents(extension_events));
|
||||
|
@ -31,7 +35,9 @@ impl ExtensionEvents {
|
|||
|
||||
#[derive(Clone)]
|
||||
pub enum Event {
|
||||
ExtensionInstalled(Arc<ExtensionManifest>),
|
||||
ExtensionsInstalledChanged,
|
||||
ConfigureExtensionRequested(Arc<ExtensionManifest>),
|
||||
}
|
||||
|
||||
impl EventEmitter<Event> for ExtensionEvents {}
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
mod context_server;
|
||||
mod lsp;
|
||||
mod slash_command;
|
||||
|
||||
use std::ops::Range;
|
||||
|
||||
pub use context_server::*;
|
||||
pub use lsp::*;
|
||||
pub use slash_command::*;
|
||||
|
||||
|
|
10
crates/extension/src/types/context_server.rs
Normal file
10
crates/extension/src/types/context_server.rs
Normal file
|
@ -0,0 +1,10 @@
|
|||
/// Configuration for a context server.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct ContextServerConfiguration {
|
||||
/// Installation instructions for the user.
|
||||
pub installation_instructions: String,
|
||||
/// Default settings for the context server.
|
||||
pub default_settings: String,
|
||||
/// JSON schema describing server settings.
|
||||
pub settings_schema: serde_json::Value,
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue