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
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`.
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 <richard@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Joao <joao@zed.dev>
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 <antonio@zed.dev>
Co-authored-by: Kirill <kirill@zed.dev>
Co-authored-by: Bennet <bennet@zed.dev>
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
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.
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-5d569dec0734Closes#23115
Release Notes:
- Added new command to move the focused panel to the next valid dock
position – `workspace: move focused panel to next position` .
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 <mail4score@gmail.com>
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>
This PR renames the constants and functions previously introduced in
PR#23283. Since the changes are within the GPUI crate, I renamed these
from `**_ZED_**` to `**_GPUI_**`.
Release Notes:
- N/A
* Collects and reports all parse errors
* Shares parsed `KeyBindingContextPredicate` among the actions.
* Updates gpui keybinding and action parsing to return structured
errors.
* Renames "block" to "section" to match the docs, as types like
`KeymapSection` are shown in `json-language-server` hovers.
* Removes wrapping of `context` and `use_key_equivalents` fields so that
`json-language-server` auto-inserts `""` and `false` instead of `null`.
* Updates `add_to_cx` to take `&self`, so that the user keymap doesn't
get unnecessarily cloned.
In retrospect I wish I'd just switched to using TreeSitter to do the
parsing and provide proper diagnostics. This is tracked in #23333
Release Notes:
- Improved handling of errors within the user keymap file. Parse errors
within context, keystrokes, or actions no longer prevent loading the key
bindings that do parse.
This PR fixes two visual issues, that were caused by the fact that we
were always painting the horizontal scrollbar even if there is no
horizontal scrolling possible
Obscuring deleted lines when using the inline assistant:
https://github.com/user-attachments/assets/f8460c3f-403e-40a6-8622-65268ba2d875
Cutting off text even when horizontal scrolling is not possible:
https://github.com/user-attachments/assets/23c909f7-1c23-4693-8edc-40a2f089d4a8
This issue was only present in some themes (e.g. Nord, Catpuccin)
Closes#22716
Release Notes:
- Fixed an issue where horizontal scrollbars of editors would always be
painted (even if there is no horizontal scrolling to be done)
https://github.com/user-attachments/assets/78db908e-cfe5-4803-b0dc-4f33bc457840
* starts to extract usernames out of `users/` GitHub API responses, and
pass those along with e-mails in the collab sessions as part of the
`User` data
* adjusts various prefill and seed test methods so that the new data can
be retrieved from GitHub properly
* if there's an active call, where guests have write permissions and
e-mails, allow to trigger `FillCoAuthors` action in the context of the
git panel, that will fill in `co-authored-by:` lines, using e-mail and
names (or GitHub handle names if name is absent)
* the action tries to not duplicate such entries, if any are present
already, and adds those below the rest of the commit input's text
Concerns:
* users with write permissions and no e-mails will be silently omitted
— adding odd entries that try to indicate this or raising pop-ups is
very intrusive (maybe, we can add `#`-prefixed comments?), logging seems
pointless
* it's not clear whether the data prefill will run properly on the
existing users — seems tolerable now, as it seems that we get e-mails
properly already, so we'll see GitHub handles instead of names in the
worst case. This can be prefilled better later.
* e-mails and names for a particular project may be not what the user
wants.
E.g. my `.gitconfig` has
```
[user]
email = mail4score@gmail.com
# .....snip
[includeif "gitdir:**/work/zed/**/.git"]
path = ~/.gitconfig.work
```
and that one has
```
[user]
email = kirill@zed.dev
```
while my GitHub profile is configured so, that `mail4score@gmail.com` is
the public, commit e-mail.
So, when I'm a participant in a Zed session, wrong e-mail will be
picked.
The problem is, it's impossible for a host to get remote's collaborator
git metadata for a particular project, as that might not even exist on
disk for the client.
Seems that we might want to add some "project git URL <-> user name and
email" mapping in the settings(?).
The design of this is not very clear, so the PR concentrates on the
basics for now.
When https://github.com/zed-industries/zed/pull/23308 lands, most of the
issues can be solved by collaborators manually, before committing.
Release Notes:
- N/A
It's easy to overshoot the bottom of the tooltip when cursoring to a
button, such as opening the commit from a blame tooltip. Before this
change the tooltip would immediately disappear, and now it sticks around
for a bit.
Also:
* Shares the implementation with `elements/text.rs`. This will
particularly be handy when it makes use of hoverable tooltips.
* Improves the fix to #21657.
- Now the element will no longer think it has an active tooltip that it
registers with the window.
- It will instead display the next available tooltip, whereas I believe
before the next available tooltip would be suppressed.
* Fixes bug where `cx.refresh()` wasn't called when text tooltip is
hidden due to a mouse down event.
* Ports over fix in https://github.com/zed-industries/zed/pull/14832 to
`elements/text.rs`
Release Notes:
- The tooltip for inline git blame now waits a bit before disappearing
when the mouse leaves it.
Closes#4798
This PR implements a scrollbar for the terminal by turning
`ScrollableHandle` into a trait, allowing us to implement a custom
scroll handle, `TerminalScrollHandle`. It works by converting terminal
lines into pixels that `ScrollableHandle` understands. When
`ScrollableHandle` provides a changed offset (e.g., when you drag the
scrollbar), we convert this pixel offset back into the number of lines
to scroll and update the terminal content accordingly.
While the current version works as expected, I believe the scrollbar's
offset updates could potentially be turned into an event. This event
could then be subscribed to in `TerminalView`, not needing to update the
terminal's offset in the `render` method as it might have performance
implications. Further ideas on this are welcome.
Preview:
https://github.com/user-attachments/assets/560f0aac-4544-4007-8f0b-8833386f608f
Todo:
- [x] Experiment with custom scrollbar responding to terminal mouse
scroll
- [x] Refactor existing scrollbar handle into a trait
- [x] Update terminal to use the scrollbar trait instead of a custom
scrollbar implementation
- [x] Figure out how scrollbar events like mouse drag should notify the
terminal to update its state
- [x] Code clean up
- [x] Scrollbar hide setting for terminal
Release Notes:
- Added scrollbar to the terminal
Closes#22653
After some investigation, I found this bug is due to that sometimes
`foreground_task` is not dispatched to the main thread unless there is
user input. The current Windows implementation works as follows: when
the `WindowsDispatcher` receives a `foreground_task`, it adds the task
to a queue and uses `SetEvent(dispatch_event)` to notify the main
thread.
The main thread then listens for notifications using
`MsgWaitForMultipleObjects(&[dispatch_event])`.
Essentially, this is a synchronous method, but it is not robust. For
example, if 100 `foreground_task`s are sent, `dispatch_event` should
theoretically be triggered 100 times, and
`MsgWaitForMultipleObjects(&[dispatch_event])` should receive 100
notifications, causing the main thread to execute all 100 tasks.
However, in practice, some `foreground_task`s may not get a chance to
execute due to certain reasons.
As shown in the attached video, when I don't move the mouse, there are
about 20-30 `foreground_task`s waiting in the queue to be executed. When
I move the mouse, `run_foreground_tasks()` is called, which processes
the tasks in the queue.
https://github.com/user-attachments/assets/83cd09ca-4b17-4a1f-9a2a-5d1569b23483
To address this, this PR adopts an approach similar to `winit`. In
`winit`, an invisible window is created for message passing. In this PR,
we use `PostThreadMessage` to directly send messages to the main thread.
With this implementation, when 100 `foreground_task`s are sent, the
`WindowsDispatcher` uses `PostThreadMessageW(thread_id,
RUNNABLE_DISPATCHED)` to notify the main thread. This approach enqueues
100 `RUNNABLE_DISPATCHED` messages in the main thread's message queue,
ensuring that each `foreground_task` is executed as expected. The main
thread continuously processes these messages, guaranteeing that all 100
tasks are executed.
Release Notes:
- N/A
* Increases width of notification message to remove a gap
* Puts the close button in the top right
Release Notes:
- N/A
Co-authored-by: Nate <nate@zed.dev>
This reverts commit 1b3b825c7f.
When debugging git diffs we found that this introduced a re-ordering of
messages sent to the LSP:
* User hits "format"
* Zed adjusts spacing, and sends "spaces changed" to the LSP
* Zed sends "format" to LSP
With the async approach here, the format request can now arrive before
the space changed request.
You can reproduce this with `test_strip_whitespace_and_format_via_lsp`
under some conditions.
Release Notes:
- N/A
- [x] Basic implementation
- [x] Disable commit buttons when committing is not possible (empty
message, no changes)
- [x] Upgrade GitSummary to efficiently figure out whether there are any
staged changes
- [x] Make CommitAll work
- [x] Surface errors with toasts
- [x] Channel shutdown
- [x] Empty commit message or no changes
- [x] Failed git operations
- [x] Fix added files no longer appearing correctly in the project panel
(GitSummary breakage)
- [x] Fix handling of commit message
Release Notes:
- N/A
---------
Co-authored-by: Nate <nate@zed.dev>
This PR restores the ability to publish the `html_to_markdown` crate
after #23291.
This crate is [published](https://crates.io/crates/html_to_markdown) to
crates.io so that it can be consumed by extensions.
Release Notes:
- N/A
This PR extracts the `PromptLibrary` out of the `assistant` crate and
moves it to the `prompt_library` crate.
The `PromptLibrary` is now decoupled from the specifics of the
`AssistantPanel` and `InlineAssistant`.
Release Notes:
- N/A
This enables having a dedicated color for the line number hover state.
That's relevant because line numbers can now be clicked to jump to
cursor location in multibuffers.
Release Notes:
- N/A
---------
Co-authored-by: João Marcos <marcospb19@hotmail.com>
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [aws-config](https://redirect.github.com/smithy-lang/smithy-rs) |
dependencies | patch | `1.5.13` -> `1.5.14` |
| [aws-sdk-kinesis](https://redirect.github.com/awslabs/aws-sdk-rust) |
dependencies | minor | `1.55.0` -> `1.56.0` |
| [aws-sdk-s3](https://redirect.github.com/awslabs/aws-sdk-rust) |
dependencies | minor | `1.68.0` -> `1.69.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.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.
---
- [ ] <!-- 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>
A recent change in #22730 (to reduce workspace serialization) means that
a dock "forgets" its active panel whenever it is closed. When opened
again, the change in #22346 (which establishes a panel activation order)
takes effect, always opening the highest-priority panel for that dock
instead of the panel the user previously manually activated.
The result is that if you have, say, the outline panel active on the
right dock, and toggle the dock closed and then back open again, the
assistant panel will always appear instead.
This PR reverts part of the change in #22730 to ensure a dock remembers
its active panel when it is closed.
Closes#22923.
Release Notes:
- Fixed an issue where docks did not remember the active panel.
Now we ensure that task output is fully drained and printed to Zed
terminal pane on task completion.
This change depends on a recent change to alacritty_terminal crate:
5e78d20c70.
Closes https://github.com/zed-industries/zed/issues/18342
Release Notes:
- Fixed missing task terminal output on Linux for short-running commands
I’ve also updated the documentation in
`development\local-collaboration.md` and
`docs\src\development\windows.md`.
Testing collab on my Windows machine:
![屏幕截图 2025-01-14
162021](https://github.com/user-attachments/assets/28b4a36a-e156-4012-981a-5d0a23dcc613)
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Closes#23216
This crash happens in the `update_visible_entries` function, where we
calculate `ancestors` and `current_ancestor_depth`. `ancestors` is map
storing information about folded ancestors and `current_ancestor_depth`
is basically selected ancestor index in reverse order of visibility.
For example, before adding a new file or directory in `a/b/c`, the
`ancestors` might look like:
```jsonc
{
"entry_id_of_c": {
"current_ancestor_depth": 2, // "a" is selected
"ancestors": ["entry_id_of_a", "entry_id_of_b", "entry_id_of_c"]
}
}
```
When new file or directory is added to`a`, ancestors length is reduced,
as `a` now is not part of folded dir due to having multiple children.
But depth still remains the same as while calculating it, we use depth
from `old_ancestors` to preserve selection across renders. This causes
panic.
```jsonc
{
"entry_id_of_c": {
"current_ancestor_depth": 2, // wrong: use of old depth here causes panic
"ancestors": ["entry_id_of_b", "entry_id_of_c"] // correct: notice "a" is missing, as "a" now has multiple children
}
}
```
This PR fixes it by capping depth so it don't exceed `ancestors` array.
This preserves existing depth as well as handles our edge case.
Release Notes:
- Fixed crash when adding a new file or directory to the first folded
directory
Closes#22885Closes#12565
This doesn't yet add history in the command palette, which is painfully
missing.
Release Notes:
- vim: Added `:!`, `:<range>!` and `:r!` support
- vim: Added `!` operator in normal/visual mode
This PR resolves one part of issue #14496
In project panel, when dragging, if you hover over a directory for
~500ms, it now auto-expands so you can drag and drop into nested
directories.
Task cleanup is handled in these cases:
- Dragged onto a different entry.
- Dragged anywhere else, and the 500ms timer runs out (for example, out
of the project panel).
- Dropped onto any entry.
I don’t see any edge cases where task isn’t cleaned up after 500ms.
https://github.com/user-attachments/assets/19da0da1-f9e2-42df-8ee4-fab6dc9a185a
Release Notes:
- Added auto-expand for directories on hover for a while during
dragging.