Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lsp: Use Path instead of String for path handling #22762

Merged
merged 10 commits into from
Jan 19, 2025

Conversation

JunkuiZhang
Copy link
Contributor

During my work on PR #22616, while trying to fix the test_reporting_fs_changes_to_language_servers test case, I noticed that we are currently handling paths using String in some places. However, this approach causes issues on Windows.

This draft PR modifies rebuild_watched_paths_inner and glob_literal_prefix. For example, take the glob_literal_prefix function modified in this PR:

assert_eq!(
    glob_literal_prefix("node_modules/**/*.js"), 
    "node_modules"
);    // This works on Unix, fails on Windows

assert_eq!(
    glob_literal_prefix("node_modules\\**\\*.js"), 
    "node_modules"
);    // This works on Windows

assert_eq!(
    glob_literal_prefix("node_modules\\**/*.js"), 
    "node_modules"
);    // This fails on Windows

The current implementation treats path as String and relies on \ as the path separator on Windows, but on Windows, both / and \ can be used as separators. This means that node_modules\**/*.js is also a valid path representation.

There are two potential solutions to this issue:

  1. Continue handling paths with String, and on Windows, replace all / with \.
  2. Use Path for path handling, which is the solution implemented in this PR.

Advantages of Solution 1:

  • Simple and direct.

Advantages of Solution 2:

  • More robust, especially in handling strip_prefix.

Currently, the logic for removing a path prefix looks like this:

let path = "/some/path/to/file.rs";
let parent = "/some/path/to";
// remove prefix
let file = path.strip_prefix(parent).unwrap();    // which is `/file.rs`
let file = file.strip_prefix("/").unwrap();

However, using Path simplifies this process and makes it more robust:

let path = Path::new("C:/path/to/src/main.rs");
let parent = Path::new("C:/path/to/src"); 
let file = path.strip_prefix(&parent).unwrap(); // which is `main.rs`

let path = Path::new("C:\\path\\to/src/main.rs");
let parent = Path::new("C:/path/to\\src\\"); 
let file = path.strip_prefix(&parent).unwrap(); // which is `main.rs`

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 7, 2025
@maxdeviant maxdeviant changed the title Lsp: Use Path instead of String for path handling lsp: Use Path instead of String for path handling Jan 7, 2025
crates/project/src/project_tests.rs Show resolved Hide resolved
crates/project/src/lsp_store.rs Outdated Show resolved Hide resolved
crates/project/src/lsp_store.rs Outdated Show resolved Hide resolved
crates/project/src/lsp_store.rs Outdated Show resolved Hide resolved
crates/project/src/lsp_store.rs Outdated Show resolved Hide resolved
@SomeoneToIgnore SomeoneToIgnore self-assigned this Jan 13, 2025
@SomeoneToIgnore
Copy link
Contributor

Besides ongoing discussion, what needs to be done to undraft this issue?

Copy link
Contributor

@SomeoneToIgnore SomeoneToIgnore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, looks good.
Left a note about one small NIT we can fix before merging.

crates/project/src/lsp_store.rs Outdated Show resolved Hide resolved
@SomeoneToIgnore SomeoneToIgnore merged commit 7302be8 into zed-industries:main Jan 19, 2025
12 checks passed
@JunkuiZhang JunkuiZhang deleted the lsp/paths branch January 20, 2025 02:48
Anthony-Eid added a commit to RemcoSmitsDev/zed that referenced this pull request Jan 29, 2025
* nix: Update nix flake (#23343)

Closes #23342 

Ran `nix flake update` and did some cleanup in shell.nix to follow nix
[best
practices](https://discourse.nixos.org/t/how-to-solve-libstdc-not-found-in-shell-nix/25458/6).

Prior to running `nix flake update`
`strings "$(echo "$LD_LIBRARY_PATH" | tr : "\n" | grep
"gcc")/libstdc++.so.6" | grep "CXXABI_1.3.15" CXXABI_1.3.15`
Does not find `CXXABI_1.3.15`

After running `nix flake update`

`strings "$(echo "$LD_LIBRARY_PATH" | tr : "\n" | grep
"gcc")/libstdc++.so.6" | grep "CXXABI_1.3.15" CXXABI_1.3.15`
Finds `CXXABI_1.3.15`

Launching Zed 0.168.3 inside Zed's nix development shell now launches
with no errors.

Release Notes:

- N/A

* Update actions/upload-artifact digest to 65c4c4a (#23197)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[actions/upload-artifact](https://redirect.github.com/actions/upload-artifact)
| action | digest | `6f51ac0` -> `65c4c4a` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* lsp: Use `Path` instead of `String` for path handling (#22762)

During my work on PR #22616, while trying to fix the
`test_reporting_fs_changes_to_language_servers` test case, I noticed
that we are currently handling paths using `String` in some places.
However, this approach causes issues on Windows.

This draft PR modifies `rebuild_watched_paths_inner` and
`glob_literal_prefix`. For example, take the `glob_literal_prefix`
function modified in this PR:

```rust
assert_eq!(
    glob_literal_prefix("node_modules/**/*.js"), 
    "node_modules"
);    // This works on Unix, fails on Windows

assert_eq!(
    glob_literal_prefix("node_modules\\**\\*.js"), 
    "node_modules"
);    // This works on Windows

