I vibe coded this in Zed, dawg.
This avoids a number of cases where we created multiple copies of the
same lsp adapter. Now we clone the Arcs.
Release Notes:
- N/A
This PR refactors the constructors for the various Git hosting providers
to facilitate adding support for more self-hosted variants.
Release Notes:
- N/A
Without this, we running into the following error:
```
Running into this when running tests. Is this
dyld[45041]: Library not loaded: @rpath/WebRTC.framework/WebRTC
Referenced from: <B2EA63A5-994E-3FB0-A74B-C9C4F7E5C1EF> /Users/aguz/zed/zed/target/debug/deps/assistant_tools-522d7745dd439dfb
Reason: no LC_RPATH's found
```
Thanks Piotr!
Release Notes:
- N/A
Closes#4640
About the support limit of Fn:
Mac F1-F35
Win F1-F24
Linux F1-F35
Terminal F1-F20
Release Notes:
- Improved support for extended keyboards on Mac (F20-F35)
http-client pulled in rustls which in turn meant that gpui depended on
rustls/aws-lc-sys. This commit extracts http-client-tls crate to
separate the http-client and tls dependencies.
Closes #ISSUE
Release Notes:
- N/A
In `layout_excerpt_gutter`, compute max line number length once instead
of for every row
In `max_line_number_width`, use ilog10 instead of converting to floats
and back
Release Notes:
- N/A
Similar to how tasks are fetched via LSP, also queries for document's
code lens and filters the ones with the commands, supported in server
capabilities.
Whatever's left and applicable to the range given, is added to the
actions menu:

This way, Zed can get more actions to run, albeit neither r-a nor vtsls
seem to provide anything by default.
Currently, there are no plans to render code lens the way as in VSCode,
it's just the extra actions that are show in the menu.
------------------
As part of the attempts to use rust-analyzer LSP data about the
runnables, I've explored a way to get this data via standard LSP.
When particular experimental client capabilities are enabled (similar to
how clangd does this now), r-a starts to send back code lens with the
data needed to run a cargo command:
```
{"jsonrpc":"2.0","id":48,"result":{"range":{"start":{"line":0,"character":0},"end":{"line":98,"character":0}},"command":{"title":"▶︎ Run Tests","command":"rust-analyzer.runSingle","arguments":[{"label":"test-mod tests::ecparser","location":{"targetUri":"file:///Users/someonetoignore/work/ec4rs/src/tests/ecparser.rs","targetRange":{"start":{"line":0,"character":0},"end":{"line":98,"character":0}},"targetSelectionRange":{"start":{"line":0,"character":0},"end":{"line":98,"character":0}}},"kind":"cargo","args":{"environment":{"RUSTC_TOOLCHAIN":"/Users/someonetoignore/.rustup/toolchains/1.85-aarch64-apple-darwin"},"cwd":"/Users/someonetoignore/work/ec4rs","overrideCargo":null,"workspaceRoot":"/Users/someonetoignore/work/ec4rs","cargoArgs":["test","--package","ec4rs","--lib"],"executableArgs":["tests::ecparser","--show-output"]}}]}}}
```
This data is passed as is to VSCode task processor, registered in
60cd01864a/editors/code/src/main.ts (L195)
where it gets eventually executed as a VSCode's task, all handled by the
r-a's extension code.
rust-analyzer does not declare server capabilities for such tasks, and
has no `workspace/executeCommand` handle, and Zed needs an interactive
terminal output during the test runs, so we cannot ask rust-analyzer
more than these descriptions.
Given that Zed needs experimental capabilities set to get these lens:
60cd01864a/editors/code/src/client.ts (L318-L327)
and that the lens may contain other odd tasks (e.g. docs opening or
references lookup), a protocol extension to get runnables looks more
preferred than lens:
https://rust-analyzer.github.io/book/contributing/lsp-extensions.html#runnables
This PR does not include any work on this direction, limiting to the
general code lens support.
As a proof of concept, it's possible to get the lens and even attempt to
run it, to no avail:

