This PR adds new SVGs for the pin and unpin icons, using a custom-made
one in a smaller size, and thus removing the `PinAlt` one I added just
recently. I also tweak the outline panel pin icon button tooltip strings
a bit.
Release Notes:
- N/A
This PR moves the local, remote, and ssh components of the LSP store
into their own types.
Release Notes:
- N/A
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Conrad <conrad@zed.dev>
Closes#5285, #14389
Changes:
- `DeleteToPreviousWordStart` now deletes '\n' separately from preceding
words and whitespace.
- `DeleteToNextWordEnd` now deletes '\n' and any following whitespace
separately from subsequent words.
- Added an `ignore_newlines` flag to both actions to optionally retain
the old behavior.
These modifications align the behavior more closely with other popular
editors like VSCode and Sublime:
- `DeleteToPreviousWordStart` now matches the default <Ctrl+Backspace>
action in those editors.
- `DeleteToNextWordEnd` becomes more intuitive and closely resembles the
default <Ctrl+Delete> behavior in those editors.
Release Notes:
- Improved `DeleteToPreviousWordStart` and `DeleteToNextWordEnd`
interactions around newlines. You can opt-in into the previous behavior
by adding {"ignore_newlines": true} to either action's binds in your
keymap. ([#5285](https://github.com/zed-industries/zed/issues/5285),
[#14389](https://github.com/zed-industries/zed/issues/14389))
This adds ability to the assistant panel's context editor to accept
files being dropped on it.
Multiple things can be dropped on the assistant panel:
- project panel entries (one or many)
- tabs (one)
- external files (one or many)
Release Notes:
- N/A
Demo:
https://github.com/user-attachments/assets/fddee751-cbdf-4e2c-ac80-35dfb857cc8a
Co-authored-by: Bennet <bennet@zed.dev>
Currently, had done the function for support included and excluded
history navigate, but the code is more duplicate, I will dive into find
better method to decrease the duplicate code.
Release Notes:
- N/A
---------
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
This PR updates the message content for an LLM request to allow it
contain tool uses.
We need to send the tool uses back to the model in order for it to
recognize the subsequent tool results.
Release Notes:
- N/A
Closes#16977
Release Notes:
- added current line as default sed range to match vim's behavior
- changed tests accordingly
This also simplifies `ReplaceCommand` implementation by changing
`Option<CommandRange>` to `CommandRange` .
This PR adds the initial groundwork for invoking tools in response to
tool uses from the model.
Tool uses are run when the model responds with a `stop_reason` of
`tool_use`.
Currently the tool results are just inserted as text into the user
message. We'll want to include these as `tool_result` content on the
message, but Claude seems to understand it regardless.
Release Notes:
- N/A
Users can now pass an env dictionary of string: string mappings to a
context server binary.
Release Notes:
- context_servers: Settings now allow the configuration of env variables
that are passed to the server process
This PR makes it so we propagate the `stop_reason` from Anthropic up to
the Assistant so that we can take action based on it.
The `extract_content_from_events` function was moved from `anthropic` to
the `anthropic` module in `language_model` since it is more useful if it
is able to name the `LanguageModelCompletionEvent` type, as otherwise
we'd need an additional layer of plumbing.
Release Notes:
- N/A
Release Notes:
- N/A
---
Add this for let GPUI element to support fade in-out animation.
## Platform test
- [x] macOS
- [x] blade `cargo run -p gpui --example opacity --features macos-blade`
## Usage
```rs
div()
.opacity(0.5)
.bg(gpui::black())
.text_color(gpui::black())
.child("Hello world")
```
This will apply the `opacity` it self and all children to use `opacity`
value to render colors.
## Example
```
cargo run -p gpui --example opacity
cargo run -p gpui --example opacity --features macos-blade
```
<img width="612" alt="image"
src="https://github.com/user-attachments/assets/f1da87ed-31f5-4b55-a023-39e8ee1ba349">
This adds a new button that on click, accepts the suggestion but does
not run the generated command.
https://github.com/user-attachments/assets/426b0ff3-8e19-435a-aa7f-89e062aefd4c
@danilo-leal @iamnbutler Any ideas on how to make both options
discoverable without having an extra button?
Release Notes:
- Added a way to accept terminal inline assist suggestions without
executing them
---------
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Closes#17232
Release Notes:
- Fixed inlay hints not being enabled for JavaScript when using the
`vtsls` language server. (They were enabled by default for TypeScript)
This PR adds a tool registry to hold tools that can be called by the
Assistant.
Currently we just have a `now` tool for retrieving the current datetime.
This is all behind the `assistant-tool-use` feature flag which currently
needs to be explicitly opted-in to in order for the LLM to see the
tools.
Release Notes:
- N/A
This PR adjusts the approach we use to encoding tool uses in the
completion response to use a structured format rather than simply
injecting it into the response stream as text.
In #17170 we would encode the tool uses as XML and insert them as text.
This would require then re-parsing the tool uses out of the buffer in
order to use them.
The approach taken in this PR is to make `stream_completion` return a
stream of `LanguageModelCompletionEvent`s. Each of these events can be
either text, or a tool use.
A new `stream_completion_text` method has been added to `LanguageModel`
for scenarios where we only care about textual content (currently,
everywhere that isn't the Assistant context editor).
Release Notes:
- N/A
This PR adds a `GET /models` endpoint to the LLM service.
This endpoint returns the models that the authenticated user has access
to.
This is the first step towards populating the models for the hosted
service from the server.
Release Notes:
- N/A
A friend of mine shared a Rust file with me that crashed Zed
consistently due to Arena space exhaustion. It is a dump of a proc macro
output that generates tests (among other things).
TL;DR: we were always laying out all run indicators, irrespective of
current scroll position. In his case, we were redundantly rendering
about 3k elements.
Obviously, this doesn't just fix the problems with Arena space
exhaustion - it should also improve perf in files with many runnables.
Release Notes:
- Improved editor performance in presence of many runnable indicators in
the gutter.
Part of https://github.com/zed-industries/zed/issues/14235
* moved search results highlight calculation into the background thread,
with highlight-less representation as a fallback
* show only a part of the line per search result, stop uniting them into
a single line if possible, always trim left trailing whitespaces
* highlight results in batches
* better cache all search result data, related to rendering
* add test infra and fix folding-related issues
* improve entry displays when multi buffer has a buffer search (find
references one has)
* fix cloud notes not showing search matches
Release Notes:
- Improved outline panel performance
This is a refactor to prepare for adding LSP support in SSH remote
projects.
Release Notes:
- N/A
---------
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>
Closes#4607
This is an attempt to enable Zed to run under multiple user accounts on
the same Mac, because it's a blocker to me really giving Zed a fair shot
at being my primary editor.
According to some helpful info from @ForLoveOfCats in #4607 the main
reason why this doesn't work is because Zed is using a Unix socket or
maybe a TCP socket with a hard-coded path and/or port. To me it looks
like it's a TCP socket so I tried changing that code in here, but I'm
stuck at trying to test it out because running `target/debug/zed` or
`target/release/zed` seems to behave differently than running an actual
app bundle. I had no luck copying the binary over to
/Applications/Zed.app/Contents/MacOS/zed because it can't find
WebRTC.framework which resides at a different relative path in the app
bundle.
If this seems like a desirable change to the core team then I'm looking
for some guidance on how to build an app bundle or otherwise test out
this change, or a nudge in the correct direction if I'm way off base
with my current approach.
Release Notes:
- Added multiuser support for up to 100 users on the same machine.
---------
Co-authored-by: Mikayla <mikayla@zed.dev>
What do all of the syntax-highlighted methods have in common in this
screenshot?
<img width="597" alt="image"
src="https://github.com/user-attachments/assets/7e3cced5-1857-44ca-8000-d2aa3c485726">
They're all trait methods. This is an unfortunate byproduct of how we
parse function signatures and handle details of completions. Other
non-syntax highlighted entries could get the highlighting for free, if
not for the fact that they lack a bit of data that is available for
trait methods.
This PR fixes this problem.
<img width="597" alt="image"
src="https://github.com/user-attachments/assets/065dc929-be00-46fc-a7c3-e63ed7ad6a0a">
Release Notes:
- Improved syntax highlighting of Rust methods in completions menu
This PR reverts #17173, as it introduced a segfault when opening any
Gleam project and the language server starts up.
This reverts commit a850731b0e.
Release Notes:
- N/A
Context: https://x.com/fasterthanlime/status/1819120238228570598
Up to this PR:
- We were not watching paths outside of a worktree when language server
requested it.
- We expected GlobPattern used for file watching to be always rooted at
the worktree root.
'1 mattered for observing global files (e.g. global RA config) and both
points had impact on "monorepos".
Let's picture the following scenario:
You're working on a Rust project that has two crates: bin and lib crate:
```
my-rust-project/
bin-crate/
lib-crate/
```
Up to this PR, making changes like changing field visibility in
lib-crate **was not reflected** in bin-crate until RA was restarted. RA
for bin-crate asked us to watch lib-crate. Now, depending on if you had
this project open as:
- a project with one worktree rooted at my-rust-project:
- due to '2, we never noticed that we have to notify RA instance for
bin-crate about changes in lib-crate.
- a project with two worktrees (bin-crate and lib-crate):
- due to '1 (as lib-crate is not within bin-crate's worktree), we once
again missed the fact that we have to watch for changes in lib-crate.
This PR solves this by introducing a side-channel - we just store fs
watchers for abs paths at the Project level. Worktree changes handling
is left relatively untouched - as it's used for other changes besides
LSP change notifying, I've figured to better leave it as is, as right
now we have 1 worktree change watcher; if we were to change it, we'd
have `(language server) + 1` watchers per worktree, which seems.. pretty
horrid.
What's the end effect? At the very least fasterthanlime should be a tad
happier; in reality though, I expect it to have some impact on LS
reliability in monorepo setups.
TODO
- [x] Wire through FileChangeType into `fs::watch` interface.
Release Notes:
- Improved language server reliability in multi-worktree projects and
monorepo. We now notify the language server more reliably about which
files have changed.
For ssh remoting lsps we'll need to have language server support
factored out of project.
Thus that begins
Release Notes:
- N/A
---------
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Mikayla <mikayla@zed.dev>
This PR makes the `github_user_created_at` field required at ingress
points into collab.
In practice we already have this value passed up, this change just makes
that explicit.
This is a precursor to making it required in the database.
Release Notes:
- N/A
Co-Authored-By: Mikayla <mikayla@zed.dev>
Co-Authored-By: Nate <nate@zed.dev>
Closes#15606Closes#13515
Release Notes:
- Fixes `-` being considered a word character for selections in some
languages
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Nate <nate@zed.dev>
This PR updates the Assistant with support for receiving tool uses from
Anthropic models and capturing them as text in the context editor.
This is just laying the foundation for tool use. We don't yet fulfill
the tool uses yet, or define any tools for the model to use.
Here's an example of what it looks like using the example `get_weather`
tool from the Anthropic docs:
<img width="644" alt="Screenshot 2024-08-30 at 1 51 13 PM"
src="https://github.com/user-attachments/assets/3614f953-0689-423c-8955-b146729ea638">
Release Notes:
- N/A
This PR removes the `cache_control` field from the variants in
`ResponseContent`.
This field is used on requests to control the caching behavior, but is
not needed on content in the response.
Release Notes:
- N/A
This PR splits the `Content` type for Anthropic into two new types:
`RequestContent` and `ResponseContent`.
As I was going through the Anthropic API docs it seems that there are
different types of content that can be sent in requests vs what can be
returned in responses.
Using a separate type for each case tells the story a bit better and
makes it easier to understand, IMO.
Release Notes:
- N/A
I have found an error running tests in Golang projects that use
submodules. This PR fixes the issue by accessing the directory before
running the test.
![image](https://github.com/user-attachments/assets/3790a77c-a07c-4467-be69-ee8e22675f7a)
The `commons` in the image is a git submodule in a subfolder inside a
parent folder where the workspace is set.
Release Notes:
- Fixed Go tests not being able to run in case the package (and the
`go.mod`) was in a nested folder. Pre-defined Go tasks have been changed
to now run in the package's directory. That means `go test ./package
-run MyTest` will run in `./package` and execute `go test -run MyTest`.
Also, `go test ./...` will run in the package directory, not at the root
of the Zed project, which is a small breaking change. In case one wants
to run `go test ./...` from the root, one can spawn a manual task that
does this.
![image](https://github.com/user-attachments/assets/b7c66f6a-ca29-421e-9539-737c8f719ae2)
---------
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Fixes this weird behavior:
- open an file, like `test.rs`
- `ctrl-n` create an new buffer
- `ctrl-s` save new buffer with name `test.rs`, select replace old file.
- the older open file also exist, this is weird.
Release Notes:
- Fixed two panes staying opening when saving a new buffer with the same filename as a file that was already open.
This fixes a bug that I've been running into for quite a while:
- Open a new terminal inside Zed
- (Center pane loses focus)
- (Workspace is serialized)
- Quit Zed
- Open Zed
- (Workspace is deserialized without an active pane)
- Put cursor in assistant panel
- Try to use `ActivatePaneInDirection` to go to the center
- Does not work
So what this fix does is to ensure that in case the pane does become
focused, even though it was already marked as focused, the active center
pane is set.
It also adds a fallback when trying to get the last active pane.
Release Notes:
- Fixed an issue where `workspace::ActivatePaneInDirection` could not
activate the center pane (i.e. one couldn't navigate from terminal or
assistant panel to the center pane) after loading Zed.
This reverts commit 9206561662.
It lead to this panic:
```
Thread "main" panicked with "invalid SecondaryMap key used" at /Users/thorstenball/work/zed/crates/gpui/src/app/entity_map.rs:120:22
0: backtrace::backtrace::libunwind::trace
at /Users/thorstenball/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.73/src/backtrace/libunwind.rs:116:5
backtrace::backtrace::trace_unsynchronized::<<backtrace::capture::Backtrace>::create::{closure#0}>
at /Users/thorstenball/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.73/src/backtrace/mod.rs:66:5
1: backtrace::backtrace::trace::<<backtrace::capture::Backtrace>::create::{closure#0}>
at /Users/thorstenball/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.73/src/backtrace/mod.rs:53:14
2: <backtrace::capture::Backtrace>::create
at /Users/thorstenball/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.73/src/capture.rs:197:9
3: <backtrace::capture::Backtrace>::new
at /Users/thorstenball/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.73/src/capture.rs:162:22
4: zed::reliability::init_panic_hook::{closure#0}
at /Users/thorstenball/work/zed/crates/zed/src/reliability.rs:58:29
5: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/alloc/src/boxed.rs:2077:9
std::panicking::rust_panic_with_hook
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/panicking.rs:799:13
6: std::panicking::begin_panic::<&str>::{closure#0}
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/panicking.rs:694:9
7: std::sys_common::backtrace::__rust_end_short_backtrace::<std::panicking::begin_panic<&str>::{closure#0}, !>
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/sys_common/backtrace.rs:171:18
8: std::panicking::begin_panic::<&str>
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/panicking.rs:693:12
9: <slotmap::secondary::SecondaryMap<gpui::app::entity_map::EntityId, alloc::boxed::Box<dyn core::any::Any>> as core::ops::index::Index<gpui::app::entity_map::EntityId>>::index
at /Users/thorstenball/.cargo/registry/src/index.crates.io-6f17d22bba15001f/slotmap-1.0.7/src/secondary.rs:866:21
10: <gpui::app::entity_map::EntityMap>::read::<vim::Vim>
at /Users/thorstenball/work/zed/crates/gpui/src/app/entity_map.rs:120:22
11: <gpui::app::entity_map::Model<vim::Vim>>::read
at /Users/thorstenball/work/zed/crates/gpui/src/app/entity_map.rs:397:9
12: <gpui::view::View<vim::Vim>>::read
at /Users/thorstenball/work/zed/crates/gpui/src/view.rs:81:9
13: <vim::VimAddon as editor::Addon>::should_show_inline_completions
at /Users/thorstenball/work/zed/crates/vim/src/vim.rs:138:20
14: <editor::Editor>::should_show_inline_completions
at /Users/thorstenball/work/zed/crates/editor/src/editor.rs:2347:21
15: <editor::Editor>::refresh_inline_completion
at /Users/thorstenball/work/zed/crates/editor/src/editor.rs:4988:17
16: <editor::Editor>::undo
at /Users/thorstenball/work/zed/crates/editor/src/editor.rs:6868:13
17: vim::normal::register::{closure#7}::{closure#0}
at /Users/thorstenball/work/zed/crates/vim/src/normal.rs:176:17
18: <vim::Vim>::update_editor::<(), vim::normal::register::{closure#7}::{closure#0}>::{closure#0}
at /Users/thorstenball/work/zed/crates/vim/src/vim.rs:693:45
19: <gpui:🪟:WindowContext as gpui::VisualContext>::update_view::<editor::Editor, (), <vim::Vim>::update_editor<(), vim::normal::register::{closure#7}::{closure#0}>::{closure#0}>
at /Users/thorstenball/work/zed/crates/gpui/src/window.rs:3890:22
20: <gpui:🪟:ViewContext<vim::Vim> as gpui::VisualContext>::update_view::<editor::Editor, (), <vim::Vim>::update_editor<(), vim::normal::register::{closure#7}::{closure#0}>::{closure#0}>
at /Users/thorstenball/work/zed/crates/gpui/src/window.rs:4522:9
21: <gpui::view::View<editor::Editor>>::update::<gpui:🪟:ViewContext<vim::Vim>, (), <vim::Vim>::update_editor<(), vim::normal::register::{closure#7}::{closure#0}>::{closure#0}>
at /Users/thorstenball/work/zed/crates/gpui/src/view.rs:76:9
22: <vim::Vim>::update_editor::<(), vim::normal::register::{closure#7}::{closure#0}>
at /Users/thorstenball/work/zed/crates/vim/src/vim.rs:693:14
23: vim::normal::register::{closure#7}
at /Users/thorstenball/work/zed/crates/vim/src/normal.rs:174:9
24: <gpui:🪟:ViewContext<vim::Vim>>::listener::<vim::normal::Undo, vim::normal::register::{closure#7}>::{closure#0}::{closure#0}
at /Users/thorstenball/work/zed/crates/gpui/src/window.rs:4444:40
25: <gpui:🪟:WindowContext as gpui::VisualContext>::update_view::<vim::Vim, (), <gpui:🪟:ViewContext<vim::Vim>>::listener<vim::normal::Undo, vim::normal::register::{closure#7}>::{closure#0}::{closure#0}>
at /Users/thorstenball/work/zed/crates/gpui/src/window.rs:3890:22
26: <gpui::view::View<vim::Vim>>::update::<gpui:🪟:WindowContext, (), <gpui:🪟:ViewContext<vim::Vim>>::listener<vim::normal::Undo, vim::normal::register::{closure#7}>::{closure#0}::{closure#0}>
at /Users/thorstenball/work/zed/crates/gpui/src/view.rs:76:9
27: <gpui::view::WeakView<vim::Vim>>::update::<gpui:🪟:WindowContext, (), <gpui:🪟:ViewContext<vim::Vim>>::listener<vim::normal::Undo, vim::normal::register::{closure#7}>::{closure#0}::{closure#0}>
at /Users/thorstenball/work/zed/crates/gpui/src/view.rs:192:12
28: <gpui:🪟:ViewContext<vim::Vim>>::listener::<vim::normal::Undo, vim::normal::register::{closure#7}>::{closure#0}
at /Users/thorstenball/work/zed/crates/gpui/src/window.rs:4444:13
29: <editor::Editor>::register_action::<vim::normal::Undo, <gpui:🪟:ViewContext<vim::Vim>>::listener<vim::normal::Undo, vim::normal::register::{closure#7}>::{closure#0}>::{closure#0}::{closure#0}
at /Users/thorstenball/work/zed/crates/editor/src/editor.rs:12053:25
30: <gpui:🪟:WindowContext>::dispatch_action_on_node
at /Users/thorstenball/work/zed/crates/gpui/src/window.rs:3514:21
31: <gpui:🪟:WindowContext>::dispatch_key_event
at /Users/thorstenball/work/zed/crates/gpui/src/window.rs:3303:13
32: <gpui:🪟:WindowContext>::dispatch_event
at /Users/thorstenball/work/zed/crates/gpui/src/window.rs:3131:13
33: <gpui:🪟:Window>:🆕:{closure#10}::{closure#0}
at /Users/thorstenball/work/zed/crates/gpui/src/window.rs:776:46
34: <gpui::app::AppContext as gpui::Context>::update_window::<gpui:🪟:DispatchEventResult, <gpui:🪟:Window>:🆕:{closure#10}::{closure#0}>::{closure#0}
at /Users/thorstenball/work/zed/crates/gpui/src/app.rs:1396:26
35: <gpui::app::AppContext>::update::<core::result::Result<gpui:🪟:DispatchEventResult, anyhow::Error>, <gpui::app::AppContext as gpui::Context>::update_window<gpui:🪟:DispatchEventResult, <gpui:🪟:Window>:🆕:{closure#10}::{closure#0}>::{closure#0}>
at /Users/thorstenball/work/zed/crates/gpui/src/app.rs:362:22
36: <gpui::app::AppContext as gpui::Context>::update_window::<gpui:🪟:DispatchEventResult, <gpui:🪟:Window>:🆕:{closure#10}::{closure#0}>
at /Users/thorstenball/work/zed/crates/gpui/src/app.rs:1387:9
37: <gpui::app::async_context::AsyncAppContext as gpui::Context>::update_window::<gpui:🪟:DispatchEventResult, <gpui:🪟:Window>:🆕:{closure#10}::{closure#0}>
at /Users/thorstenball/work/zed/crates/gpui/src/app/async_context.rs:91:9
38: <gpui:🪟:AnyWindowHandle>::update::<gpui::app::async_context::AsyncAppContext, gpui:🪟:DispatchEventResult, <gpui:🪟:Window>:🆕:{closure#10}::{closure#0}>
at /Users/thorstenball/work/zed/crates/gpui/src/window.rs:4750:9
39: <gpui:🪟:Window>:🆕:{closure#10}
at /Users/thorstenball/work/zed/crates/gpui/src/window.rs:775:17
40: <alloc::boxed::Box<dyn core::ops::function::FnMut<(gpui::interactive::PlatformInput,), Output = gpui:🪟:DispatchEventResult>> as core::ops::function::FnMut<(gpui::interactive::PlatformInput,)>>::call_mut
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/alloc/src/boxed.rs:2070:9
41: gpui::platform::mac:🪟:handle_key_event
at /Users/thorstenball/work/zed/crates/gpui/src/platform/mac/window.rs:1300:32
42: gpui::platform::mac:🪟:handle_key_down
at /Users/thorstenball/work/zed/crates/gpui/src/platform/mac/window.rs:1212:5
43: <unknown>
44: <unknown>
45: <unknown>
46: <unknown>
47: <unknown>
48: <() as objc::message::MessageArguments>::invoke::<()>
at /Users/thorstenball/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc-0.2.7/src/message/mod.rs:128:17
49: objc::message::platform::send_unverified::<objc::runtime::Object, (), ()>
at /Users/thorstenball/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc-0.2.7/src/message/apple/mod.rs:27:9
50: objc::message::send_message::<objc::runtime::Object, (), ()>
at /Users/thorstenball/.cargo/registry/src/index.crates.io-6f17d22bba15001f/objc-0.2.7/src/message/mod.rs:178:5
<*mut objc::runtime::Object as cocoa::appkit::NSApplication>::run
at /Users/thorstenball/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cocoa-0.26.0/src/appkit.rs:628:9
51: <gpui::platform::mac::platform::MacPlatform as gpui::platform::Platform>::run
at /Users/thorstenball/work/zed/crates/gpui/src/platform/mac/platform.rs:427:13
52: <gpui::app::App>::run::<zed::main::{closure#3}>
at /Users/thorstenball/work/zed/crates/gpui/src/app.rs:159:9
53: zed::main
at /Users/thorstenball/work/zed/crates/zed/src/main.rs:439:5
54: <fn() as core::ops::function::FnOnce<()>>::call_once
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/ops/function.rs:250:5
55: std::sys_common::backtrace::__rust_begin_short_backtrace::<fn(), ()>
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/sys_common/backtrace.rs:155:18
56: std::rt::lang_start::<()>::{closure#0}
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/rt.rs:159:18
57: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/core/src/ops/function.rs:284:13
std::panicking::try::do_call
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/panicking.rs:559:40
std::panicking::try
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/panicking.rs:523:19
std::panic::catch_unwind
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/panic.rs:149:14
std::rt::lang_start_internal::{{closure}}
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/rt.rs:141:48
std::panicking::try::do_call
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/panicking.rs:559:40
std::panicking::try
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/panicking.rs:523:19
std::panic::catch_unwind
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/panic.rs:149:14
std::rt::lang_start_internal
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/rt.rs:141:20
58: std::rt::lang_start::<()>
at /rustc/051478957371ee0084a7c0913941d2a8c4757bb9/library/std/src/rt.rs:158:17
59: _main
```
Release Notes:
- N/A
This fixes an annoying bug I ran into, where supermaven completions
would show up in normal mode.
cc @ConradIrwin not sure if this is the best way to fix this, but it
seems like the neatest? On one hand, I didn't want to touch into Vim
from the editor, and on the other I didn't want to add another boolean
on the editor that flips on when in normal mode. So instead I extended
the Addon interface.
Release Notes:
- Fixed inline completions (Copilot or Supermaven) showing up in Vim's
normal mode.
Context servers might return CR characters, which are not acceptable in
Zed and cause ranges to be invalidated. We need to normalize them.
Closes#17109
Release Notes:
- context_servers: Fixed an issue where context servers returning a
carriage return character would result in a panic.
This PR adds support for completions via MCP. The protocol now supports
a new request type "completion/complete"
that can either complete a resource URI template (which we currently
don't use in Zed), or a prompt argument.
We use this to add autocompletion to our context server slash commands!
https://github.com/user-attachments/assets/08c9cf04-cbeb-49a7-903f-5049fb3b3d9f
Release Notes:
- context_servers: Added support for argument completions for context
server prompts. These show up as regular completions to slash commands.
This PR adds an initial set of default colors to `gpui`.
These will power default-styled gpui components (things like checkboxes,
buttons, inputs, etc.), storybook, and give a very simple,
appearance-aware set of colors out of the box for folks to build with.
These colors will evolve and be updated in the near future, they are
literally pulled from Finder for now :)
The API might not be perfect, I focused on getting something in quickly
that we can iterate on!
### Usage
```rs
use gpui::{colors, DefaultColor}
fn auto(cx: &WindowContext) -> {
// Init the full set of DefaultColors
let colors = colors(cx.appearance());
// Use a color
// It will automatically give you the correct color for the system's
// current appearance.
let background = DefaultColor::Background.hsla(&colors)
}
fn manual() -> {
// Init the full sets of DefaultColors
let light_colors = DefaultColors::light();
let dark_colors = DefaultColors::dark();
// Use a color
// Maybe for some fancy inverted element
let background = DefaultColor::Background.hsla(&light_colors)
let inverted_background = DefaultColor::Background.hsla(&dark_colors)
let inverted_text = DefaultColor::Text.hsla(&dark_colors)
}
```
Note: We need `cx` for the auto way as we need to get the system
appearance from the App/Window/ViewContext via `cx.appearance()`.
### Example
You can run `script/storybook default_colors` to open the Default Colors
story:
| Light | Dark |
|-------|------|
| ![CleanShot 2024-08-29 at 16 19
20@2x](https://github.com/user-attachments/assets/80369de4-8926-4b30-80f5-f81a8a7b9531)
| ![CleanShot 2024-08-29 at 16 19
33@2x](https://github.com/user-attachments/assets/fd7a2aae-27e6-460f-a054-8f37623dc96d)
|
Release Notes:
- N/A
/cc @mrnugget
Release Notes:
- Fixed an issue where toggling inline completions in a markdown file
did not work correctly
---------
Co-authored-by: Marshall <marshall@zed.dev>
## Todo
* [x] Parse and present new XML output
* [x] Resolve new edits to buffers and anchor ranges
* [x] Surface resolution errors
* [x] Steps fail to resolve because language hasn't loaded yet
* [x] Treat empty `<symbol>` tag as None
* [x] duplicate assists when editing steps
* [x] step footer blocks can appear *below* the following message header
block
## Release Notes:
- N/A
---------
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Peter <peter@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
This changes the Zed CLI `zed` to pass along the environment to the Zed
project that it opens (if it opens a new one).
In projects, this CLI environment will now take precedence over any
environment that's acquired by running a login shell in a projects
folder.
The result is that `zed my/folder` now always behaves as if one would
run `zed --foreground` without any previous Zed version running.
Closes#7894Closes#16293
Related issues:
- It fixes the issue described in here:
https://github.com/zed-industries/zed/issues/4977#issuecomment-2305272027
Release Notes:
- Improved the Zed CLI `zed` to pass along the environment as it was on
the CLI to the opened Zed project. That environment is then used when
opening new terminals, spawning tasks, or language servers.
Specifically:
- If Zed was started via `zed my-folder`, a terminal spawned with
`workspace: new terminal` will inherit these environment variables that
existed on the CLI
- Specific language servers that allow looking up the language server
binary in the environments `$PATH` (such as `gopls`, `zls`,
`rust-analyzer` if configured, ...) will look up the language server
binary in the CLI environment too and use that environment when starting
the process.
- Language servers that are _not_ found in the CLI environment (or
configured to not be found in there), will be spawned with the CLI
environment in case that's set. That means users can do something like
`RA_LOG=info zed .` and it will be picked up the rust-analyzer that was
spawned.
Demo/explanation:
https://github.com/user-attachments/assets/455905cc-8b7c-4fc4-b98a-7e027d97cdfa
This PR attaches the `geoip_country_code` that we source from
Cloudflare's `CF-IPCountry` header to the HTTP request spans.
This will allow us to see where traffic is originating geographically.
Release Notes:
- N/A
- Cloudflare provides ISO-3166-1 country code for protectorates. Expand our allowlist to include the territories of countries on the allowlist (US, UK, France, Australia, New Zealand).
- Also include the country_code in the error message when we block.
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
- Remove "-" from word_character for CSS/JS/TSX/Markdown
- Makes our word-selection behavior consistent across language modes (and consistent with VSCode).
This test was flaky because both tasks were started at the same time and
the first one that would win, would navigate the editor.
Now the order is fixed, because the second task is only spawned after
the first one.
Release Notes:
- N/A
---------
Co-authored-by: Kirill <kirill@zed.dev>
Server can now include an optional description in a `prompts/get`
response. Zed will displayed the description as label of the slash
command.
Release Notes:
- context_servers: Servers can provide an optional description in
`prompts/get` responses that is displayed as the slash command label.
In the current `default.json`, `*_font_fallbacks=[]`, which results in
the `fallbacks` value in the `Font` struct always being `Some(...)`.
This PR introduces the following improvements:
1. Changed `*_font_fallbacks = []` to `*_font_fallbacks = null` in
`default.json`.
2. Enhanced the macOS and Windows implementations.
Release Notes:
- N/A
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [cocoa](https://togithub.com/servo/core-foundation-rs) | dependencies
| minor | `0.25` -> `0.26` |
| [cocoa](https://togithub.com/servo/core-foundation-rs) |
workspace.dependencies | minor | `0.25` -> `0.26` |
---
### 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:eyJjcmVhdGVkSW5WZXIiOiIzOC41Ni4wIiwidXBkYXRlZEluVmVyIjoiMzguNTYuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
---------
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Mikayla <mikayla@zed.dev>
Closes#6783
With this PR, the `journal: new journal entry` command only opens a new
workspace if the current workspace does not already contain the
`journal` directory. Both the root of the work tree and all its
subdirectories are checked.
This does not yet check for the day's file specifically, as suggested
[here](https://github.com/zed-industries/zed/issues/6783#issuecomment-2268509463).
I'm new to writing Rust code in production (as well as contributing in
general), so any feedback is much appreciated!
Release Notes:
- Reuse workspace on `journal: new journal entry` command if possible
Closes#10782
In some cases, during the auto-update process,
the update can fail and leave a dangling disk image in macOS. If the
auto-update fails again, a new dangling mounted volume will be left
behind. To avoid polluting the system with these dangling mounted disk
images,
implement [the `Drop`
trait](https://doc.rust-lang.org/std/ops/trait.Drop.html) for the
`MacOSUnmounter` struct. This will ensure that the disk image
is unmounted when the `install_release_macos` function exits regardless
of its result.
## How to test this locally
Unfortunately, I was a bit too lazy to find a smarter way to test this,
so I simply commented out a bunch of lines to emulate the auto-update
process. To replicate the linked issue (#10782), you can apply the
attached patch. Build the Zed binary and run it. The auto-update should
fail, leaving the dangling mounted disk image in the system:
```shell
>diskutil list
/dev/disk5 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +220.6 MB disk5
Physical Store disk4s1
1: APFS Volume Zed 190.6 MB disk5s1
```
Run the Zed binary again to create another mounted disk image:
```shell
>diskutil list
/dev/disk5 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +220.6 MB disk5
Physical Store disk4s1
1: APFS Volume Zed 190.6 MB disk5s1
/dev/disk7 (synthesized):
#: TYPE NAME SIZE IDENTIFIER
0: APFS Container Scheme - +220.6 MB disk7
Physical Store disk6s1
1: APFS Volume Zed 190.6 MB disk7s1
```
[simulate_zed_autoupdate.patch](https://github.com/user-attachments/files/16787955/simulate_zed_autoupdate.patch)
Please let me know if the fix is good; otherwise, I am happy to
implement it differently. Thanks!
Release Notes:
- Fixed#10782
Closes#12313
This PR introduces the following improvements:
1. Fixed the issue where the auto-hide taskbar wouldn't automatically
appear when Zed is maximized.
2. Refactored the `WM_NCCALCSIZE` code, making it more human-readable.
Release Notes:
- Fixed auto-hide taskbar would refuse to show itself when `Zed` is
maximized on
Winodws([#12313](https://github.com/zed-industries/zed/issues/12313)).
---------
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
when the focused_vim is deactivate, focused_vim should set none.
fix the problem that opening the first buffer from EmptyPane will not
toggle,The reason is the edge case where focused_vim is none when
opening for the first time.
Release Notes:
- N/A
At the moment Zed is handled as default file browser which causes
applications like RustRover to open Zed when instead it should open the
Gnome files app. And Zed is probably not intended to be an replacement
to the Gnome files app for example.
I'm also currently waiting to fix the issue that Zed is not displayed as
an "Application" when using "Open with..." on Arch Linux. Which is
caused by not setting `APP_ARGS` which should have the value `%F`
Release Notes:
- Fixed: Zed will no longer be handled as default file browser
This PR fixes two issues:
1. The prompt library window didn't set an `app_id` on Linux, which
caused it to be missing the Zed logo
2. A dangling reference to the window in the Wayland client code, which
caused the prompt library window not to close. See:
https://github.com/zed-industries/zed/pull/13201
Release Notes:
- Linux: Fixed the prompt library not closing on Wayland
---------
Co-authored-by: Junkui Zhang <364772080@qq.com>
Release Notes:
- N/A
This updates the IME position every time the selection changes, this is
probably only useful when you enumerate languages with your IME.
TODO:
- ~There is a rare chance that the ime panel is not updated because the
window input handler is None.~
- ~Update IME panel in vim mode.~
- ~Update IME panel when leaving Buffer search input.~
---------
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Closes#15826Closes#16068
When launching zed from the command line, the path parsing prefixes with
`\\?\`. Some LSP servers do not support this type of path, so here I
just simply remove the prefix.
Release Notes:
- N/A
Depending on a number of CPU cores llvmpipe could provide adequate
performance.
A little bit of help to skip searching Zed codebase for solution.
Release Notes:
- N/A
Closes#15441 .
Fixed the issue where extensions couldn't start if the path contained
spaces. Additionally, this PR introduces the `node_environment_path`
function to obtain the PATH environment variable which includes the node
path.
Release Notes:
- N/A
On Windows, different input methods use different APIs to set their
window positions:
- The Japanese input method on Windows 11 uses `ImmSetCandidateWindow`.
- The Chinese input method on Windows 10 uses `ImmSetCompositionWindow`.
- The Chinese input method on Windows 11 can use either.
Therefore, this PR calls both functions to cover the various scenarios.
Additionally, introduced a helper function `with_input_handler` to
improve code readability.
Release Notes:
- N/A
This PR implements a single instance mechanism using the `CreateEventW`
function to create a mutex. If the identifier name begins with `Local`,
the single instance applies only to processes under the same user. If
the identifier begins with `Global`, it applies to all users.
Additionally, I was thinking that perhaps we should integrate the single
instance functionality into `gpui`. I believe applications developed
using `gpui` would benefit from this feature. Furthermore, incorporating
the single instance implementation into `gpui` would facilitate the
`set_dock_menu` functionality. As I mentioned in #12068, the
implementation of `set_dock_menu` on Windows depends on the single
instance feature. When a user clicks the "dock menu", Windows will open
a new application instance. To achieve behavior similar to macOS, we
need to prevent the new instance from launching and instead pass the
parameters to the existing instance.
Any advice and suggestions are welcome.
https://github.com/user-attachments/assets/c46f7e92-4411-4fa9-830e-383798a9dd93
Release Notes:
- N/A
Closes#16919
repro step:
- add two worktree
- modify settings `"use_system_path_prompts" : false`
- `ctrl-n` create new file, typing any chars.
- `ctrl-s` save file
- typing any char, crashed.
Release Notes:
- Fixed crashed when setting `"use_system_path_prompts": false` or in
remote project with two or more worktree.
This PR puts the `zed: open account settings` action behind the
`zed-pro` feature flag, as it isn't supposed to be visible to users yet.
Closes https://github.com/zed-industries/zed/issues/17010.
Release Notes:
- N/A
This PR updates the extensions UI to truncate long text with an
ellipsis.
| Before | After |
|
--------------------------------------------------------------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------------------------------------------------------------
|
| <img width="538" alt="Screenshot 2024-08-28 at 10 25 29 AM"
src="https://github.com/user-attachments/assets/98fda7b9-aac0-4c1b-903b-0d72070a166b">
| <img width="538" alt="Screenshot 2024-08-28 at 10 21 42 AM"
src="https://github.com/user-attachments/assets/948b1e66-3822-4c52-8483-522c28f393c7">
|
Release Notes:
- Improved the truncation of long author lists and descriptions in the
extensions view.
This PR reverts the addition of extension capabilities from #16953.
While these may end up being useful at some point, after some discussion
they don't seem like the exact fit for what we're looking to do right
now.
This reverts commit 8ec36f1e2b.
Release Notes:
- N/A
Before, when using `?` and `#` for backwards search it would initially
search for the previous match, but upon subsequent inputs to `n` and
`N`, `n` is always treated as "forward" and `N` is always treated as
"backward", instead of continuing the search direction.
now, if i use `?` or `#` for backward search, `n` will go to the
previous selection, and `N` will go to the next. Functionality stays the
same for `/` and `*`.
Release Notes:
- vim: Fixed `n` direction after searching backwards
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
As part of allowing LSPs to run remotely, we need to move LSP stuff
out of project. To do that we'd like to simplify the concurrency story
on project syncing.
Co-Authored-By: Max <max@zed.dev>
Release Notes:
- N/A
Co-authored-by: Max <max@zed.dev>
Ensures we sort paths in search the same as we do in panels.
Ideally we'd store things like this in the worktree, but the sort order
depends
on file vs directory, and callers generally don't know which they're
asking for.
Release Notes:
- N/A
This improves performance, because we don't render after every single
match/range that was added to the results.
I think for my example search it's twice as fast?
## Numbers
Recorded in debug mode (because it's 6:30pm and my poor computer has
spun its fan enough for today and also because you can see the change of
the effect more in debug mode), rendering `<` searched in `zed.dev`
repo:
- Before: `14.59558225s`
- After: `2.604320875s`
## Videos
Before (recorded in release mode):
https://github.com/user-attachments/assets/909260fa-3e69-49ab-8786-dd384e2a27ee
After (recorded in release mode):
https://github.com/user-attachments/assets/fc8a85d3-e575-470f-b59c-16a6df8b3f80
## Release Notes
Release Notes:
- Improved performance of rendering project-search results in the
multi-buffer after finding them.
This is a prototype change to improve latency of local project searches.
It refactors the matcher to keep paths "in-order" so that we don't need
to wait for all matching files to display the first result.
On a test (searching for `<` in zed.dev) it changes the time until first
result from about 2s to about 50ms. The tail latency seems to increase
slightly (from 5s to 7s) so we may want to do more tuning before hitting
merge.
Release Notes:
- reduces latency for first project search result
---------
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Thorsten <thorsten@zed.dev>
This PR adds an initial notion of extension capabilities.
Capabilities are used to express the operations an extension is capable
of doing. This will provide further insights into what an extension can
do, as well as provide the ability to grant or deny the set of
capabilities.
Capabilities are defined in the `capabilities` field in the extension
manifest. This field contains an array of capabilities.
Each capability has a `kind` to denote the known capability it
corresponds to. Individual capabilities may have additional fields,
based on the `kind`.
Here's an example of some capabilities:
```toml
capabilities = [
{ kind = "download-file", host = "github.com", path_prefix = "owner/repo" },
{ kind = "npm:install", package = "@vue/language-server" },
]
```
In order to avoid a breaking change, the `capabilities` field is
currently optional and defaults to an empty array. This will allow us to
add support for extensions to define capabilities before we start
enforcing them.
Release Notes:
- N/A
This adds a new action: `editor: toggle inline completions`.
It allows users to toggle inline completions on/off for the current
buffer.
That toggling is not persistent and when the editor is closed, it's
gone.
That makes it easy to disable inline completions for a single text
buffer, for example, even if you want them on for other buffers.
When toggling on/off, the toggling also overwrites any language
settings. So if you have inline completions disabled for Go buffers,
toggling them on takes precedence over those settings.
Release Notes:
- Added a new editor action to allow toggling inline completions
(Copilot, Supermaven) on and off for the current buffer, taking
precedence over any settings.
Co-authored-by: Antonio <antonio@zed.dev>
As discussed in #15326, this font name should be included in the font
list since `settings.json` indicates that one can set the font to
`.SystemUIFont`.
Release Notes:
- N/A
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This is officially my weirdest performance fix to date; With large # of
windows opening app menu could take a lot of time (we're talking few
seconds with 9 windows, a minute with 10 windows). The fix is to make
one method pub(crate).. What?
<img width="981" alt="image"
src="https://github.com/user-attachments/assets/83b26154-0acd-43ef-84b3-4b85cde36120">
We were spending most of the time on clear_pending_keystrokes, which -
funnily enough - called itself recursively. It turned out we have two
methods; `AppContext::clear_pending_keystrokes` and
WindowContext::clear_pending_keystrokes. The former calls the latter,
but - due to the fact that `WindowContext::clear_pending_keystrokes` is
private and `WindowContext` derefs to `AppContext` - `AppContext` one
ended up actually calling itself! The fix is plain and simple - marking
WindowContext one as pub(crate), so that it gets picked up as a method
to call over `AppContext::clear_pending_keystrokes`.
Closes#16895
Release Notes:
- Fixed app menu performance slowdowns when there are multiple windows
open.
***Update**: after rebasing on top of
https://github.com/zed-industries/zed/pull/16915/ (that also changed how
search worked), the results are still good, but not 10x. Instead of
going from 10s to 500ms, it goes from 10s to 3s.*
This improves the performance of project-wide search by an order of
magnitude.
After digging in, @as-cii and I found that opening buffers was the
bottleneck for project-wide search (since Zed opens, parses, ... buffers
when finding them, which is something VS Code doesn't do, for example).
So this PR improves the performance of opening multiple buffers at once.
It does this by doing two things:
- It batches scan-requests in the worktree. When we search, we search
files in chunks of 64. Previously we'd handle all 64 scan requests
separately. The new code checks if the scan requests can be batched and
if so it, it does that.
- It batches `git status` calls when reloading the project entries for
the opened buffers. Instead of calling `git status` for each file, it
calls `git status` for a batch of files, and then extracts the status
for each file.
(It has to be said that I think the slow performance on `main` has been
a regression introduced over the last few months with the changes made
to project/worktree/git. I don't think it was this slow ~5 months ago.
But I also don't think it was this fast ~5 months ago.)
## Benchmarks
| Search | Before | After (without
https://github.com/zed-industries/zed/pull/16915) | After (with
https://github.com/zed-industries/zed/pull/16915)
|--------|--------|-------|------|
| `zed.dev` at `2b2a501192e78e`, searching for `<` (`4484` results) |
3.0s<br>2.9s<br>2.89s | 489ms<br>517ms<br>476ms | n/a |
| `zed.dev` at `2b2a501192e78e`, searching for `:` (`25886+` results) |
3.9s<br>3.9s<br>3.8s | 70ms<br>66ms<br>72ms | n/a |
| `zed` at `55dda0e6af`, searching for `<` (`10937+` results) |
10s<br>11s<br>12s | 500m<br>499ms<br>543ms | 3.4s<br>3.1s<br> |
(All results recorded after doing a warm-up run that would start
language servers etc.)
Release Notes:
- Performance of project-wide search has been improved by up to 10x.
---------
Co-authored-by: Antonio <antonio@zed.dev>
Follow up to #16080
The idea is that the current context menu became a bit top-heavy over
time. Let's reorganisze it into four sections:
1. Finding symbols
2. Editing using lsp and similar
3. Copy/Cut/Paste
4. Getting file location
Release Notes:
- Reorganized context menu to be a bit less top heavy and have more
logical parts
Before (a giant part on top and two small ones on the bottom):
<img width="248" alt="Screenshot 2024-08-23 at 21 02 33"
src="https://github.com/user-attachments/assets/87a136c7-df16-4032-ba02-dea087fd8445">
After (much more balanced):
<img width="250" alt="Screenshot 2024-08-23 at 21 01 28"
src="https://github.com/user-attachments/assets/4aa48b8a-99f3-4315-b325-625a47ecd5b8">
It looks like this unwrap was introduced in
https://github.com/zed-industries/zed/pull/16534.
I think a worktree's `root_entry` can be null if it represents a
non-existent file that has not yet been saved. I hit a panic due to the
`unwrap` a couple of times on nightly.
Release Notes:
- N/A
This PR fixes an issue where active user counts were being computed
across _all_ measures instead of the per-minute measures.
We now compute them using the tokens per minute measure, as we're
concerned with usage in recent minutes.
Release Notes:
- N/A
Closes#14787.
I made a quick draft implementation of this feature request:
https://github.com/zed-industries/zed/issues/14787
I know how to use use gdb well, so lacking a built-in debugger is OK.
BUT... Speaking personally, setting breakpoints is 50% of what I want an
IDE to do for me when debugging. Having a feature where I can click,
copy, "b [paste]", is a huge step up from typing the whole thing in
manually. I figure this must be useful for other external tools, or even
just regular-human-communication too.
Open Questions:
* Does this belong in the right click menu? (I put it next to "Copy
Permalink" which is similar.)
* Probably not useful enough to get a default keymap?
* Relative vs absolute path?
* Does this need tests?
Release Notes:
- Added `editor: copy file location` command to copy the current file
location (FILE:LINE) to the clipboard
([#14787](https://github.com/zed-industries/zed/issues/14787)).
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Release Notes:
- Fixed the issue related to the project wide search being stuck when
project contains .fifo files
- Might potentially solve the following issue
https://github.com/zed-industries/zed/issues/7360
We've noticed performance issues in long conversations with assistants;
the profiles pointed to slowiness in WrapMap (and indeed there were some
low hanging fruits that we picked up in
https://github.com/zed-industries/zed/pull/16761). That however did not
fully resolve the issue, as WrapMap still cracked through in profiles;
basically, the speedup I've landed has just moved the post elsewhere.
The higher level issue is that we were trying to refresh message headers
for all messages, irrespective of whether they've actually needed to be
updated. This PR fixes that by using `replace_blocks` API where
possible.
Release Notes:
- Improved performance of Assistant Panel with long conversations.
This helps debug what steps are taken and where
the compiled extension ended up.
Also remove duplicate "compiling Rust extension" / "compiling rust
extension" text - it's confusing.
Release Notes:
- N/A
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Temporarily revert #16700 to deal with this error:
`error: manifest path `../crates/docs_preprocessor/Cargo.toml` does not
exist` as it was causing the docs-preprocessor not to run, meaning
unexpanded templates were showing up in the public docs.
Reverts zed-industries/zed#16700
Release Notes:
- N/A
This PR adds a mdbook preprocessor for supporting Zed's docs.
This initial version adds the following custom commands:
**Keybinding**
`{#kb prefix::action_name}` (e.g. `{#kb zed::OpenSettings}`)
Outputs a keybinding template like `<kbd
class="keybinding">{macos_keybinding}|{linux_keybinding}</kbd>`. This
template is processed on the client side through `mdbook` to show the
correct keybinding for the user's platform.
**Action**
`{#action prefix::action_name}` (e.g. `{#action zed::OpenSettings}`)
For now, simply outputs the action name in a readable manner. (e.g.
zed::OpenSettings -> zed: open settings)
In the future we'll add additional modes for this template, like create
a standard way to render `{action} ({keybinding})`.
## Example Usage
```
To open the assistant panel, toggle the right dock by using the {#action workspace::ToggleRightDock} action in the command palette or by using the
{#kb workspace::ToggleRightDock} shortcut.
```
Release Notes:
- N/A
Closes#16804
Similar to #15708, when reading prompts from a template, both Windows
and Linux might end up with `CRLF (\r\n)` line endings, which can result
in a panic.
Release Notes:
- N/A
* Linux Clippy lints fixed
* Zed local tasks are now simpler to rerun
* Zed's `release-fast` build profile keeps the debug info so it's
possible to properly debug things without altering the sources
Release Notes:
- N/A
Follow-up https://github.com/zed-industries/zed/pull/16085 that fixes
the search deploy to be actually a part of the terminal-related
bindings.
Part of https://github.com/zed-industries/zed/issues/16839
Also
* fixes few other bindings to use `shift` and avoid conflicts with the
existing key bindings.
* adds terminal inline assist to the context menu and makes both the
menu and the button to dynamically adjust to `assist.enabled` settings
change
It is still unclear to me, why certain labels for certain bindings are
wrong (it's still showing `ctrl-w` for closing the terminal tab, and
`shift-insert` instead of `ctrl-shift-v` for Paste, while Insert is near
and has a `ctrl-shift-c` binding shown) but at least the keys work now.
Release notes:
- Improved Linux terminal keymap and context menu
Prototypes a way to display new entities in the outline panel, making it
less outline.
The design is not final and might be adjusted, but the workflow seems to
be solid enough to keep and iron it out.
* Now, when any project search buffer is activated (multi buffer mode),
or buffer search is open (singleton buffer mode, but is available for
search usages multi buffer too — in that case buffer search overrides
multi buffer's contents display), outline panel displays all search
matches instead of the outline items.
Outline items are not displayed at all during those cases, unless the
buffer search is closed, or a new buffer gets opened, of an active
buffer search matches zero items.
https://github.com/user-attachments/assets/4a3e4faa-7f75-4522-96bb-3761872c753a
* For the multi buffer mode, search matches are grouped under
directories and files, same as outline items
![Screenshot 2024-08-21 at 14 55
01](https://github.com/user-attachments/assets/6dac75e4-be4e-4338-917b-37a32c285b71)
* For buffer search , search matches are displayed one under another
![image](https://github.com/user-attachments/assets/9efcff85-d4c7-4462-9ef5-f76b08e59f20)
For both cases, the entire match line is taken and rendered, with the
hover tooltip showing the line number.
So far it does not look very bad, but I am certain there are bad cases
with long lines and bad indents where it looks not optimal — this part
most probably will be redesigned after some trial.
Or, maybe, it's ok to leave the current state if the horizontal
scrollbar is added?
Clicking the item navigates to the item's position in the editor.
Search item lines are also possible to filter with the outline panel's
filter input.
* Inline panel is now possible to "pin" to track a currently active
editor, to display outlines/search results for that editor even if
another item is activated afterwards:
![image](https://github.com/user-attachments/assets/75fb78c3-0e5f-47b4-ba3a-485c71d7e342)
This is useful in combination with project search results display: now
it's possible to leave the search results pinned in the outline panel
and jump to every search result and back.
If the item the panel was pinned to gets closed, the panel gets back to
its regular state, showing outlines/search results for a currently
active editor.
Release Notes:
- Added a way to display buffer/project search entries in the outline
panel
This PR fixes a regression from
https://github.com/zed-industries/zed/pull/15646 where we've started
fetching diagnostic spans unconditionally (whereas previously that
wasn't done when iterating over raw text).
Closes#16764
Release Notes:
- Fixed performance regression in handling buffers with large quantities
of diagnostics.
This PR adds a lifetime spending limit on LLM usage.
Exceeding this limit will prevent further use of the Zed LLM provider.
Currently the cap is $1,000.
Release Notes:
- N/A
Closes#15891
Release Notes:
- Added "Format Buffer" action to the right-click menu within a buffer.
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
We've ran into performance issues when reinserting new blocks into the
assistant panel; in profiles WrapMap showed up, as we try to query wrap
boundaries over and over, which is a hidden O(n^2) - for each block, we
may potentially look at all of the Wraps. This PR alleviates this issue
by storing away previously resolved wrap range; consecutive iterations
can often reuse it.
This should help with performance of Assistant Panel with long
conversations.
Release Notes:
- Improved performance of assistant panel with large # of text.
This PR follows up #16466, changes the default value used when
autocompleting the `ui_font_fallbacks` and `ui_font_fallbacks` settings
from `null` to `[]`.
Special thanks to @maxdeviant for the guidance on writing better code!
Release Notes:
- N/A
This PR fixes impersonation in local development by fetching the user
from the GitHub API so we can get their `github_user_id`.
The `github_user_id` is now required after #16704.
Since this is just a development flow, we're fetching the user on the
client as opposed to making changes on the server.
This request uses the `GITHUB_TOKEN` environment variable for
authentication, if it exists, or will make an unauthenticated GitHub API
request.
Release Notes:
- N/A
Fixes#16199
## Description
Recently added template string injections do not completely work for
because any time there is an interpolation (`${// some js content}`)
within an element, its closing tag is not highlighted properly:
![image](https://github.com/user-attachments/assets/e660894b-6e4b-4300-b8d9-2757fa235679)
This PR fixes the issue:
![image](https://github.com/user-attachments/assets/629a30c3-9b3a-4338-aee9-622dbb19581c)
Release Notes:
- Fixed incomplete syntax highlighting for HTML injections inside
JavaScript template tags.
## Note
I'm a beginner with treesitter so I only modified the part for HTML
usecase.
Should the same solution be applied to other injections (`css`, `js`,
etc.)?
This allows us to detect the language from the extension if we use paths
in fenced code blocks.
Release Notes:
- You can now use file paths ending in a language-specific file
extension at the start of markdown code blocks.
This PR makes it so users are upserted by their `github_user_id` instead
of by their `github_login`.
The `github_user_id` is a stable identifier that does not change, while
the `github_login` can change.
In practice we were already using
`get_or_create_user_by_github_account`, which already checks for an
existing user with a `github_user_id` first, so this change doesn't
result in a change in behavior.
This change is primarily for correctness in the event that `create_user`
is called directly, as we want to be upserting by the stable identifier.
Release Notes:
- N/A
This PR makes the `github_user_id` column on the `users` table required
and replaces the index with a unique index.
I have gone through and ensured that all users have a unique
`github_user_id` in the staging and production databases.
Release Notes:
- N/A
In the current code implementation, it seems that the only difference
between `all_font_names` and `all_font_families` is whether dynamically
loaded font resources are included. Specifically, `all_font_families`
returns the names of all system fonts, while `all_font_names` includes
both the system font names and the dynamically loaded font names. In
other words, `all_font_families` is a strict subset of `all_font_names`.
This is what I observed in my tests on macOS.
<img width="682" alt="截屏2024-07-28 00 49 29"
src="https://github.com/user-attachments/assets/47317c28-0074-49d2-bcfa-052cab13e335">
Related codes:
```rust
let x: HashSet<_> = self.all_font_names().into_iter().collect();
let y: HashSet<_> = self.all_font_families().into_iter().collect();
let only_in_x = x.difference(&y).collect::<Vec<_>>();
let only_in_y = y.difference(&x).collect::<Vec<_>>();
println!("=====================================");
println!("1 -> {:?}", only_in_x);
println!("-------------------------------------");
println!("2 -> {:?}", only_in_y);
```
Release Notes:
- N/A
Closes#14415
(also removed an unused serial while I was at it)
Release Notes:
- Linux: Fixed cross-window copy/paste not working in some Wayland
configurations.
Release Notes:
- Added tab/pane closing for files inside a folder being deleted/trashed
Behavior prior:
[Screencast from 2024-07-25
16-26-47.webm](https://github.com/user-attachments/assets/b090f582-bd7e-411d-91b9-d6709aca7295)
New behavior:
[Screencast from 2024-07-25
16-27-53.webm](https://github.com/user-attachments/assets/b35d4c3a-b0ab-4bd3-bcee-e8b6ad1419c3)
This is primarily a proof of concept PR as I'm sure there are more
elegant ways of achieving this. It's been bothering me for a little
while manually closing file tabs in a folder I deleted, and since this
is standard behavior on almost all IDEs and text editors I figured it
would be a nice small little challenge. If there are any changes y'all
want made I'd be happy to.
`pwsh` is the newer version of `PowerShell`, while the one that comes
pre-installed on Windows is called `Windows PowerShell` and is an older
version. I have no idea why Microsoft dose this and not updated the
`Windows Powershell` on Windows.
Release Notes:
- N/A
I have my system temp dir on a different drive than the default, so this
error was spammed in the logs. This also broke Zed in many ways, one of
which was the AI system failing to work since it couldn't save settings.
```
2024-08-20T22:39:54.0660708-07:00 [ERROR] Failed to write settings to file "\\\\?\\C:\\Users\\myuser\\AppData\\Roaming\\Zed\\settings.json"
Caused by:
0: failed to persist temporary file: The system cannot move the file to a different disk drive. (os error 17)
1: The system cannot move the file to a different disk drive. (os error 17)
```
Note: This problem is probably present on MacOS due to the requirement
of the underlying api being used. I do not have Mac, so I cannot test
this. This PR only solves this issue on Windows.
Closes#16571
Release Notes:
- fix atomic_write failing on windows if destination is on a different
drive than the OS's temp dir.
Closes#14700#8164
Release Notes:
- Added `soft_wrap` value `bounded`,EditorWidth and PreferredLineLength
min value
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This PR makes it so the model's cache configuration gets passed through
from the base model when using the Zed provider.
Release Notes:
- Fixed caching for Anthropic models when using the Zed provider.
This adds an option to set the split direction for both the horizontal
splits, and the vertical splits.
A couple of things to look for when reviewing:
* The `derive` keywords on the Enums were copy pasted, no clue what they
should be
* Tried adding tests for this, but got stuck.
Co-authored with @Tobbe
Fixes: https://github.com/zed-industries/zed/issues/11342
Allows language server logs to be published prior to the completion of
the initialize request. OmniSharp is one example of an LSP that
publishes (many) messages prior to the initialization response, and this
completely floods the Zed logs.
Also adds level filtering as demonstrated below. Again, this is due to
my experience with the massive amount of log messages that OmniSharp
publishes.
Release Notes:
- Added level filtering to language server logs
![Log Level
Filtering](https://github.com/user-attachments/assets/e3fcb7af-28cb-4787-9068-8e5e7eb3cf7d)
---------
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Partially addresses #8497 (namely, the occurring with `delta`)
As I mentioned in
https://github.com/zed-industries/zed/issues/8497#issuecomment-2226896371,
zed currently replies to OSC color requests (`OSC 10`, `OSC 11`, ...)
out of order when immediately followed by another request (for example
`CSI c`). All other terminals that [I have
tested](https://github.com/bash/terminal-colorsaurus/blob/main/doc/terminal-survey.md)
maintain relative order when replying to requests.
## Solution
Respond to the `ColorRequest` in `process_event` (in the same place
where other PTY writes happen) instead of queuing it up in the internal
event queue.
## Alternative
I initially thought that I could handle the color request similarly to
the `TextAreaSizeRequest` where the size is stored in `last_content` and
updated on `sync`. However this causes the terminal to report
out-of-date values when a "set color" sequence is followed by a color
request.
## Tests
1. `OSC 11; ?` (request bg color) + `CSI c` (request device attributes):
```shell
printf '\e]11;?\e\\ \e[c' && cat -v
# Expected result: ^[]11;rgb:dcdc/dcdc/dddd^[\^[[?6c
# Current result: ^[[?6c^[]11;rgb:dcdc/dcdc/dddd^[\ (❌)
# Result with this PR: ^[]11;rgb:dcdc/dcdc/dddd^[\^[[?6c (✅)
# Result with alternative: ^[]11;rgb:dcdc/dcdc/dddd^[\^[[?6c (✅)
```
2. `OSC 11; rgb:f0f0/f0f0/f0f0` (set bg color) + `OSC 11; ?` (request bg
color)
```shell
printf '\e]11;rgb:f0f0/f0f0/f0f0\e\\ \e]11;?\e\\' && cat -v
# Expected result: ^[]11;rgb:f0f0/f0f0/f0f0^[\
# Current result: ^[]11;rgb:f0f0/f0f0/f0f0^[\ (✅)
# Result with this PR: ^[]11;rgb:f0f0/f0f0/f0f0^[\ (✅)
# Result with alternative: ^[]11;rgb:OUT_OF_DATE_COLOR_HERE^[\ (❌)
```
Release Notes:
- N/A
Closes#16555
Release Notes:
- Improved the "Copy Path" and "Copy Relative Path" actions in the
project panel's context menu when selecting multiple files. All selected
files' paths will now be copied, separated by newlines.
Release Notes:
- vim: Added `gf` command to open files under the cursor.
- Filenames can now be `cmd`/`ctrl`-clicked, which opens them.
TODOs:
- [x] `main_test.go` <-- works
- [x] `./my-pkg/my_pkg.go` <-- works
- [x] `../go.mod` <-- works
- [x] `my-pkg/my_pkg.go` <-- works
- [x] `my-pkg/subpkg/subpkg_test.go` <-- works
- [x] `file\ with\ space\ in\ it.txt` <-- works
- [x] `"file\ with\ space\ in\ it.txt"` <-- works
- [x] `"main_test.go"` <-- works
- [x] `/Users/thorstenball/.vimrc` <-- works, but only locally
- [x] `~/.vimrc` <--works, but only locally
- [x] Get it working over collab
- [x] Get hover links working
Demo:
https://github.com/user-attachments/assets/26af7f3b-c392-4aaf-849a-95d6c3b00067
Collab demo:
https://github.com/user-attachments/assets/272598bd-0e82-4556-8f9c-ba53d3a95682
- Add references to locations in code for Metrics and Panic telemetry
- Remove outdated documentation (ClickhouseEvent,
ClickhouseEventWrapper, ClickhouseEventRequestBody)
- Migrate struct documentation from web docs to inline doc comments on
struct members.
This PR adds additional reporting of the active user counts as separate
logs.
We were already reporting these on individual rate limit events/logs,
but it seems like something that would be good to report on independent
of user activity.
Release Notes:
- N/A
This PR fixes an issue where the active user count spanned individual
models.
We now track the active user counts on a per-model basis.
Release Notes:
- N/A
Release Notes:
- Added switch source/header action for clangd language server (fixes
[#12801](https://github.com/zed-industries/zed/issues/12801)).
Note: I'm new to both rust and this codebase. I started my
implementation by copying how rust analyzer's "expand macro" LSP
extension is implemented. I don't yet understand some of the code I
copied (mostly the way to get the `server_to_query` in `clangd_ext.rs`
and the whole proto implementation).
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
This PR adds traces for when users hit LLM rate limits.
We were already emitting telemetry events for these to Clickhouse, but
it will be handy to have them available in Axiom as well.
Release Notes:
- N/A
- Implement restart kernel functionality
- Clean up shutdown process to properly drop messaging and exit status
tasks
- Refactor kernel state handling for better consistency
Closes#16037
Release Notes:
- repl: Added restart kernel action
- repl: Fixed issue with shutting down kernels that are in a failure
state
### Pull Request Title
Introduce `max_output_tokens` Field for OpenAI Models
https://platform.deepseek.com/api-docs/news/news0725/#4-8k-max_tokens-betarelease-longer-possibilities
### Description
This commit introduces a new field `max_output_tokens` to the OpenAI
models, which allows specifying the maximum number of tokens that can be
generated in the output. This field is now integrated into the request
handling across multiple crates, ensuring that the output token limit is
respected during language model completions.
Changes include:
- Adding `max_output_tokens` to the `Custom` variant of the
`open_ai::Model` enum.
- Updating the `into_open_ai` method in `LanguageModelRequest` to accept
and use `max_output_tokens`.
- Modifying the `OpenAiLanguageModel` and `CloudLanguageModel`
implementations to pass `max_output_tokens` when converting requests.
- Ensuring that the `max_output_tokens` field is correctly serialized
and deserialized in relevant structures.
This enhancement provides more control over the output length of OpenAI
model responses, improving the flexibility and accuracy of language
model interactions.
### Changes
- Added `max_output_tokens` to the `Custom` variant of the
`open_ai::Model` enum.
- Updated the `into_open_ai` method in `LanguageModelRequest` to accept
and use `max_output_tokens`.
- Modified the `OpenAiLanguageModel` and `CloudLanguageModel`
implementations to pass `max_output_tokens` when converting requests.
- Ensured that the `max_output_tokens` field is correctly serialized and
deserialized in relevant structures.
### Related Issue
https://github.com/zed-industries/zed/pull/16358
### Screenshots / Media
N/A
### Checklist
- [x] Code compiles correctly.
- [x] All tests pass.
- [ ] Documentation has been updated accordingly.
- [ ] Additional tests have been added to cover new functionality.
- [ ] Relevant documentation has been updated or added.
### Release Notes
- Added `max_output_tokens` field to OpenAI models for controlling
output token length.
Closes#13579
A major painpoint in the Vim crate has been life-cycle management. We
used to have one global Vim instance that tried to track per-editor
state; this led to a number of subtle issues (e.g. #13579, the mode
indicator being global, and quick toggling between windows letting vim
mode's notion of the active editor get out of sync).
This PR changes the internal structure of the code so that there is now
one `Vim` instance per `Editor` (stored as an `Addon`); and the global
stuff is separated out. This fixes the above problems, and tidies up a
bunch of the mess in the codebase.
Release Notes:
* vim: Fixed accidental visual mode in project search and go to
references
([#13579](https://github.com/zed-industries/zed/issues/13579)).