assert_eq!(
    glob_literal_prefix("node_modules\\**/*.js"), 
    "node_modules"
);    // This fails on Windows
```

The current implementation treats path as `String` and relies on `\` as
the path separator on Windows, but on Windows, both `/` and `\` can be
used as separators. This means that `node_modules\**/*.js` is also a
valid path representation.

There are two potential solutions to this issue:

1. **Continue handling paths with `String`**, and on Windows, replace
all `/` with `\`.
2. **Use `Path` for path handling**, which is the solution implemented
in this PR.

### Advantages of Solution 1:
- Simple and direct.

### Advantages of Solution 2:
- More robust, especially in handling `strip_prefix`.

Currently, the logic for removing a path prefix looks like this:

```rust
let path = "/some/path/to/file.rs";
let parent = "/some/path/to";
// remove prefix
let file = path.strip_prefix(parent).unwrap();    // which is `/file.rs`
let file = file.strip_prefix("/").unwrap();
```

However, using `Path` simplifies this process and makes it more robust:

```rust
let path = Path::new("C:/path/to/src/main.rs");
let parent = Path::new("C:/path/to/src"); 
let file = path.strip_prefix(&parent).unwrap(); // which is `main.rs`

let path = Path::new("C:\\path\\to/src/main.rs");
let parent = Path::new("C:/path/to\\src\\"); 
let file = path.strip_prefix(&parent).unwrap(); // which is `main.rs`
```

Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <[email protected]>

* workspace: Add action to move focused panel to next dock position (#23317)

This Pull Request introduces a new command `workspace: move focused
panel to next position` which finds the currently focused panel, if such
panel exists, and moves it to the next valid dock position, following
the order of `Left → Bottom → Right` and then starting again from the
left position.

In order to achieve this the following changes have been introduced:

* Add a new default implementation for `PanelHandle`, namely
`PanelHandle::move_to_next_position` which leverages
`PanelHandle::position`, `PanelHandle::position_is_valid` and
`PanelHandle::set_position` methods to update the panel's position to
the next valid position.
* Add a new method to the `workspace` module, `
move_focused_panel_to_next_position`, which is responsible for finding
the currently focused panel, if such a panel exists, and calling the
`move_to_next_position` method in the panel's handle.
* Add a new action to the `workspace` module,
`MoveFocusedPanelToNextPosition`, which is handled by the
`move_focused_panel_to_next_position` method.

Tests have also been added to the `workspace` module in order to
guarantee that the action is correctly updating the focused panel's
position.

Here's a quick video of it, in action 🔽 


https://github.com/user-attachments/assets/264d382b-5239-40aa-bc5e-5d569dec0734

Closes #23115 

Release Notes:

- Added new command to move the focused panel to the next valid dock
position – `workspace: move focused panel to next position` .

* workspace: Add actions for cycling between windows (#23356)

Closes #22740

I haven't assigned any default keybindings to these actions because it
might conflict with existing OS bindings.

Preview:


https://github.com/user-attachments/assets/7c62cb34-2747-4674-a278-f0998e7d17f9

Release Notes:

- Added `workspace::ActivateNextWindow` and
`workspace::ActivatePreviousWindow` actions for cycling between windows.

* tab_switcher: Preserve selected position on closed tabs (#22861)

When the user closes a tab, the tab switcher will now select the tab at
the same position. This feature is especially relevant for keyboard
users when you want to close multiple consecutive tabs with
`<Ctrl-Backspace>`.

Please see the discussion at
https://github.com/zed-industries/zed/discussions/22791 for full
motivation and the quick demo.

Release Notes:

- tab_switcher: Preserve selected position when tab is closed

* keybindings: Fix AcceptPartialInlineCompletion on macOS (#23357)

Related issue: https://github.com/zed-industries/zed/issues/20167

Release Notes:

- Changed the default keybinding to accept partial inline completions
from `ctrl-right` to `ctrl-cmd-right` on macOS, because `ctrl-right` is
already bound to jump to the end of the line.

Co-authored-by: Antonio <[email protected]>
Co-authored-by: Kirill <[email protected]>
Co-authored-by: Bennet <[email protected]>

* Require accepting ToS when enabling zeta (#23255)

Note: Design hasn't been reviewed yet, but the logic is done

When the user switches the inline completion provider to `zed`, we'll
show a modal prompting them to accept terms if they haven't done so:


https://github.com/user-attachments/assets/3fc6d368-c00a-4dcb-9484-fbbbb5eb859e

If they dismiss the modal, they'll be able to get to it again from the
inline completion button:


https://github.com/user-attachments/assets/cf842778-5538-4e06-9ed8-21579981cc47

This also stops zeta sending requests that will fail immediately when
ToS are not accepted.

Release Notes:

- N/A

---------

Co-authored-by: Richard <[email protected]>
Co-authored-by: Danilo Leal <[email protected]>
Co-authored-by: Joao <[email protected]>

* assistant2: Adjust "Recent" header label design in context picker (#23364)

Just a little design fine-tune.

| Before | After |
|--------|--------|
| <img width="454" alt="Screenshot 2025-01-20 at 12 13 10 PM"
src="https://github.com/user-attachments/assets/b27372f2-00f5-40f4-927d-0d831ec4b90d"
/> | <img width="454" alt="Screenshot 2025-01-20 at 12 12 17 PM"
src="https://github.com/user-attachments/assets/207d08da-d75e-4c60-a6eb-cb1549b5925c"
/> |

Release Notes:

- N/A

* assistant2: Update message editor placeholder (#23363)

To make the mention and keyboard navigability discoverable.

Release Notes:

- N/A

* git_ui: Capitalize co-author prefix (#23365)

This PR capitalizes the co-author prefix, as this is the way GitHub
writes it in their
[docs](https://docs.github.com/en/pull-requests/committing-changes-to-your-project/creating-and-editing-commits/creating-a-commit-with-multiple-authors#creating-co-authored-commits-on-the-command-line).

Release Notes:

- N/A

* Update `.mailmap` (#23366)

This PR updates the `.mailmap` file to merge some more commit authors.

Release Notes:

- N/A

* python: Add capture groups for builtin types, builtin attribute decorators, class inheritance, function arguments and definition keywords (#21454)

Add capture groups for builtin types, builtin attribute decorators,
class inheritance, function arguments and definition keywords.

Related to #14892 

Release Notes:

- Improved syntax highlight for Python: new capture groups for
`@function.arguments`, `@function.kwargs`, `@type.class.inheritance`,
`@keyword.definition`, `@attribute.builtin` and `@type.builtin`.

* Fix older Anthropic models not supporting `-latest` tags (#23372)

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

* git: Skip directories in git status output (#23300)

The output of `git status --porcelain=v1` includes untracked
directories, i.e. directories that have no tracked files beneath. Since
we have our own way of computing a "summary" status for each directory
in a repo, this is not helpful for Zed; and it interferes with our
handling of nested repos. So just skip these lines in the output.

Closes #23133 

Release Notes:

- Fix project panel colors when one git repository is nested beneath
another

* Document `KeymapFile` and `KeymapSection` for display in hovers (#23375)

Release Notes:

- N/A

* Add support for various action keys to Linux keymap (#22997)

Adds support for Cut, Copy, Paste, Undo, Redo, New, Open, Save, and Find
keys to the default keymap. These keys can be found on old keyboards,
but also custom layouts like
[Extend](https://dreymar.colemak.org/layers-extend.html).

Release Notes:

- Added support for the Cut, Copy, Paste, Undo, Redo, New, Open, Save,
and Find keys to the default keymap.

* Hide "Edit prediction" tooltip when menu is open (#23377)

Release Notes:

- N/A

* docs: Add troubleshooting section warning about RUSTFLAGS env var (#23354)

According to #23223, manually setting `RUSTFLAGS` env var overrides
settings in `.cargo/config.toml`. Since users possibly may set their own
`RUSTFLAGS` when building, this creates an avenue where builds may fail
for really strange reasons that are difficult to debug.

This PR adds notes to the troubleshooting section to avoid setting
`RUSTFLAGS`, and offers alternatives which do not conflict.

This problem most recently affected nightly CI builders since we had
been setting `RUSTFLAGS` in our workflows to enable custom things like
gles or compiling with a specific target cpu. PR #23117 caused builds to
fail unless they were compiled with `-C target-feature=+crt-static`,
which due to this issue the `RUSTFLAGS` env var we set overrode the
`config.toml` compile flags, causing our builds to fail.

Release Notes:

- N/A

* Toggle inline completion menu from keyboard (#23380)

* Prefer later bindings in keymap section for display in UI (#23378)

Closes #23015

Release Notes:

- Improved which keybindings are selected for display. Now later entries
within `bindings` will take precedence. The default keymaps have been
updated accordingly.

* Wire up `@mention`ed files in assistant2 (#23389)

`@mention`ed files in assistant2 now get replaced by the full path of
the file in what gets sent to the model, while rendering visually as
just the filename (in a crease, so they can only be selected/deleted as
a whole unit, not character by character).


https://github.com/user-attachments/assets/a5867a93-d656-4a17-aced-58424c6e8cf6

Release Notes:

- N/A

---------

Co-authored-by: João Marcos <[email protected]>
Co-authored-by: Conrad <[email protected]>

* windows: Fix FS-related issues (#23369)

I've noticed an occasional error: `ignoring event C:\some\path\to\file
outside of root path \\?\C:\some\path`. This happens because UNC paths
always fail to match with non-UNC paths during operations like
`strip_prefix` or `starts_with`. To address this, I changed the types of
some key parameters to `SanitizedPath`. With this adjustment, FS events
are now correctly identified, and under the changes in this PR, the
`test_rescan_and_remote_updates` test also passes successfully on
Windows.

Release Notes:

- N/A

* Display keymap errors on initial load (#23394)

Also fixes issue introduced in #23113 where changes to keyboard layout
would not cause reload of keymap configuration.

Closes #20531

Release Notes:

- N/A

* Fix project entry rename in Remote Development (#23382)

Closes #22883

To fix the problem, we move `handle_rename_project_entry` from
`Worktree` to `LspStore` and register it there. This way it becomes
available both in local and headless projects and this avoids the
duplication.

Release Notes:

- Fixed renaming project entries in Remote Development

* Show inline completion popover for hard to spot single edits (#23385)

If a suggested edit is a single character insert or a single line
deletion, we'll show the diff popover to make it stand out more.

Release Notes:

- N/A

Co-authored-by: Danilo <[email protected]>

* lsp_store: Do not associate a language server with the language for symbol highlighting (#23401)

This unblocks work on #22182; a single language server might actually be
required by multiple languages (think of e.g. C/C++,
Javascript/Typescript), in which case it doesn't make sense to use a
single grammar. We already use primary language of a buffer for
highlights and this PR makes this the only supported syntax highlighting
flavour for returned symbols.

Closes #ISSUE

Release Notes:

- N/A

* project_panel: Adjust entry background and border colors (#23403)

Follow up to https://github.com/zed-industries/zed/pull/22658

This PR ensures the background and border color of a project panel entry
is exactly the same with one exception: if the item is focused, active,
and not with mouse down. The point is to not be able to see the border
at all given they're there to act sort of akin to CSS's `outline` (which
doesn't add up to the box model).

Please let me know if there is any edge case I either messed up here or
didn't account for.


https://github.com/user-attachments/assets/29c74f6a-b027-4d19-a7de-b9614f0d7859

Release Notes:

- N/A

* zeta: Make the Jump to Edit callout pop up more (#23404)

| Before | After |
|--------|--------|
| <img width="1328" alt="Screenshot 2025-01-21 at 11 20 49 AM"
src="https://github.com/user-attachments/assets/ad8e3017-122a-4ebd-b1f5-5eb41cc3725a"
/> | <img width="1328" alt="Screenshot 2025-01-21 at 11 19 39 AM"
src="https://github.com/user-attachments/assets/a0dcbd52-6aca-43fa-97ee-6efde15c8bc1"
/> |

Release Notes:

- N/A

* Add emacs mark mode (#23297)

Updates #21927
Replaces https://github.com/zed-industries/zed/pull/22904
Closes #8580

Adds actions (default keybinds with emacs keymap):
- editor::SetMark (`ctrl-space` and `ctrl-@`)
- editor::ExchangeMark (`ctrl-x ctrl-x`)

Co-Authored-By: Peter <[email protected]>

Release Notes:

- Add Emacs mark mode (`ctrl-space` / `ctrl-@` to set mark; `ctrl-x
ctrl-x` to swap mark/cursor)
- Breaking change: `selection` keyboard context has been replaced with
`selection_mode`

---------

Co-authored-by: Peter <[email protected]>

* Fix completion labels becoming overly large due to LSP completion items with newlines (#23407)

Reworks https://github.com/zed-industries/zed/pull/23030 and
https://github.com/zed-industries/zed/pull/15087
Closes https://github.com/zed-industries/zed/issues/23352
Closes https://github.com/zed-industries/zed/issues/23310 

Zed's completion items use `label` from LSP completion items as a base
to show in the list:
https://github.com/zed-industries/zed/blob/d290da7dac922fdc67c4774cdd371fba23fe62e3/crates/project/src/lsp_store.rs#L4371-L4374

Besides that, certain language plugins append `detail` or
`label_details.description` as a suffix:
https://github.com/zed-industries/zed/blob/d290da7dac922fdc67c4774cdd371fba23fe62e3/crates/languages/src/vtsls.rs#L178-L188

Either of these 3 properties may return `\n` (or multiple) in it,
spoiling Zed's completion menu, which uses `UniformList` to render those
items: a uniform list uses common, minimum possible height for each
element, and `\n` bloats that overly.

Good approach would be to use something else:
https://github.com/zed-industries/zed/issues/21403 but that has its own
drawbacks and relatively hard to use instead (?).

We could follow VSCode's approach and move away all but `label` from
`CodeLabel.text` to the side, where the documentation is, but that does
not solve the issue with `details` having newlines.

So, for now, sanitize all labels and remove any newlines from them. If
newlines are found, also replace whitespace sequences if there's more
than 1 in a row.

Later, this approach can be improved similarly to how Helix and Zed's
inline completions do: rendering a "ghost" text, showing the
completion's edit applied to the editor.

Release Notes:

- Fixed completion labels becoming overly large due to LSP completion
items with newlines

* Fix pulling metadata out of broken symlinks (#22396)

## Problem

When developing extensions locally, developers will commonly put their
source code in a specific directory. Zed uses this directory to create a
symlink starting from `$HOME/Library/Application
Support/Zed/extensions/installed` (MacOS path). When a developer then
moves this source code and tries to reinstall the extension, Zed will
fail with an unhelpful message (you can check the #Testing section).

## Change Summary

With this PR, we fix this behaviour by handling broken symlinks
specifically when returning the metadata on `fs::metadata`. Today, we

1. Pull the symlink metadata.
2. Return it if the file was not a symlink OR if it is, pull the
metadata for the pointed file.

After this change gets merged, we return the Symlink metadata if the
symlink is broken. This makes the symlink be recreated since we remove
the symlink either way.

## Risks associated with this change

It's possible changing this behaviour will show additional cases where
we are handling broken symlinks incorrectly. I expect this to be a
better scenario AND backwards compatible. We have the same behaviour we
had for 1. existing symlinks 2. normal files.

## Testing

The way I have been reproducing this is by having a private extension of
my own. I install it using the `zed: install dev extension` command
after running `RUST_LOG=debug RUST_BACKTRACE=1 scripts/zed-local -1`.
Then I move the extension to a different directory.

Zed will now keeps a broken link on its `installed` directory:

```
❯ ll
Permissions Size User    Date Modified Name
lrwxr-xr-x@    - enrikes 24 Dec 12:15  brazil-config-zed-extension -> /Volumes/workplace/BrazilConfigZedExtension
drwxr-xr-x@    - enrikes  5 Dec 14:48  java
drwxr-xr-x@    - enrikes 12 Dec 13:04  kotlin
drwxr-xr-x@    - enrikes 25 Oct 08:13  rose-pine-theme
```

Before the patch, Zed shows on its logs:

```
2024-12-24T16:44:02+01:00 INFO  extension::extension_builder] compiled Rust extension /Users/enrikes/Documents/BrazilConfigZedExtension
[2024-12-24T16:44:02+01:00 INFO  extension::extension_builder] compiling grammar brazil_config for extension /Users/enrikes/Documents/BrazilConfigZedExtension
[2024-12-24T16:44:02+01:00 INFO  extension::extension_builder] checking out brazil_config parser
[2024-12-24T16:44:04+01:00 INFO  extension::extension_builder] compiling brazil_config parser
[2024-12-24T16:44:05+01:00 INFO  extension::extension_builder] compiled grammar brazil_config for extension /Users/enrikes/Documents/BrazilConfigZedExtension
[2024-12-24T16:44:05+01:00 INFO  extension::extension_builder] finished compiling extension /Users/enrikes/Documents/BrazilConfigZedExtension
[2024-12-24T16:44:05+01:00 ERROR extensions_ui] No such file or directory (os error 2)

Stack backtrace:
   0: std::backtrace_rs::backtrace::libunwind::trace
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/../../backtrace/src/backtrace/libunwind.rs:116:5
   1: std::backtrace_rs::backtrace::trace_unsynchronized
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2: std::backtrace::Backtrace::create
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/backtrace.rs:331:13
   3: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
             at /Users/enrikes/.cargo/registry/src/index.crates.io-6f17d22bba15001f/anyhow-1.0.94/src/backtrace.rs:27:14
   4: <core::result::Result<T,F> as core::ops::try_trait::FromResidual<core::result::Result<core::convert::Infallible,E>>>::from_residual
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/result.rs:1989:27
   5: <fs::RealFs as fs::Fs>::metadata::{{closure}}
             at ./crates/fs/src/fs.rs:603:13
```

After the patch, the extension is installed and the symlink replaced for
a new one pointing to the user's directory choice.

```
2024-12-24T16:53:33.916022+01:00 [INFO] compiled Rust extension /Users/enrikes/Documents/BrazilConfigZedExtension
2024-12-24T16:53:33.916094+01:00 [INFO] compiling grammar brazil_config for extension /Users/enrikes/Documents/BrazilConfigZedExtension
2024-12-24T16:53:33.916225+01:00 [INFO] checking out brazil_config parser
2024-12-24T16:53:35.481602+01:00 [INFO] compiling brazil_config parser
2024-12-24T16:53:35.964189+01:00 [INFO] compiled grammar brazil_config for extension /Users/enrikes/Documents/BrazilConfigZedExtension
2024-12-24T16:53:35.964319+01:00 [INFO] finished compiling extension /Users/enrikes/Documents/BrazilConfigZedExtension
2024-12-24T16:53:36.213608+01:00 [INFO] rebuilt extension index in 39.108542ms
2024-12-24T16:53:36.213835+01:00 [INFO] extensions updated. loading 0, reloading 1, unloading 0
2024-12-24T16:53:36.375928+01:00 [INFO] rebuilt extension index in 34.478167ms
2024-12-24T16:53:36.376054+01:00 [INFO] extensions updated. loading 0, reloading 1, unloading 0
```

and

```
❯ ll
lrwxr-xr-x@    - enrikes 24 Dec 16:53  brazil-config-zed-extension -> /Users/enrikes/Documents/BrazilConfigZedExtension
drwxr-xr-x@    - enrikes  5 Dec 14:48  java
drwxr-xr-x@    - enrikes 12 Dec 13:04  kotlin
drwxr-xr-x@    - enrikes 25 Oct 08:13  rose-pine-theme
```


Release Notes:

- Fix broken symlinks when installing dev extensions

---------

Co-authored-by: Mikayla Maki <[email protected]>

* Simplify workspace notification code (#23414)

* Remove `NotificationHandle` trait in favor of just passing `AnyView` -
id field wasn't used.

* Remove `show_notification_once`, doesn't seem to be needed for its
only use.

Release Notes:

- N/A

* git: Use a buffer for the panel's commit message (#23308)

This PR changes the `GitPanel` and `GitState` to use a
`language::Buffer` for the commit message. This is a small initial step
toward remote editing and collaboration support.

Release Notes:

- N/A

---------

Co-authored-by: Max <[email protected]>

* ollama: Add deepseek-r1 context size to defaults (#23420)

* Show "tab Accept" indicator for single line insertions/deletions (#23411)

https://github.com/user-attachments/assets/655f20a9-f22f-4f91-870e-d40b20c8c994

Release Notes:

- N/A

Co-authored-by: Danilo <[email protected]>

* assistant2: Propagate move up action to inline picker from message editor (#23416)

Release Notes:

- N/A

Co-authored-by: Richard <[email protected]>

* assistant: Extract `ContextEditor` and `ContextHistory` to their own modules (#23422)

This PR extracts the `ContextEditor` and `ContextHistory`
implementations into their own modules so that it's clearer which parts
depend on other constructs in the `assistant` crate.

Release Notes:

- N/A

* docs: Fix broken link for the Odin language (#23421)

* ci: Remove `paths-ignore` for docs, as it does not work with required status checks (#23424)

This PR removes the `paths-ignore` for docs again, as it causes
docs-only PRs to be unmergable in combination with required status
checks (which we need in order to support merge-when-ready).

We can put these back if and only if we come up with a solution for how
to make it work with required status checks.

Release Notes:

- N/A

* Fix button demo in the component preview (#23423)

Problem: If you click on "Tinted Icons", "Icon Color" is also activated.

Release Notes:

- N/A

* open_ai: Move from o1-preview to o1 for OpenAI Assistant provider (#23425)

- Closes: https://github.com/zed-industries/zed/issues/22521
- Follow-up to: https://github.com/zed-industries/zed/pull/22376

* Add `assistant_context_editor` crate (#23429)

This PR adds a new `assistant_context_editor` crate.

This will ultimately house the `ContextEditor` so that it can be
consumed by both `assistant` and `assistant2`.

For the purposes of this PR, we just introduce the crate and move some
supporting constructs to it, such as the `ContextStore`.

Release Notes:

- N/A

* Extract `ContextEditor` to `assistant_context_editor` (#23433)

This PR extracts the `ContextEditor` to the `assistant_context_editor`
crate.

As part of this, we have decoupled the `ContextEditor` from the
`AssistantPanel`.

There is now an `AssistantPanelDelegate` that the `ContextEditor` uses
when it needs to interface with the Assistant panel.

Release Notes:

- N/A

* git: Implement a basic repository selector (#23419)

This PR adds a rough-and-ready picker for selecting which of the
project's repositories the git panel should display.

Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <[email protected]>
Co-authored-by: Nate <[email protected]>

* Add support for `editor::SwapSelectionEnds` everywhere (emacs exchange-point-and-mark) (#23428)

Add `editor:: SwapSelectionEnds ` action which swaps the cursor location from the beginning/end of a given selection.
Renamed from `editor::ExchangeMark` to `editor::SwapSelectionEnds`.
Unbound by default, bound to `ctrl-x ctrl-x` in Emacs keymap.

* assistant2: Add prompt editor (#23436)

This PR adds the Assistant1 experience to Assistant2 as a "prompt
editor".

<img width="1309" alt="Screenshot 2025-01-21 at 7 17 26 PM"
src="https://github.com/user-attachments/assets/3ce2f32b-2b1a-48a8-8e56-4c44e3ac4ce5"
/>

Release Notes:

- N/A

* Extract `ContextHistory` to `assistant_context_editor` (#23437)

This PR extracts the `ContextHistory` to the `assistant_context_editor`
crate.

Release Notes:

- N/A

* assistant2: Add prompt editor history (#23439)

This PR adds the prompt editor history to Assistant2.

<img width="1309" alt="Screenshot 2025-01-21 at 9 02 07 PM"
src="https://github.com/user-attachments/assets/d79936fe-1c23-425f-b99d-43f85afd0c39"
/>

Release Notes:

- N/A

* Consolidate Assistant panels in `assistant2` feature flag (#23442)

This PR consolidates the two Assistant panels into one for users in the
`assistant2` feature flag.

Now that the Assistant1 prompt editor is accessible through the
Assistant2 panel, we no longer have a need to show both panels.

Release Notes:

- N/A

* assistant2: Insert default prompt into prompt editor (#23443)

This PR fixes an issue where the default prompt was not being inserted
into the prompt editor in Assistant2.

Release Notes:

- N/A

* Wire up `AssistantPanelDelegate` based on `assistant2` feature flag (#23444)

This PR adjusts how the `AssistantPanelDelegate` global is set to be
based on the state of the feature flag.

This should prevent `assistant` and `assistant2` from potentially
clobbering each other.

Release Notes:

- N/A

* Make app notifications appear in new workspaces + dismiss on all workspaces (#23432)

The keymap error notifications got convoluted to support displaying the
notification on startup. This change addresses it systemically for all
future app notifications.

Reverts most of #20531, while keeping the fix to handle keyboard layout
switching. This is a better fix for #20531

Release Notes:

- N/A

* When completions menu is displayed above cursor, reverse order (#23446)

Considered doing this when previously working on completions menu
layout, as it brings the default selection position next to the cursor
position, and is generally more symmetrical. With #23445 there is now a
more compelling reason, as the "translucent, cropped bottom" display
doesn't make sense when displayed above.

Release Notes:

- N/A

* windows: Improve foreground task dispatching on Windows (continued) (#23415)

Closes #22653 again

In PR #23283, I thought that every `runnable` dispatched to the main
thread would correspond to an `EVENT_DISPATCHED` message in the message
queue. However, after testing, some `runnable`s occasionally weren’t
executed.

This PR updated the code as follows:  
```rust
if let Ok(runnable) = self.main_receiver.try_recv() {    <-- before
for runnable in self.main_receiver.drain() {            <-- after
    runnable.run();
}
```

This ensures that runnables are handled more proactively on the main
thread, now we handle `runnable`s with a much higher priority.

A big thanks to @MolotovCherry and @ArthurBrussee for their testing
efforts!

Release Notes:

- N/A

* lsp: Ignore payload of `DidChangeConfiguration` dynamic registration (#23454)

Fixes #23430

Closes #23430

Release Notes:

- N/A

* Fix single line edit prediction detection (#23456)

#23411 introduced an "Accept" callout for single line edits, but the
logic to detect them was incorrect causing it to trigger for multiline
insertions, this PR fixes that.

Release Notes:

- N/A

* Only show accept callout if suggestion is all insertions/deletions (#23461)

Release Notes:

- N/A

* assistant2: Respect panel dock position (#23465)

This PR fixes an issue where Assistant2 was not respecting the panel
dock position.

Release Notes:

- N/A

* Show "tab Accept" only for zeta (#23463)

#23460 brought up we are showing the new "tab Accept" marker for single
line suggestions for non-zeta providers. We think this might be valid
for any provider, but we only want to enable it for zeta initially so it
doesn't affect an existing user base.

Release Notes:

- N/A

* Update "Book Onboarding" destination link (#23464)

This PR updates the Book Onboarding links to point to a new form.

Release Notes:

- N/A

* project: Allow running multiple instances of a single language server within a single worktree (#22182)

This PR introduces a new entity called Project Tree which is responsible
for finding subprojects within a worktree;
a subproject is a language-specific subset of a worktree which should be
accurately tracked on the language server side. We'll have an ability to
set multiple disjoint `workspaceFolder`s on language server side OR
spawn multiple instances of a single language server (which will be the
case with e.g. Python language servers, as they need to interact with
multiple disjoint virtual environments).
Project Tree assumes that projects of the same LspAdapter kind cannot
overlap. Additionally **project nesting** is not allowed within the
scope of a single LspAdapter.

Closes #5108

Release Notes:

- Language servers now track their working directory more accurately.

---------

Co-authored-by: João <[email protected]>

* git_ui: Feature flag repo selector (#23470)

Fixes an issue where the repo selector showed for all users, not just
those in the git_ui feature flag.

This was meant to be included in the `git_ui` feature flag.

Release Notes:

- N/A

* vim: Fix % not working for multi-char bracket pairs (#23471)

Closes #23358

Demo/proof:


https://github.com/user-attachments/assets/2036d183-8830-415b-9155-0d3efe3d824c




Release Notes:

- Fixed `%` in Vim mode not working correctly for multi-char brackets,
such as `do/end` in Elixir or `\begin` and `\end` in LaTeX.

Co-authored-by: Conrad <[email protected]>

* Revert "project: Allow running multiple instances of a single language server within a single worktree" (#23472)

Reverts zed-industries/zed#22182
I've merged the build too soon as I wanted it to be excluded from todays
Preview.

* Bump Zed to v0.172 (#23474)

* title_bar: Simplify `git-ui` feature flag check (#23475)

This PR is a follow-up to
https://github.com/zed-industries/zed/pull/23470 that simplifies the way
we check the `git-ui` feature flag in the title bar.

Release Notes:

- N/A

* Scroll completions menu to new selection on filter, fix corner case (#23478)

In the future if `filter` was used more this would fix other issues. In
the current code paths, this just fixes the particular corner case of
edit prediction arriving async while `y_flipped = true` (in this case it
needs to be scrolled down to show item with index 0).

Release Notes:

- N/A

* assistant: Extract `ConfigurationView` to its own module (#23480)

This PR is a small refactoring that extracts the Assistant's
`ConfigurationView` into its own module.

Release Notes:

- N/A

* assistant2: Add configuration (#23481)

This PR wires up the ability to configure Assistant2.

<img width="1309" alt="Screenshot 2025-01-22 at 1 52 56 PM"
src="https://github.com/user-attachments/assets/3de47797-7959-47af-bd93-51f105e87c28"
/>

Release Notes:

- N/A

* git: Fix the panel's update debouncing (#23462)

This PR replaces the update debouncing code in the git panel with a more
correct and conventional structure (holding a `Task` field instead of
spawning a task that runs a loop). I wrote the code that this replaces
without realizing that it doesn't implement debouncing properly.

Release Notes:

- N/A

* docs: Mention PopOS 24.04 in Linux FAQ for /etc/prime-discrete (#23482)

* assistant2: Handle LLM providers that do not emit `StartMessage` events (#23485)

This PR updates Assistant2's response streaming to work with LLM
providers that do not emit `StartMessage` events.

Now if we get a `Text` event without having received a `StartMessage`
event we will still insert an Assistant message so we can stream in the
response from the model.

Release Notes:

- N/A

* project: Allow running multiple instances of a single language server within a single worktree  (#23473)

This PR introduces a new entity called Project Tree which is responsible
for finding subprojects within a worktree;
a subproject is a language-specific subset of a worktree which should be
accurately tracked on the language server side. We'll have an ability to
set multiple disjoint workspaceFolders on language server side OR spawn
multiple instances of a single language server (which will be the case
with e.g. Python language servers, as they need to interact with
multiple disjoint virtual environments).
Project Tree assumes that projects of the same LspAdapter kind cannot
overlap. Additionally project nesting is not allowed within the scope of
a single LspAdapter.

Closes https://github.com/zed-industries/zed/issues/5108
Re-lands #22182 which I had to revert due to merging it into todays
Preview.

Release Notes:

- Language servers now track their working directory more accurately.

---------

Co-authored-by: João <[email protected]>

* git: Handle git status output for deleted-in-index state (#23483)

When a file exists in HEAD, is deleted in the index, and exists again in
the working copy, git produces two lines for it, one reading `D `
(deleted in index, unmodified in working copy), and the other reading
`??` (untracked). Merge these two into the equivalent of `DA`.

Release Notes:

- Improved handling of files that are deleted in the git index but exist
in HEAD and the working copy

* lsp: Use replace edits for completions (#23490)

(Late) follow up to #9634.
Fixes #23395

Release Notes:

- Accepting completions while the cursor is in the middle of suggested
completion will now result in smaller edits being applied.

* Update Rust crate indexmap to v2.7.1 (#23494)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [indexmap](https://redirect.github.com/indexmap-rs/indexmap) |
workspace.dependencies | patch | `2.7.0` -> `2.7.1` |

---

### Release Notes

<details>
<summary>indexmap-rs/indexmap (indexmap)</summary>

###
[`v2.7.1`](https://redirect.github.com/indexmap-rs/indexmap/blob/HEAD/RELEASES.md#271-2025-01-19)

[Compare
Source](https://redirect.github.com/indexmap-rs/indexmap/compare/2.7.0...2.7.1)

-   Added `#[track_caller]` to functions that may panic.
-   Improved memory reservation for `insert_entry`.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Dedupe `PromptBuilder` construction (#23496)

This PR dedupes the construction of the `PromptBuilder`.

Previously this was constructed by both `assistant` and `assistant2`,
but now we construct it outside and pass it in.

Release Notes:

- N/A

* assistant2: Add button to open the prompt library (#23500)

This PR adds a button to open the prompt library from the configuration
view in Assistant2.

<img width="1309" alt="Screenshot 2025-01-22 at 5 38 08 PM"
src="https://github.com/user-attachments/assets/d514abca-53bc-4cde-bead-ab68a1994fb5"
/>

Release Notes:

- N/A

* assistant2: Only show thread context in picker when we have a `ThreadStore` (#23501)

This PR fixes an issue with the context picker where it would show
thread context as an option even if there was no `ThreadStore`
available.

Release Notes:

- N/A

* feature_flags: Enable `assistant2` for all staff (#23502)

This PR makes it so the `assistant2` feature flag is automatically
enabled for all staff.

Previously all the staff members had been opted in to the feature flag
manually (to allow for opting out), but I think we're ready to
unconditionally ship it to all staff.

Release Notes:

- N/A

* Update Rust crate etagere to v0.2.15 (#23493)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [etagere](https://redirect.github.com/nical/etagere) | dependencies |
patch | `0.2.13` -> `0.2.15` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* git: No-op when trying to commit with nothing staged or no commit message (#23491)

The buttons are disabled in this case, but users can still trigger a
commit via the actions directly, and an error toast seems a bit loud for
this.

cc @iamnbutler 

Release Notes:

- N/A

* Update Rust crate semver to v1.0.25 (#23497)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [semver](https://redirect.github.com/dtolnay/semver) |
workspace.dependencies | patch | `1.0.24` -> `1.0.25` |

---

### Release Notes

<details>
<summary>dtolnay/semver (semver)</summary>

###
[`v1.0.25`](https://redirect.github.com/dtolnay/semver/releases/tag/1.0.25)

[Compare
Source](https://redirect.github.com/dtolnay/semver/compare/1.0.24...1.0.25)

- Enable serde impls on play.rust-lang.org
([#&#8203;330](https://redirect.github.com/dtolnay/semver/issues/330),
thanks [@&#8203;jofas](https://redirect.github.com/jofas))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update Rust crate serde_json to v1.0.137 (#23498)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [serde_json](https://redirect.github.com/serde-rs/json) | dependencies
| patch | `1.0.135` -> `1.0.137` |
| [serde_json](https://redirect.github.com/serde-rs/json) |
workspace.dependencies | patch | `1.0.135` -> `1.0.137` |

---

### Release Notes

<details>
<summary>serde-rs/json (serde_json)</summary>

###
[`v1.0.137`](https://redirect.github.com/serde-rs/json/releases/tag/v1.0.137)

[Compare
Source](https://redirect.github.com/serde-rs/json/compare/v1.0.136...v1.0.137)

- Turn on "float_roundtrip" and "unbounded_depth" features for
serde_json in play.rust-lang.org
([#&#8203;1231](https://redirect.github.com/serde-rs/json/issues/1231))

###
[`v1.0.136`](https://redirect.github.com/serde-rs/json/releases/tag/v1.0.136)

[Compare
Source](https://redirect.github.com/serde-rs/json/compare/v1.0.135...v1.0.136)

- Optimize serde_json::value::Serializer::serialize_map by using
Map::with_capacity
([#&#8203;1230](https://redirect.github.com/serde-rs/json/issues/1230),
thanks [@&#8203;goffrie](https://redirect.github.com/goffrie))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* assistant2: Don't suggest thread context for inline assist without a `ThreadStore` (#23506)

This PR makes it so we don't suggest threads as context in the inline
assist when we don't have a `ThreadStore` to pull from.

Release Notes:

- N/A

* Update Rust crate convert_case to 0.7.0 (#23504)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [convert_case](https://redirect.github.com/rutrum/convert-case) |
workspace.dependencies | minor | `0.6.0` -> `0.7.0` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update Rust crate metal to 0.31 (#23508)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [metal](https://redirect.github.com/gfx-rs/metal-rs) |
workspace.dependencies | minor | `0.30` -> `0.31` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update actions/stale digest to 5bef64f (#23486)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [actions/stale](https://redirect.github.com/actions/stale) | action |
digest | `28ca103` -> `5bef64f` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Update cloudflare/wrangler-action digest to 7a5f8bb (#23487)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[cloudflare/wrangler-action](https://redirect.github.com/cloudflare/wrangler-action)
| action | digest | `6d58852` -> `7a5f8bb` |

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDcuMCIsInVwZGF0ZWRJblZlciI6IjM5LjEwNy4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>

* Fix panics on opening repositories with empty remotes (#23520)

Uses a newer `git2` version with
https://github.com/rust-lang/git2-rs/pull/1120 fix

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

Release Notes:

- Fixed panics on opening repositories with empty remotes

* Omit `tsdk_path` from the servers' options if it does not exist (#23525)

Part of https://github.com/zed-industries/zed/issues/22606

Before, `tsdk_path` for vtsls and typescript-language-server
unconditionally set a `tsdk`/`tsserver` property for the corresponding
language server, even if there were no such directory at all.
Instead, make the corresponding code to omit such property if it was not
found on the FS.

Release Notes:

- Fixed "The path /.../tsserver.js doesn't point to a valid tsserver
install. Falling back to bundled TypeScript version." pop-up appearing

* terminal: Check for script existence properly before activating it (#23476)

We were not covering a variant where the returned metadata was Ok(None)

Closes #ISSUE

Release Notes:

- Fixed venv activation script path showing up in terminal for
non-existant scripts.

* project: Reorder LSP Adapters within LanguageRegistry (#23528)

Closes #ISSUE

Release Notes:

- N/A

* theme: Add version control colors (#23529)

This PR adds version control-specific theme tokens to the them to allow
styling entries in the git ui and elsewhere.

Release Notes:

- N/A

* Fix LSP violation when dismissing server notifications (#23531)

Part of https://github.com/zed-industries/zed/issues/22606
Closes https://github.com/zed-industries/zed/issues/23509

When a user sees an odd notification from the language server like

<img width="508" alt="image"
src="https://github.com/user-attachments/assets/6f5ef1aa-0f09-4705-a02a-aaf81dd8620c"
/>

they usually dismiss that.

Zed uses channels to wait and handle user interactions with such
notifications, and, due to `?`, sends back
```json
{"jsonrpc":"2.0","id":1,"error":{"message":"receiving from an empty and closed channel"}}
```

which is not spec-compliant:
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#window_showMessageRequest

> Response:
>
> * result: the selected
[MessageActionItem](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#messageActionItem)
| null if none got selected.
> * error: code and message set in case an exception happens during
showing a message.

Unfortunately, vtsls (and, potentially, others) crash if receive such
non-compliant requests, and do not get back.

After the fix, the message is correct:
```json
{"jsonrpc":"2.0","id":1,"result":null}
```


Release Notes:

- Fixed vtsls crashing on notification dismiss

Co-authored-by: Piotr Osiewicz <[email protected]>

* llm: Sample ~10% of staff members inputs/outputs to LLM (#23537)

Release Notes:

- N/A

* php: Add nowdoc language injection (#23532)

We already have heredoc injection support, so this just extends it to also cover
[nowdoc](https://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.nowdoc).

* elixir: Bump to v0.1.4 (#23540)

Includes:
- https://github.com/zed-industries/zed/pull/22055
- https://github.com/zed-industries/zed/pull/22268

* haskell: Bump to v0.1.3 (#23541)

Includes:
- https://github.com/zed-industries/zed/pull/22609

* html: Bump to v0.1.5 (#23542)

Includes:
- https://github.com/zed-industries/zed/pull/20752
- https://github.com/zed-industries/zed/pull/22268

* csharp: Bump to v0.1.1 (#23539)

Includes:
- https://github.com/zed-industries/zed/pull/22936

* purescript: Bump to v0.1.0 (#23544)

Includes:
- https://github.com/zed-industries/zed/pull/15181
- https://github.com/zed-industries/zed/pull/16955
- https://github.com/zed-industries/zed/pull/22609

* php: Bump to v0.2.4 (#23543)

Includes:
- https://github.com/zed-industries/zed/pull/23532
- https://github.com/zed-industries/zed/pull/22268

* zig: Bump to v0.3.3 (#23547)

Includes:
- https://github.com/zed-industries/zed/pull/22609

* project: Bring back language servers in detached worktrees (#23530)

Closes #ISSUE

Release Notes:

- N/A

* git_panel: Toggle stage all when clicking changes label (#23548)

When clicking the checkbox label fire the toggle action.

At first I wasn't sure this is what we wanted, but after looking at a
few existing implementations of checkboxes with labels it seems like
this is reasonably standard.

Eventually this piece of UI will be updated to a CheckboxWithLabel, but
for now it is custom due to some specific style requirements.

Release Notes:

- N/A

* scheme: Bump to v0.0.2 (#23545)

Includes:
- https://github.com/zed-industries/zed/pull/18728
- https://github.com/zed-industries/zed/pull/20206

* terraform: Bump to v0.1.2 (#23546)

Includes:
- https://github.com/zed-industries/zed/pull/22268

* Remove unwrap in GitTraversal::synchronize_statuses (#23555)

Release Notes:

- Fixed a potential panic in handling of Git statuses.

Co-authored-by: Marshall <[email protected]>

* inline completion: Add syntax highlighting for edit prediction (#23361)

Closes #ISSUE

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <[email protected]>
Co-authored-by: Agus <[email protected]>

* ollama: Set default max_tokens for llama3.3 (#23558)

* vim: Add support for ctrl-g (#23562)

Co-Authored-By: Jon Walstedt <[email protected]>

Closes #22094

Release Notes:

- vim: Added support for ctrl-g

Co-authored-by: Jon Walstedt <[email protected]>

* Disable Copy Permalink context menu item when not in git repo (#23350)

Closes #13979

Please review this approach to hide the permalink, or alternatively to
disable it instead?

Release Notes:

- The Copy Permalink menu item is now disabled when not in a Git
repository.

---------

Co-authored-by: Marshall Bowers <[email protected]>

* ui: Don't add an `on_click` handler for disabled `ListItem`s (#23569)

This PR updates the `ListItem` component to not register an `on_click`
handler for `ListItem`s that are disabled.

When working on #23350 I noticed that even when the context menu entry
was disabled you could still click on the entry to fire the action.

Release Notes:

- Fixed some instances of disabled list items still registering clicks.

* docs: Document `ZED_DEVELOPMENT_AUTH` (#23571)

This PR adds documentation for the `ZED_DEVELOPMENT_AUTH` environment
variable, in the hopes that it helps folks find it sooner.

Release Notes:

- N/A

* project: Revert project tree impl (again) (#23572)

* Autoscroll when running `editor: swap selection ends` (#23575)

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

Release Notes:

- Improved `editor: swap selection ends` by always scrolling the cursor
into view

* Disable zeta predictions in assistant completion menu (#23573)

We don't want the zeta predictions entry to show in the assistant
context editor when completing slash commands. Zeta will still make
suggestions in the rest of the context editor, like the other providers
do.

Release Notes:

- N/A

* Update some editor methods to instead take immutable references (#23578)

Makes the signatures more informative and can be more convenient as
multiple immutable borrows are allowed.

Release Notes:

- N/A

* assistant2: Expose `ActiveThread::thread` via a getter (#23577)

This PR exposes the `thread` file on the `ActiveThread` via a getter
rather than exposing the field directly.

Release Notes:

- N/A

* assistant_context_editor: Put `use`s in the right spot (#23579)

This PR cleans up some `use` statements that weren't at the very top of
the module.

Release Notes:

- N/A

* search: Add heuristic for discarding matching of binary files (#23581)

Fixes #23398 
Closes #23398

We'll bail on searches of files that we know are binary (thus even if we
were to find a match in them, they'd be thrown away by buffer loader).

Release Notes:

- Improved project search performance in worktrees with binary files

* assistant2: Add thread persistence (#23582)

This PR adds persistence for threads in Assistant2.

Threads are now persisted to an LMDB database.

Release Notes:

- N/A

* docs: context_servers json example (#23588)

* Fix terminal memory leak by deduping alacritty events on background thread (#23593)

Closes #23008

Release Notes:

- Fixed case where the terminal can leak memory when it produces events
at a faster rate than could be processed.

* Allow the context menu to take an `icon_color` (#23600)

Doing this to enable customization in the Assistant 2 context picker.

Release Notes:

- N/A

* assistant: Adjust the ToS acceptance card design (#23599)

Just fine-tuning the copywriting and design here.

| Before | After |
|--------|--------|
| <img width="1233" alt="Screenshot 2025-01-24 at 9 28 30 AM"
src="https://github.com/user-attachments/assets/ca91a985-8a20-4ece-b0e4-3a6779db2fda"
/> | <img width="1233" alt="Screenshot 2025-01-24 at 9 27 49 AM"
src="https://github.com/user-attachments/assets/edc9c2ef-4ae0-4caf-a496-9887748673c9"
/> |

Release Notes:

- N/A

* assistant2: Disable the Submit button when missing requirements (#23598)

This PR disables the Assistant 2 Submit button when either there is no
message written in the editor or there's no model selected. To guide the
user, there will be a tooltip displayed on top of the button to indicate
what to do.

Release Notes:

- N/A

* title_bar: Use an `IconButton` for the user menu (#23601)

That's specifically when we're not rendering the user menu with an
Avatar. We were previously rendering a `ButtonLike` with unnecessary
flex styles there. Just a little fine-tune.

Release Notes:

- N/A

* search: Move invalid UTF-8 errors to debug level (#23602)

Closes #ISSUE

Release Notes:

- N/A

* assistant2: Adjust spacing and icons on the context picker (#23607)

Just fine-tuning spacing, icon size and color, and ensure they're are
consistent throughout.

Release Notes:

- N/A

* assistant2: Adjust empty state when there is no provider (#23609)

This PR add a "Configure a Provider" button if the user gets to the
assistant panel with no provider configured. Then, upon configuring it,
they'll see a similar welcome message.

| No provider | Empty state |
|--------|--------|
| <img width="1233" alt="Screenshot 2025-01-24 at 12 25 48 PM"
src="https://github.com/user-attachments/assets/2f3c602f-9e46-4c79-95cd-4bb3717f68a3"
/> | <img width="1233" alt="Screenshot 2025-01-24 at 12 26 01 PM"
src="https://github.com/user-attachments/assets/a4a204dd-9531-45ab-89a2-f1d84f375a7b"
/> |

Release Notes:

- N/A

* task: Always use untruncated label if it is short (#23611)

Also changed rust tasks to be less mouthful.

Release Notes:

- Shortened Rust task labels.
- Task modal will now use full task label when it does not require
truncation.

* git_ui: Add keybinding for focusing the git panel (#23613)

Adds a keybinding for opening/toggling focus to the git panel

Release Notes:

- N/A

* Support `yaml-language-server` as formatter without `lsp` settings (#23612)

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

* Document elm-language-server not supporting linked_edits correctly (#23616)

* Make editor autoscroll put cursor to the left of scrollbar not under (#23586)

Closes #19706

Release Notes:

- Improved editor horizontal autoscroll to now place the cursor to the
left of the scrollbar rather than under it.

* git: Disable "stage all" checkbox when no entries (#23608)

Release Notes:

- N/A

* Update Rust crate tokio to v1.43.0 (#22882)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [tokio](https://tokio.rs)
([source](https://redirect.github.com/tokio-rs/tokio)) | dependencies |
minor | `1.42.0` -> `1.43.0` |
| [tokio](https://tokio.rs)
([source](https://redirect.github.com/tokio-rs/tokio)) |
workspace.dependencies | minor | `1.42.0` -> `1.43.0` |

---

### Release Notes

<details>
<summary>tokio-rs/tokio (tokio)</summary>

###
[`v1.43.0`](https://redirect.github.com/tokio-rs/tokio/releases/tag/tokio-1.43.0):
Tokio v1.43.0

[Compare
Source](https://redirect.github.com/tokio-rs/tokio/compare/tokio-1.42.0...tokio-1.43.0)

### 1.43.0 (Jan 8th, 2025)

##### Added

-   net: add `UdpSocket::peek` methods ([#&#8203;7068])
-   net: add support for Haiku OS ([#&#8203;7042])
-   process: add `Command::into_std()` ([#&#8203;7014])
-   signal: add `SignalKind::info` on illumos ([#&#8203;6995])
-   signal: add support for realtime signals on illumos ([#&#8203;7029])

##### Fixed

- io: don't call `set_len` before initializing vector in `Blocking`
([#&#8203;7054])
- macros: suppress `clippy::needless_return` in `#[tokio::main]`
([#&#8203;6874])
-   runtime: fix thread parking on WebAssembly ([#&#8203;7041])

##### Changes

-   chore: use unsync loads for `unsync_load` ([#&#8203;7073])
-   io: use `Buf::put_bytes` in `Repeat` read impl ([#&#8203;7055])
-   task: drop the join waker of a task eagerly ([#&#8203;6986])

##### Changes to unstable APIs

- metrics: improve flexibility of H2Histogram Configuration
([#&#8203;6963])
-   taskdump: add accessor methods for backtrace ([#&#8203;6975])

##### Documented

- io: clarify `ReadBuf::uninit` allows initialized buffers as well
([#&#8203;7053])
- net: fix ambiguity in `TcpStream::try_write_vectored` docs
([#&#8203;7067])
-   runtime: fix `LocalRuntime` doc links ([#&#8203;7074])
- sync: extend documentation for `watch::Receiver::wait_for`
([#&#8203;7038])
-   sync: fix typos in `OnceCell` docs ([#&#8203;7047])

[#&#8203;6874]: https://redirect.github.com/tokio-rs/tokio/pull/6874

[#&#8203;6963]: https://redirect.github.com/tokio-rs/tokio/pull/6963

[#&#8203;6975]: https://redirect.github.com/tokio-rs/tokio/pull/6975

[#&#8203;6986]: https://redirect.github.com/tokio-rs/tokio/pull/6986

[#&#8203;6995]: https://redirect.github.com/tokio-rs/tokio/pull/6995

[#&#8203;7014]: https://redirect.github.com/tokio-rs/tokio/pull/7014

[#&#8203;7029]: https://redirect.github.com/tokio-rs/tokio/pull/7029

[#&#8203;7038]: https://redirect.github.com/tokio-rs/tokio/pull/7038

[#&#8203;7041]: https://redirect.github.com/tokio-rs/tokio/pull/7041

[#&#8203;7042]: https://redirect.github.com/tokio-rs/tokio/pull/7042

[#&#8203;7047]: https://redirect.github.com/tokio-rs/tokio/pull/7047

[#&#8203;7053]: https://redirect.github.com/tokio-rs/tokio/pull/7053

[#&#8203;7054]: https://redirect.github.com/tokio-rs/tokio/pull/7054

[#&#8203;7055]: https://redirect.github.com/tokio-rs/tokio/pull/7055

[#&#8203;7067]: https://redirect.github.com/tokio-rs/tokio/pull/7067

[#&#8203;7068]: https://redirect.github.com/tokio-rs/tokio/pull/7068

[#&#8203;7073]: https://redirect.github.com/tokio-rs/tokio/pull/7073

[#&#8203;7074]: https://redirect.github.com/tokio-rs/tokio/pull/7074

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS45Mi4wIiwidXBkYXRlZEluVmVyIjoiMzkuOTIuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants