**Summary**:
- Removed reply message from message_menu
- Made render_popover_buttons a bit more reusable
- Fixed issue that you can't close the reply/edit preview when you are
not focusing the message editor
- Notify only the new people that were mentioned inside the edited
message
**Follow up**
- Fix that we update the notification message for the people that we
mentioned already
- Fix that we remove the notification when a message gets deleted.
- Fix last acknowledge message id is in correct now
**Todo**:
- [x] Add tests
- [x] Change new added bindings to the `Editor::Cancel` event.
Release Notes:
- Added editing of chat messages
([#6707](https://github.com/zed-industries/zed/issues/6707)).
<img width="239" alt="Screenshot 2024-03-09 at 11 55 23"
src="https://github.com/zed-industries/zed/assets/62463826/b0949f0d-0f8b-43e1-ac20-4c6d40ac41e1">
<img width="240" alt="Screenshot 2024-03-13 at 13 34 23"
src="https://github.com/zed-industries/zed/assets/62463826/d0636da2-c5aa-4fed-858e-4bebe5695ba7">
---------
Co-authored-by: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
As I mentioned before, there are the following issues with how GPUI
handles scale factors greater than 1.0:
1. The title bar buttons do not function correctly, with minimizing
button performing maximization and maximizing button performing closure.
2. As discussed in #8809, setting a scale factor greater than 1.0 causes
GPUI's drawing content to be pushed off the screen.
This PR introduces `LogicalSize` and `PhysicalSize` to differentiate
between coordinate systems for proper GPUI rendering, and now scale
factors above 1.5 are working correctly.
`Zed` with a scale factor equals 1.5, and change between different scale
factors:
https://github.com/zed-industries/zed/assets/14981363/3348536d-8bd3-41dd-82f6-052723312a5b
Release Notes:
- N/A
Co-authored-by: Antonio <antonio@zed.dev>
Resurrected this from some assistant work I did in Spring of 2023.
- [x] Resurrect streaming responses
- [x] Use streaming responses to enable AI via Zed's servers by default
(but preserve API key option for now)
- [x] Simplify protobuf
- [x] Proxy to OpenAI on zed.dev
- [x] Proxy to Gemini on zed.dev
- [x] Improve UX for switching between openAI and google models
- We current disallow cycling when setting a custom model, but we need a
better solution to keep OpenAI models available while testing the google
ones
- [x] Show remaining tokens correctly for Google models
- [x] Remove semantic index
- [x] Delete `ai` crate
- [x] Cloud front so we can ban abuse
- [x] Rate-limiting
- [x] Fix panic when using inline assistant
- [x] Double check the upgraded `AssistantSettings` are
backwards-compatible
- [x] Add hosted LLM interaction behind a `language-models` feature
flag.
Release Notes:
- We are temporarily removing the semantic index in order to redesign it
from scratch.
---------
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Thorsten <thorsten@zed.dev>
Co-authored-by: Max <max@zed.dev>
I mainly focused on improving the `font_id` function, see the
description of e286483262 for more
details. The rest are some drive-by changes I could not resist to.
When I am right about af4d6c43ce, someone
with a Mac could change it there as well.
This PR is probably best reviewed commit by commit :)
cc @gabydd @h3mosphere
Release Notes:
- N/A
---------
Signed-off-by: Niklas Wimmer <mail@nwimmer.me>
This will be used in the
[extensions](https://github.com/zed-industries/extensions) repository
for packaging the extensions that users submit.
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
TL;DR:
- shaves off about 0.5 seconds from most of our debug builds.
- It would've slightly regressed release build due to preventing build pipelining, but as a tradeoff I've bumped up codegen-units for zed.
\# What did you come up with this time Piotr
In our zed repository I've noticed that merely *loading dependencies* in each crate takes non-trivial amount of time (~800ms in case of editor).
That is to say, the moment you \`use editor\`, your build time increases by 800ms - this happens just once in crate though, as it looks like compiler has to load .rlibs of all of the referenced dependencies.
This is visible under rustc's self-profile. Repro steps on twitter: https://twitter.com/PiotrOsiewicz/status/1762845413072101567
\# How does this commit alleviate this?
zed lib + zed bin are on critical path of every build and cumulatively take about 3s to build. This commit bundles all of this up into ~2.2s of bin build time instead.
\# Wait, splitting binary targets is good, no?
Splitting up a binary target into lib + bin is generally considered to be a good practice, as you can then reuse the lib part elsewhere if needed.
It also allows the build to kick off the moment metadata for all of the dependencies is available (thus, you don't need to wait for codegen).
However, we do not really use zed as a lib, so the first benefit is not really a thing for us.
The latter *is* indeed something we lose out on in release mode (in dev codegen phase of leaf-ish crates is insignificant, as we use shared generics - thus we don't spend much time codegening).
That's why I've bumped codegen units for zed crate to 16 in release mode to keep build times in tact.
This PR fixes file name coloring in the project panel and tabs when
.gitignore file is updated. It's intended to fix#7831.
There's another, less vivid, problem with git-aware labels coloring.
It's about files that are both ignored and contained in the git index.
I'll file a separate issue for it to keep this fix focused.
Release Notes:
- Fixed file Git status refreshing on .gitignore update (#7831).
This patch puts the prost, prost-build, and prost-types dependencies
together and unifies their version. This improves organization a bit in
addition to improving build time slightly, since a redundant version of
prost is now removed.
The dependencies are _not_ updated to the newest versions, because the
newest versions add a dependency on the `protoc` application, which is
not provided by cargo and thus breaks the building process.
We made a change last week to allow creating files with names. This
means some files have null saved_mtime, which old versions of zed panic
on.
A fix is available in 0.126.3 and above
Release Notes:
- N/A
This PR adjusts scrolling to be a lot faster on Linux and also makes
terminal scrolling work.
For Wayland, it makes scrolling faster by handling the `AxisValue120`
event (which also allows high-resolution scrolling on supported mice)
On X11, changed the 1 line per scroll to 3.
### Different solutions
I tried replicating Chromium's scrolling behaviour, but it was
inconsistent in X11/Wayland and found it too fast on Wayland. Plus, it
also didn't match VSCode, since it seems that they do something
different.
Release Notes:
- Made scrolling faster on Linux
- Made terminal scroll on Linux
Since Windows has a distinction between symlinks for directories and
symlinks for files, the implementation is adapted to this distinction.
Release Notes:
- N/A
Completes #7228.
Adds back Backspace as the main delete key binding and makes Linux
bindings consistent with macOS
Release Notes:
- ⌘-Delete/⌘-Backspace will now suppress deletion confirmation prompts
in project panel
([#7228](https://github.com/zed-industries/zed/issues/7228)).
At the moment, `Picker` always has an editor at the top, that allows the
user to search list elements by text. Sometimes, the UI doesn't need
such an editor. Like in the [tab
switcher](https://github.com/zed-industries/zed/issues/7653) that will
confirm selection on the modifier keys release, so there will be no
searching capabilities.
This PR adds support for a "headless picker" that doesn't display an
editor. It only has an invisible element to hold input focus for
preventing it from jumping back to the workspace.
At the moment, none of the picker implementations is made headless. It's
for the future implementations. But I'd like to make it a separate PR to
keep it focused on this particular feature.
Release Notes:
- N/A
Related Issues:
- Part of #7653
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This variable is experimental, as I expect it to be superseded by
whatever the extensions can provide (once we get them)
Release Notes:
- Added experimental ZED_PACKAGE task variable which contains name of
the current crate in Rust files.
---------
Co-authored-by: Kirill <kirill@zed.dev>
This fixes #[#9135](https://github.com/zed-industries/zed/issues/9135)
by introducing file/results limit to project search.
It does this by changing how project search works in multiple ways.
User-facing changes:
- Number files that are being searched is now limited to 5000
- Number of search results in all files is now limited to 10000
- If a limit is reached, search is stopped and a message is displayed
to the user
Under the hood, we also reworked `Project::search_local`:
- Code has been refactored so that the concurrency-logic is easier to
distinguish from the search logic.
- We now limit the number of concurrent `open_buffer` operations, since
that is being done on the main thread and can lead to beachballs when
finding a lot of results.
Note for reviewer:
@SomeoneToIgnore since you know this code, can you take a look at this?
The changes might look bigger than they are in certain places because I
only extracted code into functions, but the middle part — the sorting of
file paths — has changed in order to avoid too many tasks opening
buffers at the same time and making app unresponsive.
What's also curious is that I think there was a bug in that we searched
ignored entries _twice_: once in `search_snapshots` and then later in
the dedicated `search_ignored_entry` function. I changed the `entries()`
call in `search_snapshots` so that it's always `false`, but that caused
tests to fail (see `test_search_in_gitignored_dirs`). @bennetbo and I
think that there's some state in the Project that made the tests pass
before, because the last of the 3 assertions in that test only passes
when the other two queries run. So we changed the test to be more
stateless and included the possible fix in `search_snapshots`.
Release Notes:
- Fixed project-wide search leading to unresponsive application when
searching in ignored files, by limiting the number of files that are
searched (to 5000) and the number of overall search results to 10000.
Additional performance improvements have also been made in order to
offload more work onto a background thread.
([#9135](https://github.com/zed-industries/zed/issues/9135)).
---------
Co-authored-by: Antonio Scandurra <antonio@zed.dev>
Co-authored-by: Bennet <bennetbo@gmx.de>
Closes https://github.com/zed-industries/zed/issues/9458
When flying in a plane being totally offline, I've discovered that my
Rust projects do not have any LSP support and rust-analyzer disappeared
out of `~/Library/Application Support/Zed/languages/rust-analyzer/`
directory.
Looking at the
[bad.log](https://github.com/zed-industries/zed/files/14627508/bad.log),
it appears that `get_language_server_command` tries to find a newer LSP
server version and fails on
80bc6c8cc8/crates/language/src/language.rs (L339)
bailing out of all installation related-methods up to here:
80bc6c8cc8/crates/project/src/project.rs (L2916)
where the code thinks that the binary installation process had failed,
cleans the existing directory and tries to install the language server
again:
```log
[2024-03-17T15:14:13+02:00 WARN isahc::handler] request completed with error: failed to resolve host name
[2024-03-17T15:14:13+02:00 ERROR project] failed to start language server "rust-analyzer": error fetching latest release
[2024-03-17T15:14:13+02:00 ERROR project] server stderr: Some("")
[2024-03-17T15:14:13+02:00 INFO project] retrying installation of language server "rust-analyzer" in 1s
[2024-03-17T15:14:13+02:00 ERROR util] crates/lsp/src/lsp.rs:720: oneshot canceled
[2024-03-17T15:14:14+02:00 INFO project] About to spawn test binary
[2024-03-17T15:14:14+02:00 WARN project] test binary failed to launch
[2024-03-17T15:14:14+02:00 WARN project] test binary check failed
[2024-03-17T15:14:14+02:00 INFO project] beginning to reinstall server
[2024-03-17T15:14:14+02:00 INFO language::language_registry] deleting server container
[2024-03-17T15:14:14+02:00 INFO language::language_registry] starting language server "rust-analyzer", path: "/Users/someonetoignore/work/other/local_test", id: 2
[2024-03-17T15:14:14+02:00 INFO language] fetching latest version of language server "rust-analyzer"
[2024-03-17T15:14:14+02:00 WARN isahc::handler] request completed with error: failed to resolve host name
[2024-03-17T15:14:14+02:00 ERROR project] failed to start language server "rust-analyzer": error fetching latest release
[2024-03-17T15:14:14+02:00 ERROR project] server stderr: Some("")
[2024-03-17T15:14:14+02:00 INFO project] retrying installation of language server "rust-analyzer" in 1s
[2024-03-17T15:14:15+02:00 ERROR util] crates/languages/src/rust.rs:335: no cached binary
[2024-03-17T15:14:15+02:00 INFO project] About to spawn test binary
............
```
The PR extracts away all binary fetching-related code into a single
method that does not fail the entire `get_language_server_command` and
allows it to recover and reuse the existing binary:
[good.log](https://github.com/zed-industries/zed/files/14627507/good.log)
```log
[2024-03-17T15:12:24+02:00 INFO language::language_registry] starting language server "rust-analyzer", path: "/Users/someonetoignore/work/other/local_test", id: 1
[2024-03-17T15:12:24+02:00 INFO language] fetching latest version of language server "rust-analyzer"
[2024-03-17T15:12:24+02:00 WARN isahc::handler] request completed with error: failed to resolve host name
[2024-03-17T15:12:24+02:00 INFO language] failed to fetch newest version of language server LanguageServerName("rust-analyzer"). falling back to using "/Users/someonetoignore/Library/Application Support/Zed/languages/rust-analyzer/rust-analyzer-2024-03-11"
[2024-03-17T15:12:24+02:00 INFO lsp] starting language server. binary path: "/Users/someonetoignore/Library/Application Support/Zed/languages/rust-analyzer/rust-analyzer-2024-03-11", working directory: "/Users/someonetoignore/work/other/local_test", args: []
```
Release Notes:
- Fixed language servers erased from the disk when project is opened
offline