Adds the `compositor_support` to the `X11WindowState` struct so that
correct window decorations are selected
Release notes:
- N/A
---------
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This PR refactors the `TitleBar` component to move all of the
collab-related code into the `collab` module.
This simplifies the top-level `Render` implementation of `TitleBar` by a
lot and makes it easier to read.
Release Notes:
- N/A
This PR adds a `NumericStepper` component that can be used to display a
numeric value along with controls to increment, decrement, and reset the
value.
The `ApplicationMenu` has been updated to use the `NumericStepper` for
adjusting the buffer and UI font size.
Here it is in action:
https://github.com/zed-industries/zed/assets/1486634/03cffe67-1256-4283-aa3d-560fffa06dad
Note: Due to the way we do font adjustments, once modified the reset
button will be displayed until it is clicked (or the font size
adjustment is otherwise reset). Simply returning to the original value
will currently not hide the reset button.
Release Notes:
- N/A
This PR consists of two main changes:
1. The first commit changes the `open` crate for opening URLs/paths for
the `OpenURI` desktop portal. This fixes the activation token not being
passed to programs (at least on KDE).
2. The second commit implements the window `activate()` API on Wayland.
This allows KWin and Mutter to show a visual indicator when the window
is requesting attention. (see
https://github.com/zed-industries/zed/issues/12557)
![image](https://github.com/zed-industries/zed/assets/71973804/ce148f8e-28fd-4249-8f8d-3a5828ed6f83)
Release Notes:
- N/A
This PR renames the `ui_text_field` crate to `ui_input` to make it a bit
more generic.
We'll likely end up with multiple kinds of input components in this
crate.
Release Notes:
- N/A
Release Notes:
- Added Linux-Specific keymaps for JetBrains, Atom and Sublime Text
- Improved MacOS-specific keymaps for JetBrains and Atom
- Improved Linux default keymap (VSCode compatibility)
- Windows now uses same keymap as Linux
---------
Co-authored-by: Peter Tripp <peter@zed.dev>
Previously to these changes, as stated in the issue, when someone tried
to use TSX as language for the file, the language was not set and it
disappeared from the selectable language list. This was due to the fact
that that the three files were symlinks, and windows couldn't read them.
I replaced them with normal files.
Fixes#12208.
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Pass on all the XkbStateNotify information to XKB.
> "All parameters must always be passed, or the resulting state may be
incoherent."
>
https://docs.rs/xkbcommon/latest/xkbcommon/xkb/struct.State.html#method.update_mask
Previously, many keymaps using multiple groups/layers would not work and
remain in group0.
Release Notes:
- Fixed handling of Xkb keymap groups on X11.
This addresses the question in [this
comment](https://github.com/zed-industries/zed/issues/5830#issuecomment-2211942554)
by adding support for `classAttributes` to the settings.
Meaning that the following Zed `settings.json` now works:
```jsonc
{
"lsp": {
"tailwindcss-language-server": {
"settings": {
"classAttributes": [
"class",
"className",
"ngClass",
// add styles so will give intellisense to styles constant.
"styles"
]
// Optional:
// "includeLanguages": {
// "erb": "html",
// "ruby": "html"
// },
// "experimental": {
// "classRegex": ["\\bclass:\\s*['\"]([^'\"]*)['\"]"]
// }
}
}
}
}
```
Release Notes:
- Added support for setting `classAttributes` in the configuration for
`tailwindcss-language-server`. Example: `{ "lsp": {
"tailwindcss-language-server": { "settings": { "classAttributes": [
"class", "className", "ngClass", "styles" ] } } } }`
```
Thread "main" panicked with "divide by zero error when dividing duration by scalar" at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/time.rs:1172:31
0: zed::reliability::init_panic_hook::{{closure}}
at crates/zed/src/reliability.rs:58:29
1: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/alloc/src/boxed.rs:2036:9
std::panicking::rust_panic_with_hook
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:799:13
2: std::panicking::begin_panic_handler::{{closure}}
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:664:13
3: std::sys_common::backtrace::__rust_end_short_backtrace
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys_common/backtrace.rs:171:18
4: rust_begin_unwind
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:652:5
5: core::panicking::panic_fmt
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:72:14
6: core::panicking::panic_display
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/panicking.rs:263:5
7: core::option::expect_failed
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/option.rs:1994:5
8: core::option::Option<T>::expect
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/option.rs:895:21
<core::time::Duration as core::ops::arith::Div<u32>>::div
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/time.rs:1172:31
9: <gpui::platform::linux::wayland::client::WaylandClientStatePtr as wayland_client::event_queue::Dispatch<wayland_client::protocol::wl_keyboard::WlKeyboard,()>>::event::{{closure}}
at crates/gpui/src/platform/linux/wayland/client.rs:1211:63
10: <core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatcher<Data>>::process_events::{{closure}}
at /home/atassis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/calloop-0.13.0/src/sources/mod.rs:327:61
11: <calloop::sources::timer::Timer as calloop::sources::EventSource>::process_events
at /home/atassis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/calloop-0.13.0/src/sources/timer.rs:122:38
12: <core::cell::RefCell<calloop::sources::DispatcherInner<S,F>> as calloop::sources::EventDispatcher<Data>>::process_events
at /home/atassis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/calloop-0.13.0/src/sources/mod.rs:326:9
13: calloop::loop_logic::EventLoop<Data>::dispatch_events
at /home/atassis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/calloop-0.13.0/src/loop_logic.rs:445:31
14: calloop::loop_logic::EventLoop<Data>::dispatch
at /home/atassis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/calloop-0.13.0/src/loop_logic.rs:559:9
15: calloop::loop_logic::EventLoop<Data>::run
at /home/atassis/.cargo/registry/src/index.crates.io-6f17d22bba15001f/calloop-0.13.0/src/loop_logic.rs:596:13
16: <gpui::platform::linux::wayland::client::WaylandClient as gpui::platform::linux::platform::LinuxClient>::run
at crates/gpui/src/platform/linux/wayland/client.rs:655:9
17: gpui::platform::linux::platform::<impl gpui::platform::Platform for P>::run
at crates/gpui/src/platform/linux/platform.rs:153:9
18: gpui::app::App::run
at crates/gpui/src/app.rs:140:9
19: zed::main
at crates/zed/src/main.rs:382:5
20: core::ops::function::FnOnce::call_once
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/ops/function.rs:250:5
21: std::sys_common::backtrace::__rust_begin_short_backtrace
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/sys_common/backtrace.rs:155:18
22: std::rt::lang_start::{{closure}}
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/rt.rs:159:18
23: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/core/src/ops/function.rs:284:13
std::panicking::try::do_call
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:559:40
std::panicking::try
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:523:19
std::panic::catch_unwind
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panic.rs:149:14
std::rt::lang_start_internal::{{closure}}
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/rt.rs:141:48
std::panicking::try::do_call
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:559:40
std::panicking::try
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panicking.rs:523:19
std::panic::catch_unwind
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/panic.rs:149:14
std::rt::lang_start_internal
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/rt.rs:141:20
24: std::rt::lang_start
at /rustc/129f3b9964af4d4a709d1383930ade12dfe7c081/library/std/src/rt.rs:158:17
25: main
26: __libc_start_call_main
27: __libc_start_main_impl
28: _start
```
This error was happening when I started typing. This PR fixes this
error.
Fedora 40, latest kernel, gnome 46, wayland.
Release Notes:
- N/A
This is should be a no-op, whitespace formatting only.
Removes 425 lines of excess whitespace in our default keymap json files.
Release Notes:
- Improved formatting of default keymaps (single line per bind)
This PR updates the default settings to treat Nix's `flake.lock` files
as JSON.
Resolves https://github.com/zed-extensions/nix/issues/2.
Release Notes:
- Nix's `flake.lock` files are now automatically identified as JSON.
Sets up the `cmd-enter` keybinding for the jupyter repl to only apply
when enabled.
Release Notes:
- N/A
---------
Co-authored-by: Kirill <kirill@zed.dev>
The current version of the extension tries to download the Windows
binary files for lua-language-server like this:
`lua-language-server-3.9.3-win32-x64.tar.gz`
The [Windows binary
files](https://github.com/LuaLS/lua-language-server/releases) are only
released as zip archives, so it will fail to get the required files.
This pr changes the following:
- Add check for Windows specific zip archive
- Add check for Windows specific .exe executable
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This PR updates the extension API to use structured slash command
completions instead of plain strings.
This allows slash commands defined in extensions to take advantage of
the improvements made in #13876.
Release Notes:
- N/A
This PR improves the completions for arguments in the `/docs` slash
command.
We achieved this by extending the `complete_argument` method on the
`SlashCommand` trait to return a `Vec<ArgumentCompletion>` instead of a
`Vec<String>`.
In addition to the completion `label`, `ArgumentCompletion` has two new
fields that are can be used to customize the completion behavior:
- `new_text`: The actual text that will be inserted when the completion
is accepted, which may be different from what is shown by the completion
label.
- `run_command`: Whether the command is run when the completion is
accepted. This can be set to `false` to allow accepting a completion
without running the command.
Release Notes:
- N/A
---------
Co-authored-by: Antonio <antonio@zed.dev>
This PR replaces the usage of `unzip` for extracting `.zip` files
downloaded by extensions with extraction via a library.
This will allow us to extract `.zip` files even if `unzip` is not
available (e.g., on Windows).
Release Notes:
- Removed the need for `unzip` to be present on the system to extract
`.zip` files downloaded by extensions.
Initial runtimes UI panel. The main draw here is that all message
subscription occurs with two background tasks that run for the life of
the kernel. Follow on to #12062
* [x] Disable previous cmd-enter behavior only if runtimes are enabled
in settings
* [x] Only show the runtimes panel if it is enabled via settings
* [x] Create clean UI for the current sessions
### Running Kernels UI
<img width="205" alt="image"
src="https://github.com/zed-industries/zed/assets/836375/814ae79b-0807-4e23-bc95-77ce64f9d732">
* [x] List running kernels
* [x] Implement shutdown
* [x] Delete connection file on `drop` of `RunningKernel`
* [x] Implement interrupt
#### Project-specific Kernel Settings
- [x] Modify JupyterSettings to include a `kernel_selections` field
(`HashMap<String, String>`).
- [x] Implement saving and loading of kernel selections to/from
`.zed/settings.json` (by default, rather than global settings?)
#### Kernel Selection Persistence
- [x] Save the selected kernel for each language when the user makes a
choice.
- [x] Load these selections when the RuntimePanel is initialized.
#### Use Selected Kernels
- [x] Modify kernel launch to use the selected kernel for the detected
language.
- [x] Fallback to default behavior if no selection is made.
### Empty states
- [x] Create helpful UI for when the user has 0 kernels they can launch
and/or 0 kernels running
<img width="694" alt="image"
src="https://github.com/zed-industries/zed/assets/836375/d6a75939-e4e4-40fb-80fe-014da041cc3c">
## Future work
### Kernel Discovery
- Improve the kernel discovery process to handle various installation
methods (system, virtualenv, poetry, etc.).
- Create a way to refresh the available kernels on demand
### Documentation:
- Update documentation to explain how users can configure kernels for
their projects.
- Provide examples of .zed/settings.json configurations for kernel
selection.
### Kernel Selection UI
- Implement a new section in the RuntimePanel to display available
kernels.
- Group on the language name from the kernel specification
- Create a dropdown for each language group to select the default
kernel.
Release Notes:
- N/A
---------
Co-authored-by: Kirill <kirill@zed.dev>
Introduces the `ZED_WINDOW_DECORATIONS` env variable.
- Not set, defaulting to client-side decorations
- Value is "client": client-side decorations
- Value is "server": server-side decorations
I think it's good to have this escape-hatch next to all possible
detection mechanisms.
Release Notes:
- N/A
As titled. The new example is consistent with the instructions in
"Configuring Zed". I verified that the example works as expected.
Release Notes:
- Update the instructions to set up external formatter for Python.
By leveraging the `_GTK_EDGE_CONSTRAINTS` atom we can get all four
booleans for the `Tiling` struct and figure out which side is free when
the window is tiled to half of the screen.
For the logic behind the `_GTK_EDGE_CONSTRAINTS` see:
-
8e9d13aa3b/src/x11/window-x11.c (L65-L75)
-
8e9d13aa3b/src/x11/window-x11.c (L1205-L1231)
(I used Claude 3.5 Sonnet with our code and these pieces from `mutter`
to generate the Rust code, that was pretty sweet)
This fixes the gap in the middle when a GPUI window is tiled to the left
and another window to the right.
It's not _perfect_ but it looks a lot better.
Here's a diff that makes it look better:
```diff
diff --git a/crates/gpui/examples/window_shadow.rs b/crates/gpui/examples/window_shadow.rs
index 122231f6b..7fa29dadc 100644
--- a/crates/gpui/examples/window_shadow.rs
+++ b/crates/gpui/examples/window_shadow.rs
@@ -72,8 +72,8 @@ impl Render for WindowShadow {
.when(!(tiling.top || tiling.left), |div| div.rounded_tl(rounding))
.when(!tiling.top, |div| div.pt(shadow_size))
.when(!tiling.bottom, |div| div.pb(shadow_size))
- .when(!tiling.left, |div| div.pl(shadow_size))
- .when(!tiling.right, |div| div.pr(shadow_size))
+ .when(!tiling.left, |div| div.pl(shadow_size - border_size))
+ .when(!tiling.right, |div| div.pr(shadow_size - border_size))
.on_mouse_move(|_e, cx| cx.refresh())
.on_mouse_down(MouseButton::Left, move |e, cx| {
let size = cx.window_bounds().get_bounds().size;
```
But that makes it look weird on Wayland, so I didn't do it.
I think it's fine for now. Chromium looks bad and has a gap, so we're
already better.
## Before
![before_1](https://github.com/zed-industries/zed/assets/1185253/875c5cdd-c0be-4295-beb0-bb9ba5beaa52)
![before_2](https://github.com/zed-industries/zed/assets/1185253/0b96be70-4c34-4e99-aeb2-ab741171ad14)
## After
![after_1](https://github.com/zed-industries/zed/assets/1185253/aa51da77-daf1-4ef8-a33f-a83731e0c7e1)
![after_2](https://github.com/zed-industries/zed/assets/1185253/8ce7902d-90b6-4f06-ba2c-626e643abe56)
Release Notes:
- N/A
This PR refactors the completion providers to only process a maximum
amount of completion requests at a time.
Also started refactoring language model providers to use traits, so it's
easier to allow specifying multiple providers in the future.
Release Notes:
- N/A
This fixes the issue of a tooltip covering the thing that the button has
revealed.
It also mirrors what other UI frameworks do. Chrome on Linux behaves the
same, and Safari does the same thing on macOS.
It fixes this:
![Screenshot from 2024-07-05
12-39-22](https://github.com/zed-industries/zed/assets/1185253/51ce4347-d12f-463a-9adb-da031fe2f751)
Release Notes:
- N/A
https://doc.rust-lang.org/cargo/reference/environment-variables.html
Some people (myself included) set this variable to have a single
directory to clean up (or whatever reason one might have for having a
single `target` directory). This changes the linux scripts to respect
that
Release Notes:
- N/A