Commit graph

282 commits

Author SHA1 Message Date
Piotr Osiewicz
97421c670e
Remove unreferenced dev dependencies (#51093)
This will help with test times (in some cases), as nextest cannot figure
out whether a given rdep is actually an alive edge of the build graph

Closes #ISSUE

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A
2026-03-09 13:22:12 +01:00
John Tur
8d083a639c
Lazily initialize kernelspecs (#51026)
On Windows, the WSL VM always boots up when Zed is opened, because we
eagerly discover which jupyter kernels are installed inside WSL on
startup. This is not desirable if the REPL feature is not being used.
Defer this work to the point where we actually need to know what kernels
are installed.

Release Notes:

- N/A
2026-03-07 20:51:22 -05:00
Conrad Irwin
6c9b813f38
Remove Executor::close() (#50970)
Co-Authored-By: Eric Holk <eric@zed.dev>

In app drop we had been calling `.close()` on the executors. This caused
problems with the BackgroundExecutor on Linux because it raced with
concurrent work: If task A was running and about to poll task B, the
poll to task B would panic with "Task polled after completion". This
didn't really matter (because the app was shutting down anyway) but
inflated our panic metrics on Linux.

It turns out that the call to `.close()` is not needed. It was added to
prevent foreground tasks being scheduled after the app was dropped; but
on all platforms the App run method does not return until after the
ForegroundExecutor is stopped (so no further tasks will run anyway).

The background case is more interesting. In test code it didn't matter
(the background executor is simulated on the main thread so tests can't
leak tasks); in app code it also didn't really make a difference. When
`fn main` returns (which it does immediately after the app is dropped)
all the background threads will be cancelled anyway.

Further confounding debugging, it turns out that the App does not get
dropped on macOS and Windows due to a reference cycle; so this was only
happening on Linux where the app quit callback is dropped instead of
retained after being called. (Fix in #50985)

Release Notes:

- N/A

---------

Co-authored-by: Eric Holk <eric@zed.dev>
2026-03-07 04:11:45 +00:00
Kyle Kelley
21e202ef0c
repl: Switch to util::process::Child to rely on process groups (#48839)
Follow up to https://github.com/zed-industries/zed/pull/48760 thanks to
@miguelraz and @reflectronic.

No new notes since #48760 did the same thing, only wasn't opting in to
process groups we already had in place.

Release Notes:

- N/A
2026-03-06 11:04:23 -06:00
MostlyK
66de3d9c00
repl: Treat WSL as a separate kernel type from SSH remote (#50721)
Split WslRemote out of the remote_kernels bucket in the kernel picker,
giving it its own "WSL Kernels" section. Use the distro name and
kernelspec display name for WSL entries instead of the generic "WSL"
string.

In python_env_kernel_specifications, detect WSL projects via
RemoteConnectionOptions and return WslRemote instead of SshRemote. Stop
marking WSL worktrees as remote so global kernel specs load.

Fix ark kernel stdout pollution by building the wsl.exe bash command
with a quoted cd and inline env assignment, so exec replaces the shell
and doesn't echo input back.

Closes #50459 

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A
2026-03-06 07:28:10 -06:00
Kyle Kelley
74e747a6c7
repl: Support kernel language aliases in REPL (#49762)
Add a `kernel_language_names` field to `LanguageConfig` that allows
languages to declare alternative names that Jupyter kernels may use.
This fixes REPL matching for cases where a kernel reports a different
language identifier than Zed's language name.

For example, the Nu extension would set `kernel_language_names =
["nushell", "nu"]` in its config.toml, enabling REPL support for
nu-jupyter-kernel which reports `"language": "nushell"` in its
kernelspec.

The change consolidates kernel language matching logic into a single
`Language::matches_kernel_language()` method that checks the code fence
block name, language name, and the new aliases list (all
case-insensitive).

- [x] Done a self-review taking into account security and performance
aspects

Release Notes:

- Added `kernel_language_names` field for extensions to self identify
REPL mappings
2026-03-04 11:58:51 -06:00
MostlyK
731a80053c
repl: Bump runtimed ecosystem packages and add support for V3 Jupyter Notebooks (#49914)
- Add support for v3 Jupyter Notebooks ( nbformat 1.2.0 <->
https://github.com/runtimed/runtimed/pull/275 )
- This means that we can now open notebooks like [Signal Processing for
Python](https://nbviewer.org/github/unpingco/Python-for-Signal-Processing/tree/master/)
and much more.

 

Release Notes:

- N/A
2026-03-04 10:14:32 -06:00
Casper van Elteren
c0fa025bc9
repl: Fix image scaling (#48435)
Continues #47114

Release Notes:

- Fixed REPL output width clamping to apply to the content area so
images don’t get clipped by controls

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
2026-03-04 07:33:40 +00:00
Conrad Irwin
6808acce93
Fix a few cases where we weren't escaping shell vars correctly (#50562)
Release Notes:

- N/A
2026-03-02 23:31:11 -07:00
MostlyK
72fa9715e3
repl: Fix duplicate output inside notebooks (#48616)
- Render the output only when needed, fixes the duplicate output that
can happen after opening a saved notebook.
- Vim in Jupyter View with j/k navigation across notebook cells

Release Notes:

- N/A
2026-02-26 00:15:57 +01:00
Lukas Wirth
9ad8c7a2a3
editor: Distribute lines across cursors when pasting from external sources (#48676)
Release Notes:

- When pasting multiple lines equaling the number of cursors Zed now
maps each line to each cursor
2026-02-20 16:33:06 +00:00
MostlyK
ae9bb6a628
repl: Add WSL and SSH remote kernel support (#47891)
Closes #15196, #46918 

- fix: notebook_ui, use buffer so that notebooks open in remote/WSL
settings.
- fix: add musl in nix for cross-compilation, without this remote server
doesn't build inside NixOS


Release Notes:

- Implement WSL and SSH remote kernels (crates/repl/src/kernels/*) and
wire up spawn/kill kernel proto messages and client requests.
2026-02-20 09:36:21 +00:00
Kyle Kelley
a7df04c375
repl: Add clear output(s) command (#49631)
Closes #15947

This adds `repl:ClearCurrentOutput` and `repl:ClearOutputs` commands. No
keybindings are set for this. Just an action people can bind.

Release Notes:

- Added ability to clear outputs by action
2026-02-20 08:56:29 +01:00
Kyle Kelley
19404e43df
repl: Support HTML outputs through html_to_markdown (#49646)
Closes #15555

Adds a super basic render of html output from jupyter kernels.

<img width="1061" height="1207" alt="image"
src="https://github.com/user-attachments/assets/1bfb8c71-0e38-4bff-9f0c-bec12721232a"
/>

Obviously not as full featured as #48157

Release Notes:

- Added basic handling of HTML in REPL outputs
2026-02-20 08:55:58 +01:00
Lukas Wirth
7d80412cca
Reduce amount of monomorphizations from FnMut closures (#49453)
Replaces a bunch of `impl FnMut` parameters with `&mut dyn FnMut` for
functions where this is the sole generic parameter.
Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-02-18 12:00:02 +01:00
Jakub Konka
16dfc60ad2
util: Always use posix_spawn on macOS even with pre_exec hooks (#49090)
Here's some backstory:
* on macOS, @cole-miller and I noticed that since roughly Oct 2025, due
to some changes to latest macOS Tahoe, for any spawned child process we
needed to reset Mach exception ports
(https://github.com/zed-industries/zed/issues/36754 +
6e8f2d2ebe)
* the changes in that PR achieve that via `pre_exec` hook on
`std::process::Command` which then abandons `posix_spawn` syscall for
`fork` + `execve` dance on macOS (we tracked it down in Rust's std
implementation)
* as it turns out, `fork` + `execve` is pretty expensive on macOS
(apparently way more so than on other OSes like Linux) and `fork` takes
a process-wide lock on the allocator which is bad
* however, since we wanna reset exception ports on the child, the only
official way supported by Rust's std is to use `pre_exec` hook
* posix_spawn on macOS exposes this tho via a macOS specific extension
to that syscall `posix_spawnattr_setexceptionports_np` but there is no
way to use that via any standard interfaces in `std::process::Command`
* thus, it seemed like a good idea to instead create our own custom
Command wrapper that on non-macOS hosts is a zero-cost wrapper of
`smol::process::Command`, while on macOS we reimplement the minimum to
achieve `smol::process::Command`  with `posix_spawn` under-the-hood

Notably, this changeset improves git-blame in very large repos
significantly.

Release Notes:

- Fixed performance spawning child processes on macOS by always forcing
`posix_spawn` no matter what.

---------

Co-authored-by: Cole Miller <cole@zed.dev>
2026-02-13 20:16:11 +01:00
Kyle Kelley
8249ef5618
repl: Initial stdin support for kernels (#48851)
Support stdin from Jupyter kernels AKA `input()` and `getpass()` in
IPython.

<img width="460" height="380" alt="image"
src="https://github.com/user-attachments/assets/3b26457f-d651-4514-94b4-8cbb6ff52003"
/>

<img width="391" height="243" alt="image"
src="https://github.com/user-attachments/assets/255bd388-5622-4521-ab93-f9ef7fe861aa"
/>

Closes #22746

Release Notes:

- Added STDIN support (`input` / `raw_input`) to REPL
2026-02-13 08:18:55 +01:00
Lukas Wirth
a6797892ec
Resolve semantic merge conflict (#48999)
Caused by https://github.com/zed-industries/zed/pull/48763 and
https://github.com/zed-industries/zed/pull/48800

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-02-12 07:53:30 +00:00
Kyle Kelley
317a578f6a
repl: List python environments first (#48763)
This PR completely subsumes
https://github.com/zed-industries/zed/pull/46720

<img width="574" height="496" alt="image"
src="https://github.com/user-attachments/assets/14ee9185-0be6-49cf-b5fd-114e61915341"
/>

Release Notes:

- Added Python Environments to REPL kernel selection
- List active toolchain/python environment as the recommended kernel for
REPL usage

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-12 08:20:20 +01:00
Richard Feldman
ee3f40fe25
Re-add MultiWorkspace (#48800)
Release Notes:

- Added agent panel restoration. Now restarting your editor won't cause
your thread to be forgotten.

---------

Co-authored-by: Anthony Eid <56899983+Anthony-Eid@users.noreply.github.com>
Co-authored-by: Eric Holk <eric@zed.dev>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Anthony Eid <anthony@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Cameron Mcloughlin <cameron.studdstreet@gmail.com>
2026-02-12 01:06:23 +00:00
Mikayla Maki
83de8a25e0
Revert PRs for landing in main (#48969)
We're going to re-apply these after landing the multiworkspace branch.

Release Notes:

- N/A
2026-02-12 00:28:17 +00:00
Katie Geer
f233ae4c29
Add telemetry for user-facing notifications (#48558)
## Summary

Adds a "Notification Shown" telemetry event that fires whenever a
user-facing notification is displayed in Zed. This helps the team
understand error patterns, notification frequency, and which parts of
the application generate the most notifications.

## Event Schema

| Property | Type | Description |
|----------|------|-------------|
| `notification_type` | `string` | `"error"` or `"notification"` |
| `source` | `string` | Origin category (e.g., `lsp`, `git`, `settings`,
`editor`) |
| `lsp_name` | `string?` | Language server name (only for LSP
notifications) |
| `level` | `string?` | Severity: `"critical"`, `"warning"`, or `"info"`
|
| `has_actions` | `bool` | Whether the notification has action buttons |
| `notification_id` | `string` | Debug string of the NotificationId |
| `is_auto_dismissing` | `bool` | Whether the notification
auto-dismisses |

## NotificationSource Categories

A new `NotificationSource` enum categorizes notifications by origin:

- `lsp` - Language server notifications
- `settings` - Settings/keymap parse errors
- `update` - App updates, release notes
- `extension` - Extension suggestions/errors
- `git` - Git operations, commit errors
- `project` - Project-level issues
- `collab` - Collaboration notifications
- `remote` - SSH/remote project errors
- `file` - File access errors
- `editor` - Editor operations (search, encoding)
- `agent` - AI assistant notifications
- `cli` - CLI installation
- `system` - Generic fallback

## Privacy

**Message content is intentionally not included** in telemetry because:
- LSP messages come from external servers and may contain file paths or
error chains
- Error messages may contain sensitive paths or API-related information
- The metadata alone provides sufficient insight for error tracking

## Implementation

Updated function signatures to include `NotificationSource`:
- `show_notification(id, source, cx, build_fn)`
- `show_toast(toast, source, cx)`
- `show_error(err, source, cx)`
- `show_app_notification(id, source, cx, build_fn)`
- `notify_err(workspace, source, cx)`
- `notify_async_err(source, cx)`
- `notify_app_err(source, cx)`
- `detach_and_notify_err(source, window, cx)`

Release Notes

- N/A (internal telemetry change)

---------

Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-02-11 10:21:37 -08:00
Kyle Kelley
770ff7cbd9
repl: Write test for JSON output (#48897)
Tests for JSON output in the REPL.

Release Notes:

- N/A
2026-02-11 17:23:12 +01:00
Kyle Kelley
de5fc22335
repl: Test outputs and ExecutionView (#48892)
More tests for outputs and the `ExecutionView`. Wanting to get more of
these in before we progress on Notebooks and Widgets.

Release Notes:

- N/A
2026-02-11 17:22:26 +01:00
Kyle Kelley
303c1aa15f
repl: Be more resilient with message parsing (#48837)
Closes #21529

Show a toast when a message from a Jupyter kernel doesn't parse
properly.

Discovered that some kernels don't include their execution count in an
`ExecuteReply` which is required in the jupyter protocol. Upstream I'll
go make that field either be an `Option` or just stick
`#[serde(default)]` on it so it's not a change in the interface.

Release Notes:

- Show error when parsing a message from a Jupyter kernel fails
2026-02-09 22:54:46 -05:00
Kyle Kelley
24d9c00e0e
repl: Use split() on shell and control dealer sockets (#48823)
Hot on the heels of https://github.com/zed-industries/zed/pull/48817 I'm
bringing the best improvement to the repl underneath: `split()`-able
sockets! Much more will be unlocked by having this.

This split the shell and control `DealerSocket` connections into
independent send/recv halves using the new `split()` API from zeromq
0.5.0 and runtimelib 1.x. This also nicely cleaned things up so we could
have a single `select!` loop over iopub, shell, and control recv halves.
That replaces three separate recv tasks.

This likely closes some issues for certain kernels that would get stuck
either during startup or other flows due to them not sending replies to
specific requests. I'll see if I can find issues around this and update
the release notes after.

This allows us to unlock some nifty new things we can do on the shell
socket, particularly autocompletion for in-memory values, stdin support,
and others. I _think_ it also help with sending and receving
`KernelInfo`, which not all kernels do properly at the start. This makes
us a bit more resilient to errant kernels.

Release Notes:

- N/A
2026-02-09 18:12:00 -06:00
Kyle Kelley
29f2048f88
repl: Shutdown all kernels on app quit (#48760)
Closes #17985
Closes #21911

Force the shutdown of the kernel by ensuring the kernel sessions are
dropped on app quit.

Release Notes:

- Fixed shutdown of kernels on app exit
2026-02-09 22:36:22 +01:00
Kyle Kelley
7f2ee83173
repl: Bump runtimed ecosystem packages to 1.x (#48817)
Bump the runtimed ecosystem packages to their 1.0 releases:

- `jupyter-protocol`: 0.10.0 → 1.1.0
- `jupyter-websocket-client`: 0.15.0 → 1.0.0
- `nbformat`: 0.15.0 → 1.0.0
- `runtimelib`: 0.30.0 → 1.1.0

One breaking change: `MimeType::Json` now wraps `serde_json::Value`
directly instead of `serde_json::Map<String, Value>`, so the redundant
`Value::Object(...)` wrapping in `outputs.rs` was removed.

Closes #41649

More Quality of Life improvements and Bug Fixes are coming in new PRs
after this is merged.

Release Notes:

- Fixes startup for R kernels and Python kernels on windows.
2026-02-09 22:27:40 +01:00
Kyle Kelley
495d9665c5
repl: Pluck project off editor directly (#48808)
Clean up code by pulling the project off the editor directly.

Repeat of https://github.com/zed-industries/zed/pull/48762 since
reversion happened in https://github.com/zed-industries/zed/pull/48776.

Release Notes:

- N/A
2026-02-09 20:18:24 +01:00
Finn Evers
165b404460
Revert "New multi workspace (#47795)" (#48776)
Preparing this just in case.

Release Notes:

- N/A
2026-02-09 15:37:16 +01:00
Kyle Kelley
db6c006f73
repl: Pluck project off of editor directly (#48762)
The new multi workspace introduced in #47795 changed the window root
from `Workspace` to `MultiWorkspace`, which broke
`Workspace::for_window()` (assuming that was meant to). That returns
`None` now. The REPL action registration in `repl_sessions_ui.rs` used
this to check if the project was local, so when it got None, it silently
skipped registering `repl::Run` and `repl::RunInPlace` on every editor.

Luckily we can just get the project directly from the editor in order to
register actions.

Release Notes:

- N/A
2026-02-09 10:03:37 +01:00
MostlyK
ab54a7e29b
repl: Add quality of life changes in Jupyter view (#47533)
- Keyboard navigation where you can traverse through cells using up and
down arrow
- Jupyter Logo added 
- Initialize kernel as shutdown for more predictable behavior
- Ability to create .ipynb files with bare essential metadata.
- Optimize editor initialization to avoid cloning the entire notebook
and shortcuts


Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-02-04 07:05:22 -06:00
MostlyK
14621b66b8
repl: Fix cursor visibility on last line after re-running cells (#48218)
- This also sends the cursor to block placement anchor which is the
standard thing to happen when we run cmd/ctrl + shift + enter, this is
usually used for Run and Move onto next cell.
- Perhaps the ability to stay on the same code will be tackled on
further works where not using the shift modifier would signify stay and
"just" run the cell. Like #46868

Closes #48069

Release Notes:

- Fixed cursor becoming invisible on the last line of REPL cells after
re-running
2026-02-02 22:48:07 -06:00
Casper van Elteren
602d64f238
Add configurable REPL output size limits (#47114)
Closes #47113

Adds configurable REPL output size limits with two new settings,
`repl.output_max_height_lines` and `repl.output_max_width_columns`, so
large outputs scroll instead of expanding and images scale down to fit
the available space. The output containers in both inline REPL blocks
and notebook cells now respect these bounds, and image sizing uses the
same text metrics as the terminal output for consistent column-based
width calculations.

Release Notes:

- REPL output now supports configurable max height and width limits,
with large outputs scrolling and images scaling to stay within the
viewport.
2026-02-03 04:32:38 +00:00
Kyle Kelley
3723a2560a
repl: Render application/json media types from Jupyter kernels (#47905)
Closes #47757

Component of https://github.com/zed-industries/zed/issues/9778

<img width="799" height="913" alt="image"
src="https://github.com/user-attachments/assets/ac496987-bf03-4ea4-99f0-d327e57e7b20"
/>

Release Notes:

- Added JSON output support to REPL
2026-01-30 11:09:45 -06:00
Kyle Kelley
446227cf6d
repl: Streamline Markdown output usage (#47713)
Brought the Markdown output up to date with how Markdown is used in the
Agent panel. This fixed an issue with outputs that were too large for
the execution view as well as made sure that markdown would wrap.

<img width="3222" height="2334" alt="image"
src="https://github.com/user-attachments/assets/c65efa53-b792-4529-909a-9117053e30be"
/>

Release Notes:

- N/A
2026-01-28 17:42:07 +00:00
MostlyK
e9aadaf0af
repl: Add initial notebook execution + KernelSession abstraction (#43553)
Coming from discussion on #25936 and
https://github.com/zed-industries/zed/pull/19756 .
This PR introduces the KernelSession abstraction and adds basic notebook
cell execution inside NotebookEditor.

The following provides a base starter for the development on Notebooks.

What this PR includes today:

Release Notes:

- KernelSession trait extracted. Both REPL and NotebookEditor now share
the same routing mechanism.
- NotebookEditor can launch kernels, execute code cells, and display
outputs.
- Basic cell operations: run current cell, run all, move up/down, add
code/markdown blocks. Keybindings follow Jupyter defaults.


Next Steps:

- [x] Editing support for markdown and code blocks.
- Buffer integration instead of temporary cell text.
- [x] Proper focus behavior when executing or adding cells.
- Kernel control UI.

A little far fetched steps:

- Vim Support
- Cell Handling Improvement and other convenient features and design
from other editors
- Ability to have better parsing for AI Support. 


I have attached a video of showcasing some of the features:


https://github.com/user-attachments/assets/37e6f3e5-2022-45f0-a73d-2dd01ebc2932
2026-01-22 09:00:29 -06:00
Danilo Leal
e1e7676b5a
ui: Improve performance in the CopyButton component (#47292)
This PR improves the performance of the `CopyButton` component by
tracking the copied state locally through a `CopyButtonState` struct
instead of making an OS call every time the component re-renders. Also
pushing a slight improvement here by resetting the state after two
seconds so as to make the check mark go away after you clicked to copy.

Release Notes:

- N/A
2026-01-21 13:40:42 -03:00
Conrad Irwin
4aa3cd07c3
Revert "Revert scheduler update (#46659)" (#46671)
Reland the new scheduler

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-01-14 07:19:13 +00:00
Conrad Irwin
8b4ab260e6
Revert scheduler update (#46659)
Reverts the new scheduler; it's destroyed our CI

Release Notes:

- N/A
2026-01-12 16:46:15 -07:00
Nathan Sobo
73d935330e
Integrate scheduler crate into GPUI (#44810)
## Motivation

This PR unifies the async execution infrastructure between GPUI and
other components that depend on the `scheduler` crate (such as our cloud
codebase). By having a scheduler that lives independently of GPUI, we
can enable deterministic testing across the entire stack - testing GPUI
applications alongside cloud services with a single, unified scheduler.

## Summary

This PR completes the integration of the `scheduler` crate into GPUI,
unifying async execution and enabling deterministic testing of GPUI
combined with other components that depend on the scheduler crate.

## Key Changes

### Scheduler Integration (Phases 1-5, previously completed)
- `TestDispatcher` now delegates to `TestScheduler` for timing, clock,
RNG, and task scheduling
- `PlatformScheduler` implements the `Scheduler` trait for production
use
- GPUI executors wrap scheduler executors, selecting `TestScheduler` or
`PlatformScheduler` based on environment
- Unified blocking logic via `Scheduler::block()`

### Dead Code Cleanup
- Deleted orphaned `crates/gpui/src/platform/platform_scheduler.rs`
(older incompatible version)

## Intentional Removals

### `spawn_labeled` and `deprioritize` removed
The `TaskLabel` system (`spawn_labeled`, `deprioritize`) was removed
during this integration. It was only used in a few places for test
ordering control.

cc @maxbrunsfeld @as-cii - The new priority-weighted scheduling in
`TestScheduler` provides similar functionality through
`Priority::High/Medium/Low`. If `deprioritize` is important for specific
test scenarios, we could add it back to the scheduler crate. Let me know
if this is blocking anything.

### `start_waiting` / `finish_waiting` debug methods removed
Replaced by `TracingWaker` in `TestScheduler` - run tests with
`PENDING_TRACES=1` to see backtraces of pending futures when parking is
forbidden.

### Realtime Priority removed
The realtime priority feature was unused in the codebase. I'd prefer to
reintroduce it when we have an actual use case, as the implementation
(bounded channel with capacity 1) could potentially block the main
thread. Having a real use case will help us validate the design.

## Testing
- All GPUI tests pass
- All scheduler tests pass
- Clippy clean

## Architecture

```
┌─────────────────────────────────────────────────────────────┐
│                          GPUI                                │
│  ┌──────────────────────┐    ┌────────────────────────────┐ │
│  │ gpui::Background-    │    │ gpui::ForegroundExecutor   │ │
│  │ Executor             │    │  - wraps scheduler::       │ │
│  │  - scheduler: Arc<   │    │    ForegroundExecutor      │ │
│  │    dyn Scheduler>    │    └────────────┬───────────────┘ │
│  └──────────┬───────────┘                 │                  │
│             │                             │                  │
│             └──────────┬──────────────────┘                  │
│                        ▼                                     │
│            ┌───────────────────────┐                         │
│            │  Arc<dyn Scheduler>   │                         │
│            └───────────┬───────────┘                         │
│         ┌──────────────┴──────────────┐                      │
│         ▼                             ▼                      │
│  ┌──────────────────┐      ┌────────────────────┐           │
│  │ PlatformScheduler│      │   TestScheduler    │           │
│  │   (production)   │      │ (deterministic)    │           │
│  └──────────────────┘      └────────────────────┘           │
└─────────────────────────────────────────────────────────────┘
```

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Yara <git@yara.blue>
Co-authored-by: Zed Zippy <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-01-10 15:41:49 +01:00
Max Brunsfeld
c17b48782b
Revert "Make tasks inherit their callers priority" (#46413)
Reverts zed-industries/zed#46179

⚠️ Don't merge this until we confirm that it fixes the performance
regression when saving buffers while scrolling ⚠️
2026-01-08 22:04:18 -05:00
Mikayla Maki
97c35c084b
gpui: Actually remove the Result from AsyncApp (#45809)
Depends on: https://github.com/zed-industries/zed/pull/45768

Refactor plan:
https://gist.github.com/mikayla-maki/6c4bf263fd80050715ba01f45478796e
Overall plan:
https://gist.github.com/mikayla-maki/7bb5078e4385a2e683e1e1eb40d17d38

This is the big one.

Release Notes:

- N/A

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 12:48:24 -08:00
Yara 🏳️‍⚧️
1ac2b977fa
Make tasks inherit their callers priority (#46179)
Additionally this extracts more functionality into the RunnableVariant which is renamed to GpuiRunnable. 

Release Notes:

- N/A

---------

Co-authored-by: Lukas Wirth <lukas@zed.dev>
Co-authored-by: Cole Miller <cole@zed.dev>
2026-01-07 15:52:10 +00:00
Matt Lui
f3e5e3e6fe
repl: Add inlay repl output display, skip empty lines on execution, and gutter execution display (#44523)
Adds various useful things to the repl inspired by ipynb and the julia
vscode extension which can be best seen with this video:


https://github.com/user-attachments/assets/6589715e-3783-456c-8f4b-e2d5a1c4090d

To summarize:

## Inline outputs
Added small, single-line outputs displayed inline at the end of the code
line instead of in a separate block. This provides a cleaner, more
compact view for simple results like numbers or short strings. This
occurs for execution views who only output a single mimetype/plain OR
output nothing, otherwise the default behavior of creating a block will
occur.

It looks like this: 
<img width="258" height="35" alt="image"
src="https://github.com/user-attachments/assets/ccdeca3f-c3b7-4387-a4de-53d8b9a25132"
/>
or with a Output
<img width="346" height="55" alt="image"
src="https://github.com/user-attachments/assets/0b4effc9-1bd7-4e8c-802f-8733cdcc77d1"
/>
This was inspired by julia vscode extension, but now it can be used with
any replanguage! Hooray!


<img width="524" height="450" alt="image"
src="https://github.com/user-attachments/assets/a3551e51-f5f7-4d3e-994a-213c9d2f948c"
/>

It saves lots of space compared to the ugly and distracting:
<img width="531" height="546" alt="image"
src="https://github.com/user-attachments/assets/7cf65bae-8ec1-4279-ab19-f0d4ec4052a2"
/>


## Gutters and execution numbers
Added gutters + execution number to display exactly what was executed.
The gutter highlighting is useful for when selecting multiple cells
manually to run, but you dont remember which ones

Ran at different times:
<img width="257" height="58" alt="image"
src="https://github.com/user-attachments/assets/6002ab16-156a-4598-9964-5a6b188e989c"
/>
Ran together:
<img width="306" height="64" alt="image"
src="https://github.com/user-attachments/assets/2690ea35-2bd3-4207-b039-6c0f98dad6e4"
/>

The execution number is useful in the same way that a normal jupyter
notebook execution number is useful.

If a gutter-region does not have a block assigned to it, when you edit
the text in the gutter region, the gutter will disappear, which is
useful for telling when you have modified your code, but does not delete
useful experiment results in blocks:

<img width="280" height="38" alt="image"
src="https://github.com/user-attachments/assets/d7f29224-87e4-4c14-8d9f-41cb10ab5009"
/>
<img width="254" height="31" alt="image"
src="https://github.com/user-attachments/assets/586c9e1d-f53c-4973-affb-c8ca05a7563b"
/>
<img width="264" height="29" alt="image"
src="https://github.com/user-attachments/assets/f306c364-1c92-44bd-9050-ecce1b7822a0"
/>
 
## Skip empty line
This is a minor fix which is intended to make lab workflow less tedious.
Currently when you execute on an empty line (which might be there for
formatting purposes) nothing will occur. This PR adds the ability to,
when executing from an empty line, skip ahead the range of inclusion
until you reach actual code, and then execute.

Before:
```
code //run execute
//empty space, so you have to move your cursor down or use arrow key
code //run execute
code //run execute
```
After:
```
code //run execute
//empty space, you can now run execute on it and it will include the next line of code
//empty space
code //automatically executed
code //run execute
```

Currently the only piece of tested code is related to this, i still have
to write tests for the gutter annotation api i added and all of the
gutter + inline related code. Also still have to add more config for
this stuff.

@rgbkrk would appreciate a review :D

Closes #22678

Release Notes:

- repl: Added an inline display of execution results (as opposed to the
large execution view) for simple REPL cells
- repl: Improved how execution of empty lines are handled
- repl: Added gutter execution display
2026-01-06 18:08:38 -06:00
Danilo Leal
6d947b7746
ui: Add a CopyButton component (#45821)
There were several places adding a copy icon button, so thought of
encapsulating the logic to copy a given string into the clipboard (and
other small details like swapping the icon and tooltip if copied) into a
component, making it easier to introduce this sort of functionality in
the future, with fewer lines of code.

All it takes (for the simplest case) is:

```rs
CopyButton::new(your_message)
```

<img width="600" height="714" alt="Screenshot 2025-12-29 at 10  50@2x"
src="https://github.com/user-attachments/assets/e6949863-a056-4855-82d8-e4ffb5d62c90"
/>

Release Notes:

- N/A
2025-12-29 11:01:19 -03:00
localcc
636d11ebec
Multiple priority scheduler (#44701)
Improves the scheduler by allowing tasks to have a set priority which
will significantly improve responsiveness.

Release notes:

- N/A

---------

Co-authored-by: Yara <git@yara.blue>
Co-authored-by: dvdsk <noreply@davidsk.dev>
2025-12-12 06:32:30 -08:00
Yara 🏳️‍⚧️
ecb8d3d4dd
Revert "Multiple priority scheduler" (#44637)
Reverts zed-industries/zed#44575
2025-12-11 16:16:43 +01:00
localcc
95dbc0efc2
Multiple priority scheduler (#44575)
Improves the scheduler by allowing tasks to have a set priority which
will significantly improve responsiveness.

Release notes:

- N/A

---------

Co-authored-by: Yara <git@yara.blue>
2025-12-11 13:22:39 +00:00
tidely
387059c6b2
language: Add LanguageName::new_static to reduce allocations (#44380)
Implements a specialized constructor `LanguageName::new_static` for
`&'static str` which reduces allocations.

`LanguageName::new` always backs the underlying `SharedString` with an
owned `Arc<str>` even when a `&'static str` is passed. This makes us
allocate each time we create a new `LanguageName` no matter what.
Creating a specialized constructor for `&'static str` allows us to
essentially construct them for free.

Additional change:
Encourages using explicit constructors to avoid needless allocations.
Currently there were no instances of this trait being called where the
lifetime was not `'static` saving another 48 locations of allocation.

```rust
impl<'a> From<&'a str> for LanguageName {
    fn from(str: &'a str) -> Self {
        Self(SharedString::new(str))
    }
}

// to 

impl From<&'static str> for LanguageName {
    fn from(str: &'static str) -> Self {
        Self(SharedString::new_static(str))
    }
}

```

Release Notes:

- N/A
2025-12-08 19:57:02 +01:00