Release Notes:
- Used `textDocument/codeLens` data in the actions menu when applicable
Closes https://github.com/zed-industries/zed/issues/13111
Release Notes:
- vim: Added global marks `'[A-Z]`
- vim: Added persistence for global (and local) marks. When re-opening
the same workspace your previous marks will be available.
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
If the user has the `auto_reveal` option enabled, as well as
`file_scan_inclusions` and opens a file that is gitignored but is also
set to be always included, that file won't be revealed in the project
panel. I've personally found this annoying, as the project panel can
provide useful context on where you are in a codebase. It also just
feels weird for it to be out of sync with the editor state.
Release Notes:
- Fixed the interaction between `auto_reveal`, `file_scan_inclusions`,
and `.gitignore` within the Project Panel. Files that are always
included will now be auto-revealed in the Project Panel, even if those
files are also gitignored.
Fixes the selection highlight appearing in single-line editors like the
file picker, command palette, etc.
Release Notes:
- Fixed selection highlight appearing in input fields like the file
picker, command palette, etc.
Closes#14349
When typing quotes immediately after a word character, it resulted in
auto-closing the quote.
```js
const thing = this is text^;
```
Typing a quote resulted in `this is text""^;` which is not correct, and
should be `this is text"^;`.
This PR changes logic for auto close:
1. We now prevent auto-closing in case of brackets where start == end
when they're typed immediately after a word character. i.e. For, ``` `,
", ' ```.
2. Other bracket pairs like `{}, (), etc` continue to auto-close
regardless of preceding character. So, `func^` to `func()^` will keep
working.
3. Auto-closing in other contexts like after spaces, punctuation, etc.
will still work.
Before:

After:

