Discover available python environments with Jupyter kernel support (#20467)
 Closes #18291 Closes #16757 Closes #15563 Release Notes: - Added support for kernelspecs based on python environments
This commit is contained in:
parent
6152230152
commit
97b542b22a
6 changed files with 269 additions and 148 deletions
|
@ -4,8 +4,8 @@ use gpui::{percentage, Animation, AnimationExt, AnyElement, Transformation, View
|
|||
use picker::Picker;
|
||||
use repl::{
|
||||
components::{KernelPickerDelegate, KernelSelector},
|
||||
ExecutionState, JupyterSettings, Kernel, KernelSpecification, KernelStatus, Session,
|
||||
SessionSupport,
|
||||
worktree_id_for_editor, ExecutionState, JupyterSettings, Kernel, KernelSpecification,
|
||||
KernelStatus, Session, SessionSupport,
|
||||
};
|
||||
use ui::{
|
||||
prelude::*, ButtonLike, ContextMenu, IconWithIndicator, Indicator, IntoElement, PopoverMenu,
|
||||
|
@ -30,9 +30,6 @@ struct ReplMenuState {
|
|||
status: KernelStatus,
|
||||
kernel_name: SharedString,
|
||||
kernel_language: SharedString,
|
||||
// TODO: Persist rotation state so the
|
||||
// icon doesn't reset on every state change
|
||||
// current_delta: Duration,
|
||||
}
|
||||
|
||||
impl QuickActionBar {
|
||||
|
@ -178,12 +175,6 @@ impl QuickActionBar {
|
|||
},
|
||||
)
|
||||
.separator()
|
||||
.link(
|
||||
"Change Kernel",
|
||||
Box::new(zed_actions::OpenBrowser {
|
||||
url: format!("{}#change-kernel", ZED_REPL_DOCUMENTATION),
|
||||
}),
|
||||
)
|
||||
.custom_entry(
|
||||
move |_cx| {
|
||||
Label::new("Shut Down Kernel")
|
||||
|
@ -290,7 +281,10 @@ impl QuickActionBar {
|
|||
let editor = if let Some(editor) = self.active_editor() {
|
||||
editor
|
||||
} else {
|
||||
// todo!()
|
||||
return div().into_any_element();
|
||||
};
|
||||
|
||||
let Some(worktree_id) = worktree_id_for_editor(editor.downgrade(), cx) else {
|
||||
return div().into_any_element();
|
||||
};
|
||||
|
||||
|
@ -313,7 +307,7 @@ impl QuickActionBar {
|
|||
repl::assign_kernelspec(kernelspec, editor.downgrade(), cx).ok();
|
||||
})
|
||||
},
|
||||
current_kernelspec.clone(),
|
||||
worktree_id,
|
||||
ButtonLike::new("kernel-selector")
|
||||
.style(ButtonStyle::Subtle)
|
||||
.child(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue