Commit log

149e5fd Don't try to make project search and outline order match project panel (#20513)

Click to expand commit body
A straight alphabetical order is arguably clearer, and avoids a large
initial delay when searching large repos.

Release Notes:

- Fixed a long initial delay when performing a project search in a large
repository.

Max Brunsfeld created

97b542b Discover available python environments with Jupyter kernel support (#20467)

Click to expand commit body
![image](https://github.com/user-attachments/assets/7c042bc9-88be-4d7b-b63d-e5b555d54b18)

Closes #18291
Closes #16757
Closes #15563

Release Notes:

- Added support for kernelspecs based on python environments

Kyle Kelley created

6152230 Fix DynamicSpacing docs (#20509)

Click to expand commit body
In #20504 the CustomSpacing enum variants ended up not having docs. This
PR fixes that, now docs correctly show for variants.


https://github.com/user-attachments/assets/8cc409c9-7b71-4c21-a538-3fd5dded3e00

Release Notes:

- N/A

Nate Butler created

a47759f Add initial FreeBSD support (#20480)

Click to expand commit body
This PR adds initial support for FreeBSD
(https://github.com/zed-industries/zed/issues/15309). While there is
still work left to be done, it seems to be usable. As discussed by
@syobocat (https://github.com/zed-industries/zed/discussions/10247), the
changes were just adding ```target_os = "freebsd"``` to wherever it
checks if the OS is Linux.


![image](https://github.com/user-attachments/assets/80ea5b29-047f-4cbd-8263-42e5fa6c94b7)

Needs to be build with ```RUSTFLAGS="-C link-dead-code"```

Known Issues:
- There's an issue in ```crates/project/src/environment.rs``` where a
command fails because ```/bin/sh``` on FreeBSD doesn't support the
```-l``` option.

![image](https://github.com/user-attachments/assets/c3c38633-160f-4f47-8840-e3da67f6ebc8)
- The file/folder choosers provided by the ```ashpd``` crate don't work
on FreeBSD (at least with KDE). This isn't that bad since a fallback
dialog is used.

![image](https://github.com/user-attachments/assets/29373006-1eb9-4ed0-bd52-2d0047fab418)
 - Moving to trash won't work.
- Numerous tests fail (when running on FreeBSD). While I haven't looked
into this much, it appears that the corresponding features seem to work
fine.

Release Notes:

- Added initial support for FreeBSD

Caleb Heydon created

b5da119 Refactor rewrap test to use a test utility (#20424)

Click to expand commit body
Release Notes:

- N/A

Co-authored-by: Max <max@zed.dev>

Michael Sloan and Max created

ba743a1 Add setting to disable inline completions in language scopes (#20508)

Click to expand commit body
This adds a setting to disable inline completions in language scopes to,
for example, disable them in comments or strings.

This setting can be made per language.

Examples:

```json
{
  "languages": {
    "Go": {
      "inline_completions_disabled_in": ["comment", "string"]
    }
  }
}
```

```json
{
  "inline_completions_disabled_in": ["comment"]
}
```

Closes #9133

Release Notes:

- Added language setting to disable inline comments in certain scopes.
Example: `{"languages": {"Go": {"inline_completions_disabled_in":
["comment", "string"]}}}`

Co-authored-by: Bennet <bennet@zed.dev>

Thorsten Ball and Bennet created

9e7afe8 tailwind: Allow configuring the `rootFontSize` (#20500)

Click to expand commit body
This addresses this comment:
https://github.com/zed-industries/zed/pull/13923#issuecomment-2467213210

With the change in here it's now possible to use the following settings:

```json
{
  "lsp": {
    "tailwindcss-language-server": {
      "settings": {
        "rootFontSize": 50
      }
    }
  }
}
```

Closes https://github.com/zed-industries/zed/issues/10840

Release Notes:

- Added ability to configure `rootFontSize` for the
`tailwindcss-language-server`. Example settings: `{"lsp":
{"tailwindcss-language-server": {"settings": { "rootFontSize": 50}}}}`

Co-authored-by: Bennet <bennet@zed.dev>

Thorsten Ball and Bennet created

94d8ead Refactor Spacing into DynamicSpacing using proc macro (#20504)

Click to expand commit body
Density tracking issue: #18078 

This PR refactors our spacing system to use a more flexible and
maintainable approach. We've replaced the static `Spacing` enum with a
dynamically generated `DynamicSpacing` enum using a proc macro.

Enum variants now use a `BaseXX` format, where XX = the pixel value @
default rem size and the default UI density.

For example:

`CustomSpacing::Base16` would return 16px at the default UI scale &
density.

I'd love to find another name other than `Base` that is clear (to avoid
base_10, etc confusion), let me know if you have any ideas!

Changes:

- Introduced a new `derive_dynamic_spacing` proc macro to generate the
`DynamicSpacing` enum
- Updated all usages of `Spacing` to use the new `DynamicSpacing`
- Removed the `custom_spacing` function, mapping previous usages to
appropriate `DynamicSpacing` variants
- Improved documentation and type safety for spacing values

New usage example:

```rust
.child(
    div()
        .flex()
        .flex_none()
        .m(DynamicSpacing::Base04.px(cx))
        .size(DynamicSpacing::Base16.rems(cx))
        .children(icon),
)
```

vs old usage example:

```
.child(
    div()
        .flex()
        .flex_none()
        .m(Spacing::Small.px(cx))
        .size(custom_spacing(px(16.)))
        .children(icon),
)
```

Release Notes:

- N/A

Nate Butler created

93ab6ad logs: Reduce log noise by using more debug logs (#20498)

Click to expand commit body
Release Notes:

- N/A

Thorsten Ball created

45bbfe0 python: Fix toolchains not getting picked up after workspace deserialization (#20488)

Click to expand commit body
Closes #20476

Release Notes:

- Fixed a bug in toolchain selector that caused it to not pick up venvs
for tabs before user interacted with them.
- Fixed a bug in language selector that caused it to pick up Markdown as
the language for a buffer up until the tab was interacted with.

Piotr Osiewicz created

be8cc11 language server logs: Fix missing menu entries when using remoting (#20495)

Click to expand commit body
This fixes the language server log menu only showing a single entry when
using SSH remoting.

Culprit was the `return menu;` statement that should've been a
`continue;`

Rest of the change is just refactoring.

Release Notes:

- Fixed `language server logs` menu only showing a single entry when
using SSH remoting.

Co-authored-by: Bennet <bennet@zed.dev>

Thorsten Ball and Bennet created

a97ab5e language servers: Fix wrong language server name (#20428)

Click to expand commit body
This fixes the issue of multiple language servers showing up as `node`
in the language server logs dropdown.

It does this by changing `language_server.name()` to return the
adapter's name, not the binary name, and changing types to make sure
that we always use this.

Release Notes:

- Fixed language server names showing up only as `"node"`

---------

Co-authored-by: Sam Rose <hello@samwho.dev>
Co-authored-by: Bennet <bennet@zed.dev>

Thorsten Ball , Sam Rose , and Bennet created

f4024cc Fix excerpt jumps using selections, not the match data (#20491)

Click to expand commit body
Fixes
https://github.com/zed-industries/zed/pull/20469#issuecomment-2466805325

Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennet@zed.dev>

Kirill Bulatov and Bennet created

1460249 docs: Update msys2 section (#20478)

Click to expand commit body
now Zed is available in MINGW64 repository as well

Release Notes:

- N/A

Maksim Bondarenkov created

da7670c assistant: Track completions for each CodegenAlternative (#19999)

Click to expand commit body
Release Notes:

- N/A

Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>

Adam Wolff and Bennet Bo Fenner created

ebdc255 Add additional instructions to issue templates (#20473)

Click to expand commit body
Release Notes:

- N/A

Joseph T. Lyons created

4d49a85 image viewer: Ensure images can never be loaded twice (#20472)

Click to expand commit body
Follow up to #20374, this prevents a race condition where we could load
images twice.

Release Notes:

- N/A

Bennet Bo Fenner created

0dbda71 Enable reload of images in image viewer (#20374)

Click to expand commit body
Closes #11529

Release Notes:

- Fixed an issue where the image preview would not update when the
underlying file changed

---------

Co-authored-by: Bennet <bennet@zed.dev>

Will Bradley and Bennet created

f332099 lsp: Track completion triggers for each language separately (#20471)

Click to expand commit body
This PR improves how we handle completions in buffers with multiple
LSPs.

Context: while working on
https://github.com/zed-industries/zed/issues/19777 with @mgsloan we
noticed that completion triggers coming from language servers are not
tracked properly. Namely, each buffer has `completion_triggers` field
which is read from the configuration of a language server. The problem
is, there can be multiple language servers for a single buffer, in which
case we'd just stick to the one that was registered last.

This PR makes the tracking a bit more fine-grained. We now track not
only what the completion triggers are, but also their origin server id.
Whenever completion triggers are updated, we recreate the completion
triggers set.
Release Notes:

- Fixed completions not triggering when multiple language servers are
used for a single file.

Piotr Osiewicz created

2b7ee1e Debounce runnable refreshes in the editor (#20470)

Kirill Bulatov created

767a825 Open all kinds of files from multi buffers' headers (#20469)

Click to expand commit body
Closes https://github.com/zed-industries/zed/issues/11661

Release Notes:

- Fixed multi buffer headers not able to jump to untitled files

Kirill Bulatov created

ba8f027 editor: Fix toggle_comment in readonly mode (#20464)

Click to expand commit body
Closes #20459

Release Notes:

- Fixed comments toggle in readonly mode

Antar created

0a28800 Add preview for Checkbox with Label (#20448)

Click to expand commit body
Add previews for Checkbox with Label.

Merge checkbox components.

Release Notes:

- N/A

Nate Butler created

31a6ee0 Add `ui::table` (#20447)

Click to expand commit body
This PR adds the `ui::Table` component.

It has a rather simple API, but cells can contain either strings or
elements, allowing for some complex uses.

Example usage:

```rust
Table::new(vec!["Product", "Price", "Stock"])
    .width(px(600.))
    .striped()
    .row(vec!["Laptop", "$999", "In Stock"])
    .row(vec!["Phone", "$599", "Low Stock"])
    .row(vec!["Tablet", "$399", "Out of Stock"])
```

For more complex use cases, the table supports mixed content:

```rust
Table::new(vec!["Status", "Name", "Priority", "Deadline", "Action"])
    .width(px(840.))
    .row(vec![
        element_cell(Indicator::dot().color(Color::Success).into_any_element()),
        string_cell("Project A"),
        string_cell("High"),
        string_cell("2023-12-31"),
        element_cell(Button::new("view_a", "View").style(ButtonStyle::Filled).full_width().into_any_element()),
    ])
    // ... more rows
```

Preview:

![CleanShot 2024-11-08 at 20 53
04@2x](https://github.com/user-attachments/assets/b39122f0-a29b-423b-8e24-86ab4c42bac2)

This component is pretty basic, improvements are welcome!

Release Notes:

- N/A

Nate Butler created

1f974d0 Set up editor actions after workspace not on stack (#20445)

Click to expand commit body
Release Notes:

- N/A

Co-authored-by: Conrad Irwin <conrad@zed.dev>

Kyle Kelley and Conrad Irwin created

7212594 Add shortcuts for 'open settings' and 'revert selected hunks' to Jetbrains keymap (#20414)

Elias Müller created

d605d19 Use a different keybinding for editor::AcceptPartialInlineCompletion action (Linux) (#20443)

Click to expand commit body
Follow-up of https://github.com/zed-industries/zed/pull/20419

Release Notes:

- - (breaking change) Use `ctrl-right` instead of `cmd-right` as a macOS
default for `editor::AcceptPartialInlineCompletion` (Linux)

Kirill Bulatov created

f92e6e9 Add support for context server extensions (#20250)

Click to expand commit body
This PR adds support for context servers provided by extensions.

To provide a context server from an extension, you need to list the
context servers in your `extension.toml`:

```toml
[context_servers.my-context-server]
```

And then implement the `context_server_command` method to return the
command that will be used to start the context server:

```rs
use zed_extension_api::{self as zed, Command, ContextServerId, Result};

struct ExampleContextServerExtension;

impl zed::Extension for ExampleContextServerExtension {
    fn new() -> Self {
        ExampleContextServerExtension
    }

    fn context_server_command(&mut self, _context_server_id: &ContextServerId) -> Result<Command> {
        Ok(Command {
            command: "node".to_string(),
            args: vec!["/path/to/example-context-server/index.js".to_string()],
            env: Vec::new(),
        })
    }
}

zed::register_extension!(ExampleContextServerExtension);
```

Release Notes:

- N/A

Marshall Bowers created

ff4f679 macOS: Add key equivalents for non-Latin layouts (#20401)

Click to expand commit body
Closes  #16343
Closes #10972

Release Notes:

- (breaking change) On macOS when using a keyboard that supports an
extended Latin character set (e.g. French, German, ...) keyboard
shortcuts are automatically updated so that they can be typed without
`option`. This fixes several long-standing problems where some keyboards
could not type some shortcuts.
- This mapping works the same way as
[macOS](https://developer.apple.com/documentation/swiftui/view/keyboardshortcut(_:modifiers:localization:)).
For example on a German keyboard shortcuts like `cmd->` become `cmd-:`,
`cmd-[` and `cmd-]` become `cmd-ö` and `cmd-ä`. This mapping happens at
the time keyboard layout files are read so the keybindings are visible
in the command palette. To opt out of this behavior for your custom
keyboard shortcuts, set `"use_layout_keys": true` in your binding
section. For the mappings used for each layout [see
here](https://github.com/zed-industries/zed/blob/a890df1863ca939ee7f0ada6e629b6f83eb18bc5/crates/settings/src/key_equivalents.rs#L7).

---------

Co-authored-by: Will <will@zed.dev>

Conrad Irwin and Will created

0782108 macOS: Allow non-cmd keyboard shortcuts to work on non-Latin layouts (#20336)

Click to expand commit body
Updates #10972

Release Notes:

- Fixed builtin keybindings that don't require cmd on macOS, non-Latin,
ANSI layouts. For example you can now use ctrl-ա (equivalent to ctrl-a)
on an Armenian keyboard to get to the beginning of the line.

---------

Co-authored-by: Will <will@zed.dev>

Conrad Irwin and Will created

09c5993 Put context servers behind a trait (#20432)

Click to expand commit body
This PR puts context servers behind the `ContextServer` trait to allow
us to provide context servers from an extension.

Release Notes:

- N/A

Marshall Bowers created

0150351 Fix line number whitespace (#20427)

Click to expand commit body
Closes #14025


https://github.com/user-attachments/assets/24b3f321-8246-4203-9510-66a7cf3d22f0

Release Notes:

- Fixed bug where toggling line numbers would incorrectly hide
whitespace indicators.

Richard Feldman created

8bc5bcf assistant: Fix completions for slash commands provided by context servers (#20423)

Click to expand commit body
This PR fixes an issue introduced in #20372 that was causing slash
commands provided by context servers to not show up in the completions
menu.

Release Notes:

- N/A

Marshall Bowers created

983bb5c Use a different keybinding for `editor::AcceptPartialInlineCompletion` action (#20419)

Click to expand commit body
Both `editor::AcceptPartialInlineCompletion` and the keybinding for
`editor::MoveToEndOfLine` had the same keybinding inside the editor, and
with Supermaven's fast proposals, it's been very frequently used
incorrectly.

Closes #ISSUE

Release Notes:

- (breaking change) Use `ctrl-right` instead of `cmd-right` as a macOS
default for `editor::AcceptPartialInlineCompletion`

Kirill Bulatov created

653b2dc project panel: Stop flickering border when preview tabs disabled (#20417)

Click to expand commit body
PR #20154 changed the project panel to focus the editor on click in case
preview tabs are disabled.

That lead to a flickering behavior: on mouse-down the border of the
still-selected entry in the project panel would flash, only to disappear
as soon as the entry was opened and editor focused.

This change fixes it by manually keeping track of the mouse-down state,
because we couldn't find a better solution that allows us to simply not
show the border while a "click" is going on.

Release Notes:

- Fixed project panel entries flickering the border when user clicks on
another entry to open it (when preview tabs are disabled.)

Co-authored-by: Piotr <piotr@zed.dev>

Thorsten Ball and Piotr created

7142d37 Add edit events for assistant panel and inline assist (#20418)

Click to expand commit body
Release Notes:

- N/A

Joseph T. Lyons created

01e12c0 project panel: Mark entries when opening in project panel (#20412)

Click to expand commit body
This addresses #17746 by marking entries when they're opened in the
project panel.

I think that was the original intention behind the code too, because it
explicitly marks entries before opening them. An event that is emitted
by the workspace reset the mark though.

So what I did was try to emulate the logic I saw in VS Code: when
opening the file, mark it, when the active entry changes, unmark it,
except if you explicitly marked a group of files.

Closes #17746

Release Notes:

- Changed project panel to mark files when opening them, which should
make it more intuitive to mark multiple files after opening a single
one.

Thorsten Ball created

706c385 Register repl actions with editor after session started (#20396)

Click to expand commit body
Makes repl actions that are specific to running kernels only come up
after a session has been started at least once for the editor.

Release Notes:

- Only show session oriented `repl::` actions for editors after a
session has been created

Kyle Kelley created

edb89d8 project panel: Fix preview tabs not working when enabled (#20416)

Click to expand commit body
PR #20154 introduced a regression and essentially disabled preview tabs
in code.

This fixes it and restores the old preview tabs behavior.

Release Notes:

- Fixed preview tabs being disabled in code, even if they were enabled
in the settings.

Co-authored-by: Piotr <piotr@zed.dev>

Thorsten Ball and Piotr created

09675d4 Disable repl in non-local projects (#20397)

Click to expand commit body
Release Notes:

- Disable REPL buttons and actions for remote projects and collaboration
(only the host should have access).

Kyle Kelley created

187356a assistant: Show only configured models in the model picker (#20392)

Click to expand commit body
Closes https://github.com/zed-industries/zed/issues/16568

This PR introduces some changes to how we display models in the model
selector within the assistant panel. Basically, it comes down to this:

- If you don't have any provider configured, you should see _all_
available models in the picker
- But, once you've configured some, you should _only_ see models from
them in the picker

Visually, nothing's changed much aside from the added "Configured
Models" label at the top to ensure the understanding that that's a list
of, well, configured models only. 😬

<img width="700" alt="Screenshot 2024-11-07 at 23 42 41"
src="https://github.com/user-attachments/assets/219ed386-2318-43a6-abea-1de0cda8dc53">

Release Notes:

- Change model selector in the assistant panel to only show configured
models

Danilo Leal created

435708b assistant: Fine-tune crease feedback design (#20395)

Click to expand commit body
Closes https://github.com/zed-industries/zed/issues/13414

Just polishing up how some of these look. Ever since the issue was
opened, we added the "Error" label to the button, as well as
automatically popping open the toast error whenever that happens.
Lastly, there's a tooltip in there as well indicating that you can click
on it to see the details of the error.

<img width="700" alt="Screenshot 2024-11-08 at 00 26 27"
src="https://github.com/user-attachments/assets/ad0962e6-4621-4e8b-be0d-103d71fcf2e6">

Release Notes:

- N/A

Danilo Leal created

2fe9cd8 Fix regression in producing sections when converting `SlashCommandOutput` to event stream (#20404)

Click to expand commit body
Closes #20243 

Release Notes:

- N/A

Antonio Scandurra created

8cc3ce1 Fix extension tests on release branches (#20307)

Click to expand commit body
Co-Authored-By: Max <max@zed.dev>
cc @maxdeviant

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>

Conrad Irwin and Max created

6ad8c4a Restore ctrl-b/f (#20399)

Click to expand commit body
Follow up from #20378

Release Notes:

- N/A

Conrad Irwin created

30a94fa context_servers: Fix tool/list and prompt/list (#20387)

Click to expand commit body
There are two issues with too/list and prompt/list at the moment. We
serialize params to `null`, which is not correct according to
context_server spec. While it IS allowed by JSON RPC spec to omit
params, it turns out some servers currently missbehave and don't respect
this. So we do two things

- We omit params if it would be a null value in json.
- We explicitly set params to {} for tool/list and prompt/list to avoid
it being omitted.

Release Notes:

- N/A

David Soria Parra created

36fe364 Show kernel options in a picker (#20274)

Click to expand commit body
Closes #18341

* [x] Remove "Change Kernel" Doc link from REPL menu
* [x] Remove chevron
* [x] Set a higher min width
* [x] Include the language along with the kernel name

Future PRs will address

* Add support for Python envs (#18291, #16757, #15563)
* Add support for Remote kernels
* Project settings support (#16898)

Release Notes:

- Added kernel picker for repl

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>

Kyle Kelley and Nate Butler created

f6d4a73 terminal: Prevent `[]` from being sanitized into clickable file link (#20386)

Click to expand commit body
This PR prevents `[]` from being sanitized into an empty string and thus
becoming a "valid", clickable file link in the integrated terminal.


Whenever you type `[]` into the terminal and hover over it while
pressing `cmd`, an empty popup appears and the cursor indicates that
this is a clickable element. Once you click on the brackets, the
worktree root is selected and focused within the file picker.

<img width="87" alt="grafik"
src="https://github.com/user-attachments/assets/01790323-88be-4373-a1ec-a345bcf2521e">


This is because in #2906 support was added for sanititzing file links
like `[/some/path/[slug].tsx]` to `/some/path/[slug].tsx`. In the case
`[]` where an empty string is returned from the sanitation, the string
is considered a valid file path and thus `[]` becomes a valid and
clickable navigation target.

Given that this an edge-case just for this specific one set of brackets
and otherwise no empty strings are matched from the regexes `URL_REGEX`
and `WORD_REGEX`, it seemed that this was the best place to fix this
bug.

Release Notes:

- `[]` is no longer considered a clickable link in the terminal

Finn Evers created

7e7f25d Scope slash commands, context servers, and tools to individual Assistant Panel instances (#20372)

Click to expand commit body
This PR reworks how the Assistant Panel references slash commands,
context servers, and tools.

Previously we were always reading them from the global registries, but
now we store individual collections on each Assistant Panel instance so
that there can be different ones registered for each project.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Joseph <joseph@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>

Marshall Bowers , Max , Antonio , Joseph , and Max Brunsfeld created

176314b Improve outline panel keyboard navigation (#20385)

Click to expand commit body
Closes https://github.com/zed-industries/zed/issues/20187

Make outline panel more eager to open its entries:

* scroll editor to selected outline entries (before it required an extra
`"outline_panel::Open", { "change_selection": false }` action call)
* make any `Open` action call to behave like `"outline_panel::Open", {
"change_selection": true }` and remove the redundant parameter.
Now opening an entry is equal to double clicking the same entry: the
editor gets scrolled and its selection changes
* add a way to open entries the same way as excerpts are open in multi
buffers (will open the entire file, scroll and place the caret)

* additionally, fix another race issue that caused wrong entry to be
revealed after the selection change

Release Notes:

- Improved outline panel keyboard navigation

Kirill Bulatov created