Release Notes:
- Fixed auto-paired quotes being inserted when typing a quote
immediately next to a word character.
This PR fixes a rare case where icons could be missing in the language
selector.
Currently, whilst looking up an icon, all file suffixes starting with a
dot are filtered out. While this works fine for some languages, there
are some languages having only file suffixes starting with a dot, e.g.
the "Git Attributes" language provided from the "Git Firefly" extension.
This results in no icon being displayed in the list, as shown in the
screenshots below.
To solve this, we can just simply remove the check for this special case
as well as the construction of an artificial file name in the code, as
both are not needed. A simple path just consisting of the extension is
sufficient, as we currently do not differentiate between file names and
file suffixes during an icon lookup. see the relevant code below:
013a646799/crates/file_icons/src/file_icons.rs (L23-L52)
As the first lookup is directly done using the entire file name and then
checked against all suffixes, we actually do not have to construct an
artificial file name at all. Should that produce no match, we check for
a hidden file right after, so we do not have to filter hidden file names
out.
With this fix, nothing changes for "normal" file suffixes, for some
cases where languges provide entire file names as a path suffix, the
matching might improve, and for languages with only hidden associated
file names, the initially described issue is resolved.
I do believe the behavior of matching icons to languages could be
improved in general. Fowever, I do think this is beyond the scope of
this change.
| Current main | <img width="546" alt="main"
src="https://github.com/user-attachments/assets/5c3c9fdc-cadf-4e44-9667-2530374aa0d2"
/> |
| --- | --- |
| This PR |<img width="546" alt="PR"
src="https://github.com/user-attachments/assets/82e59108-e31f-4ca9-8bbd-b9fd2b34feb0"
/>|
Aditionally, in 4395f78fb2 I refactored
the code which acquires the label and icon for a match, since I found it
a bit hard to read initially. The majority of this diff comes from this
change. Should that not be wanted, I can revert that change.
Release Notes:
- Fixed a rare case where languages had no associated icon in the
language selector.
When the user attached context in the thread, the editor model request
would fail because its tool use wouldn't be removed properly leading to
an API error.
Also, after an edit, we'd keep the old file snapshot in the context.
This would make the model think that the edits didn't apply and make it
go in a loop.
Release Notes:
- N/A
Very small change, simply changing the order of the futures we pass to
`select_biased!` so that if the format request and the timeout resolve
at the same time (highly unlikely) we choose the format request instead
of choosing the timeout and throwing away our work!
Release Notes:
- N/A
Closes#26777
This PR fixes a panic when a file name contains a newline and a
multi-byte character like 👋 (4 bytes in UTF-8). The issue was in the
regex not considering newlines in file names, causing it to match only
the latter part of the file name.
For example:
```
left: PathWithPosition { path: "ab", row: None, column: None } // matched
right: PathWithPosition { path: "ab\ncd", row: None, column: None } // actual file name
```
This resulted in incorrect index calculation later in the code, which
went unnoticed until now due to the lack of tests with file names
containing newlines.
We discovered this issue when a panic occurred due to incorrect index
calculation while trying to get the index of a multi-byte character.
After the newline fix, the index calculation is always correct, even in
the case of multi-byte characters.
Release Notes:
- Fixed an issue where file names with newlines and multi-byte
characters could cause a crash in certain cases.
This PR introduces the arguments `seed` and `seeds` to `gpui::test`,
e.g.:
- `#[gpui::test(seed = 10)]`
- `#[gpui::test(seeds(10, 20, 30, 40))]`
Which allows us to run a test against a specific seed value without
slowing
down our tests like `iterations` does with high values.
This was motivated by a diff hunk test that only fails in a 400+ seed,
but is
slow to run 400+ times for every `cargo test`.
If your test failed with a specific seed, you can now add the `seed` arg
to
increase the chances of detecting a regression.
There are now three ways of setting seeds, the `SEED` env var,
`iterations`,
and the args this PR adds. See docs in `gpui::test`.
---
I also relaxed the limitation on `retries` not working with
`iterations`, as
that seemed unnecessary.
Release Notes:
- N/A
Follow-up of https://github.com/zed-industries/zed/pull/26410
* Extract word completions into their own, `editor::ShowWordCompletions`
action so those could be triggered independently of completions
* Assign `ctrl-shift-space` binding to this new action
* Still keep words returned along the completions as in the original PR,
but:
* Tone down regular completions' fallback logic, skip words when the
language server responds with empty list of completions, but keep on
adding words if nothing or an error were returned instead
* Adjust the defaults to wait for LSP completions infinitely
* Skip "words" with digits such as `0_usize` or `2.f32` from completion
items, unless a completion query has digits in it
Release Notes:
- N/A
When copilot is not being used as the edit prediction provider and you
open a fresh Zed instance, we don’t run the copilot language server.
This is because copilot chat is purely handled via oauth token and
doesn’t require the language server.
In this case, if you click sign out, instead of asking the language
server to sign out (which isn’t running), we can manually clear the
config directory, which contains the oauth tokens. We already watch this
directory, and if the token is not found, we update the sign-in status.
Release Notes:
- N/A
Take 2 on https://github.com/zed-industries/zed/pull/26600. Now, it
doesn't break remote development.
Instead of using it in `build_classes`, it's now used in the `open`
method while creating a window. I found similar usage in other places
over internet.
Release Notes:
- Fixed issue where Zed would show mac native tabs when opening new
fullscreen windows on macOS.
Closes#25883
This PR allows you to use copilot chat for assistant without setting
copilot as the edit prediction provider.
[copilot.webm](https://github.com/user-attachments/assets/fecfbde1-d72c-4c0c-b080-a07671fb846e)
Todos:
- [x] Remove redudant "copilot" key from settings
- [x] Do not disable copilot LSP when `edit_prediction_provider` is not
set to `copilot`
- [x] Start copilot LSP when:
- [x] `edit_prediction_provider` is set to `copilot`
- [x] Copilot sign in clicked from assistant settings
- [x] Handle flicker for frame after starting LSP, but before signing in
caused due to signed out status
- [x] Fixed this by adding intermediate state for awaiting signing in in
sign out enum
- [x] Handle cancel button should sign out from `copilot` (existing bug)
- [x] Handle modal dismissal should sign out if not in signed in state
(existing bug)
Release Notes:
- You can now sign into Copilot from assistant settings without making
it your edit prediction provider. This is useful if you want to use
Copilot chat while keeping a different provider, like Zed, for
predictions.
- Removed the `copilot` key from `features` in settings. Use
`edit_prediction_provider` instead.