Stick REPL icon in quick action bar (#14064)

REPL Quick Actions

<img width="325" alt="image"
src="https://github.com/zed-industries/zed/assets/836375/faaf4c8f-ef12-4417-a9dd-158d5beae8ba">

When the Jupyter REPL is enabled and a kernel is available, show the
status in the editor bar:

![quick action bar
repl](https://github.com/zed-industries/zed/assets/836375/f3445283-f1fc-4714-895b-7aa842d4ab76)


Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
This commit is contained in:
Kyle Kelley 2024-07-10 09:20:52 -07:00 committed by GitHub
parent 9282bf97ae
commit 896b9bda23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 345 additions and 16 deletions

View file

@ -22,11 +22,11 @@ use theme::{ActiveTheme, ThemeSettings};
use ui::{h_flex, prelude::*, v_flex, ButtonLike, ButtonStyle, Label};
pub struct Session {
editor: WeakView<Editor>,
kernel: Kernel,
pub editor: WeakView<Editor>,
pub kernel: Kernel,
blocks: HashMap<String, EditorBlock>,
messaging_task: Task<()>,
kernel_specification: KernelSpecification,
pub messaging_task: Task<()>,
pub kernel_specification: KernelSpecification,
}
struct EditorBlock {
@ -310,7 +310,7 @@ impl Session {
}
}
fn interrupt(&mut self, cx: &mut ViewContext<Self>) {
pub fn interrupt(&mut self, cx: &mut ViewContext<Self>) {
match &mut self.kernel {
Kernel::RunningKernel(_kernel) => {
self.send(InterruptRequest {}.into(), cx).ok();
@ -322,7 +322,7 @@ impl Session {
}
}
fn shutdown(&mut self, cx: &mut ViewContext<Self>) {
pub fn shutdown(&mut self, cx: &mut ViewContext<Self>) {
let kernel = std::mem::replace(&mut self.kernel, Kernel::ShuttingDown);
match kernel {