Commit log

34b81e2 collab 0.15.0

Max Brunsfeld created

00212d4 Handle new elixir-ls release zip name (#2655)

Click to expand commit body
Fix downloading Elixir being broken

Release Notes:

- N/A
(Should be mentioned in 0.92.x)

Julia created

1882ce4 Handle new elixir-ls release zip name

Julia created

dddff64 tests: Test 'db' package sequentially (#2654)

Click to expand commit body
/cc @as-cii  @nathansobo  

Release Notes:

- N/A

Piotr Osiewicz created

2cb4616 Enable assistant on stable

Click to expand commit body
Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Antonio Scandurra and Nathan Sobo created

0d0c71e Polish assistant (#2653)

Click to expand commit body
This is a mix of styling and behavioral improvements to the assistant
that we wanted to land before shipping today.

Release Notes:

- N/A

Antonio Scandurra created

8f8a99d Bind cmd-? to assistant::toggle_focus

Click to expand commit body
Bypass system help menu shortcut at the app delegate level to achieve this.

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>

Nathan Sobo and Antonio Scandurra created

7efcd60 Remove border from assistant message header

Click to expand commit body
Also: Increase right margin on token count to space it from the scrollbar.

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>

Nathan Sobo and Antonio Scandurra created

83fc7b9 Avoid scrolling to the new cursor position so the assistant's output is stable

Click to expand commit body
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>

Nathan Sobo and Antonio Scandurra created

f52d3ea Clean up tooltips, create conversation on cmd-n

Click to expand commit body
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>

Nathan Sobo and Antonio Scandurra created

d41a7f4 Space out assistant icons to match pane icons

Click to expand commit body
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>

Nathan Sobo and Antonio Scandurra created

f128cf4 Defer scanning some worktree subdirectories until they are expanded in the project panel (#2622)

Click to expand commit body
Closes
https://linear.app/zed-industries/issue/Z-352/high-memory-usage-from-fs-scanning-if-project-contains-symlinks-that

### Background

Currently, when you open a project, Zed eagerly scans the directory,
building an in-memory representation of all of the files and directories
within. This scanning includes all git-ignored files and follows any
symlinks. When any directory changes on disk, Zed recursively rescans it
in order to keep its in-memory representation up-to-date. When
collaborating, all of these files are replicated to all guests.

Right now, there are some performance problems associated with the
maintenance of this filesystem state:
* For various reasons, some projects contain symlinks that point out to
large folders like `$HOME`, which itself contains many symlinks that
point to the same large directory. When these projects are opened, the
worktree scans endlessly, using more and more memory.
* Some git-ignored directories (like `target` in a rust project) contain
*many* more files than are actually tracked in the git repository. These
files often change as a result of saving, (e.g. because the compiler
runs). Maintaining in memory all of these paths isn't useful to the
user, and causes significant CPU usage on every save. Most importantly,
when collaborating sending all of these changes to guests can be slow,
and can delay all other RPC messages.

### Change

This PR changes the worktree's filesystem-scanning logic to be *lazy*
about scanning two types of directories:
* git ignored directories
* "external" directories (those that are canonically located outside of
the worktree root, but accessed via symlinks)

The laziness works as follows. When, during a recursive scan, a
directory is found that falls into one of the above 2 categories, that
directory is marked as "unloaded". The directory might later be scanned,
if some explicit operation is performed within it (like opening a
buffer, or creating a file), if any collaborator expands that directory
in their project panel, or if an LSP requests that it be watched.

### Results

When collaborating on the `zed` folder:

| metric | before | after |
|-------|--------|------|
| # `worktree_entries` in collab db initially | 154,763 |  77,679 |
| # `worktree_entries` in collab db after 5 saves | 181,952 | 77,679
(nothing new to scan) |
| app memory footprint (host) | 260MB | 228.5 MB  |

The db thing is a win, because reading and writing to the
`worktree_entries` table is one of the most expensive thing that the
`collab` server does.

There's also generally lower background CPU usage after every save,
because we don't need to recursively rescan directories inside of
`target`.

### Limitations

We still end up scanning some unnecessary directories (like
`target/debug/build/zed-b612db829aeac16e/out`) because the LSP instructs
us to watch those.

### To do:

* [x] Expand parent directories of any path opened via LSP
* [x] Avoid creating orphaned entries when FS events happen inside of
unscanned directories
* [x] Scan any newly-non-ignored directories after gitignore changes
* [x] Emit correct events for newly-discovered paths when expanding dirs
* [x] GC the set of expanded directory ids when dirs are removed
* [x] Don't include "external" entries in file-finder
* [x] Expand any directories watched by LSP
* [ ] manual testing and profiling

### Release Notes:

- Fixed a bug where Zed would use excessive memory when a project folder
contained symlinks pointing to directories outside of the project.
- Reduced Zed's memory and CPU usage when working in folders containing
many git-ignored files.

Max Brunsfeld created

201188f Use FakeFs in worktree gitignore test

Max Brunsfeld created

fc02381 Fix bugs in handling combined injections exposed by HEEx (#2652)

Click to expand commit body
Fixes
https://linear.app/zed-industries/issue/Z-2481/heex-this-snippet-triggers-a-hard-crash

Release Notes:

- Fixed a crash that would sometimes occur when editing a HEEx file
([#1703](https://github.com/zed-industries/community/issues/1703)).

Max Brunsfeld created

81c26cf Fix bugs in handling combined injections exposed by HEEx

Max Brunsfeld created

9389b50 Update local-collaboration.md

Click to expand commit body
Add missing livekit info

Nate Butler created

0548df0 Update local-collaboration.md

Nate Butler created

f311d30 Create local-collaboration.md (#2651)

Click to expand commit body
I forget how to do this every single time 😅 Please update anything that
is incorrect!

[[PR Description]]

Release Notes:

- N/A

Nate Butler created

a67eba9 Create local-collaboration.md

Click to expand commit body
I forget how to do this every single time 😅

Nate Butler created

04d93df vim: indent/outdent (#2644)

Click to expand commit body
Release Notes:

- vim: support indent/outdent
([#832](https://github.com/zed-industries/community/issues/832>)).

Nathan Sobo created

fd3ee0e Vim toggle case (#2648)

Click to expand commit body
Release Notes:

- vim: Add ~ to toggle case
([#1410](https://github.com/zed-industries/community/issues/1410))

Nathan Sobo created

29b2639 Merge remote-tracking branch 'origin/main' into vim-indent

Nathan Sobo created

16c2355 vim: Fix scrolling (#2647)

Click to expand commit body
After #2641 we noticed that scrolling didn't take a count parameter, and
a few other issues with the way that we calculated the distance to
scroll.
 
Release Notes:

- Improved distance calculations for page-up/page-down
- vim: Allow counts to work with scrolling shortcuts.

Nathan Sobo created

7294314 vim: shortcuts for tab navigation (#2649)

Click to expand commit body
Release Notes:

- vim: added gt/ctrl-pagedown and gT/ctrl-pageup for tab navigation

Nathan Sobo created

0fd0b60 vim: Fix code actions menu (#2650)

Click to expand commit body
Fixes: zed-industries/community#1690

I'm not sure this is the correct way to fix this...
* A simpler approach would be to just say `!showing_code_actions` in the
binding file (as `showing_completions` can only happen in insert mode -
and `VimControl` will be false). This seemed a little error prone if
more menus were added in the future.
* A more complicated approach would be to copy the way this is done from
the MouseContextMenu, which registers its own keyboard shortcuts, and as
such uses those when it's open. This seems "more correct", but is a
major refactoring for a very small reward.

Release Notes:

- vim: Fix code actions menu
([#1690](https://github.com/zed-industries/community/issues/1690))

Nathan Sobo created

a1343f0 vim: Fix code actions menu

Click to expand commit body
Fixes: zed-industries/community#1690

Conrad Irwin created

a9aa5e5 vim: Add ~ to change case

Click to expand commit body
Fixes: zed-industries/community#1410

Conrad Irwin created

77dc22b vim: Fix cursor restoration when undoing substitute

Conrad Irwin created

7392080 vim: shortcuts for tab navigation

Conrad Irwin created

02fc5dd vim: Fix scrolling

Click to expand commit body
After #2641 we noticed that scrolling didn't take a count parameter.

The PageDown/PageUp logic was also broken by an additional -1 (for both
vim mode and not).

Conrad Irwin created

a09c6b2 Add installation_id to panic events (#2642)

Click to expand commit body
We want to add installation_id to the panic events so that we can easily
know if multiple panics are coming from the same person or different
people. 5 panics from one person isn't as bad as 5 panics from 5 people.

[zed.dev pr](https://github.com/zed-industries/zed.dev/pull/343)

Release Notes:

- N/A

Joseph T. Lyons created

c0fb98c Factor out key name

Joseph T. Lyons created

8d1cc88 Merge branch 'main' into add-installation-id-to-panic-events

Joseph T. Lyons created

37814bc Fix incorrect ThemeAppearance (#2645)

Click to expand commit body
[[PR Description]]

When we updated the way themes were built it looks like we accidentally
gave `Atelier Forest Light` the wrong `ThemeAppearance`. This PR fixes
that.

Release Notes:

- Fixed the `Atelier Forest Light` theme, which was incorrectly set as a
dark theme.

Nate Butler created

0d3e75e Introduce the ability to load and save conversations with the assistant (#2623)

Click to expand commit body
Closes
https://linear.app/zed-industries/issue/Z-1890/save-assistant-conversations-to-the-filesystem
Closes
https://linear.app/zed-industries/issue/Z-2459/cycling-message-roles-on-the-last-empty-message-alters-the-message
Closes
https://linear.app/zed-industries/issue/Z-2460/cycling-role-in-an-empty-message-cycles-wrong-messages-role
Closes https://linear.app/zed-industries/issue/Z-2365/assistant-toolbar
Closes
https://linear.app/zed-industries/issue/Z-2461/always-insert-an-empty-message-at-the-end-of-the-conversation

Release Notes:

- You can now save conversations with the assistant to
`~/.config/zed/conversations` with `cmd-s`. Conversations are also
automatically saved as they are edited.

Antonio Scandurra created

4372316 Remove assistant panel zoom test

Click to expand commit body
The test was testing pretty straightforward logic, but for some strange reason
it was failing on CI (but passed locally). I think it's fine to delete it and
make progress, if zooming regresses we'll find out pretty quickly.

Antonio Scandurra created

1dc52c7 Fix incorrect ThemeAppearance

Nate Butler created

d46d3e6 Try fixing test on CI

Antonio Scandurra created

c3e8cae vim: indent/outdent

Click to expand commit body
Fixes: zed-industries/community#832

Conrad Irwin created

e77abbf Add hover state to assistant buttons

Antonio Scandurra created

723c8b9 Show quote selection button

Antonio Scandurra created

e723686 Shwo tooltips for assistant buttons

Antonio Scandurra created

edc7f30 Add assistant icons to the toolbar

Click to expand commit body
Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Antonio Scandurra and Nathan Sobo created

c5b3785 Revert "Panic in debug if global settings can't be deserialized from defaults"

Click to expand commit body
This reverts commit 7a051a0dcbafd467203bcaeec773c269abcd02cd.

Antonio Scandurra created

00e37bc Merge remote-tracking branch 'origin/main' into save-conversations

Antonio Scandurra created

9d4dd5c Insert empty user message when assisting with the current last message

Click to expand commit body
Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Antonio Scandurra and Nathan Sobo created

92d7b6a Allow toggling back and forth between conversation list and editor

Click to expand commit body
Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Antonio Scandurra and Nathan Sobo created

3f4a06f Add an Element derive macro for building components out of other elements (#2643)

Click to expand commit body
To turn any struct into a composite element, you can implement a render
method with the following signature:

```rs
fn render<V: View>(&mut self, view: &mut V, cx: &mut ViewContext<V>) -> AnyElement<V>;
```

Then add #[derive(Element)] to the struct definition.

This will make it easier to introduce higher-level components that are
expressed in terms of other elements. Instead of calling functions that
return elements, we can now make any struct into an element fairly
easily. The advantage is that we can use method chaining to express
optional state on these components, and they blend in better with other
elements.

cc @mikayla-maki @osiewicz @iamnbutler 

Release Notes:

- N/A

Nathan Sobo created

bede668 Add a derive macro for Element

Click to expand commit body
To turn any struct into a composite element, you can implement a render method
with the following signature:

fn render<V: View>(&mut self, view: &mut V, cx: &mut ViewContext<V>) -> AnyElement<V>;

Then add #[derive(Element)] to the struct definition.

This will make it easier to introduce higher-level components that are expressed in
terms of other elements.

Nathan Sobo created

82bd5fb Fix main compilation

Kirill Bulatov created