This PR decouples the `theme_importer` from the `theme` and `gpui`
crates.
We achieve this by inlining all of the relevant bits needed to
deserialize Zed1 themes.
This will allow us to continue to import Zed1 themes after we land
#3862.
Release Notes:
- N/A
This PR decouples the `theme_importer` from the `theme` and `gpui`
crates.
We achieve this by inlining all of the relevant bits needed to
deserialize Zed1 themes.
This will allow us to continue to import Zed1 themes after we land
#3862.
Release Notes:
- N/A
This PR adds undocumented functionality for loading custom language
plugins at runtime. I don't intend to expose the functionality to end
users yet, but this will allow the team to test the capability
internally.
### Implementation
There isn't much new code in Zed. Most of the work here is within
Tree-sitter, in PRs https://github.com/tree-sitter/tree-sitter/pull/1864
and https://github.com/tree-sitter/tree-sitter/pull/2840, which allow
Tree-sitter to load languages from WASM blobs. I've tested the
functionality in Tree-sitter's test suite and via its CLI, but having it
wired into Zed allows us to test the functionality more fully.
### Details
Now, on startup, Zed will look for subdirectories inside of
`~/Application Support/plugins`. These subdirectories are expected to
look similar to the per-language subdirectories in
[`crates/zed2/src/languages`](https://github.com/zed-industries/zed/tree/main/crates/zed2/src/languages),
except that they also contain a `.wasm` file for the parser itself.
I'll add more details here as I go.
- Returning `IntoElement` because it's more universal than `Element` and
allows us to easily return components.
- Using `impl IntoElement` in `RenderOnce` for consistency, which
requires `Component` to allocate an `AnyElement`. We use a bump
allocated arena anyway for these, and my benchmark doesn't show an
impact.
![frame-time-histogram](https://github.com/zed-industries/zed/assets/1789/d3889cca-9ebc-4d72-aa68-34a5be3bad3c)
In this histogram, frames-0 is this PR, frames-1 is main.
Release Notes:
- N/A
This PR polishes off the channel buttons such that they behave as
expected.
The absolutely-positioned button container will now no longer take up
space—and thus obscure the channel name—when there are no notifications
and the channel entry is not hovered.
Release Notes:
- N/A