This PR wires up support for [Azure
OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview)
as an alternative AI provider in the assistant panel.
This can be configured using the following in the settings file:
```json
{
"assistant": {
"provider": {
"type": "azure_openai",
"api_url": "https://{your-resource-name}.openai.azure.com",
"deployment_id": "gpt-4",
"api_version": "2023-05-15"
}
},
}
```
You will need to deploy a model within Azure and update the settings
accordingly.
Release Notes:
- N/A
This practice makes it difficult to locate todo!s in my code when I'm
working. Let's take out the bang if we want to keep doing this.
Release Notes:
- N/A
This PR stubs out support for [Azure
OpenAI](https://learn.microsoft.com/en-us/azure/ai-services/openai/overview)
within the `OpenAiCompletionProvider`.
It still requires some additional wiring so that it is accessible, but
the necessary hooks should be in place now.
Release Notes:
- N/A
Fixes: #8050
For some reason that we didn't investigate, if you have view caching
enabled,
and you have non-integer sized bounds, and you are right aligning
things, the
co-ordinates can differ by +/- 1px when using the cached view.
The easiest fix for now is to just not do that.
Co-Authored-By: Antonio <as-cii@zed.dev>
Release Notes:
- Fixed the pane icons flickering
([#8050](https://github.com/zed-industries/zed/issues/8050)).
Co-authored-by: Antonio <as-cii@zed.dev>
Updates #5110
Release Notes:
- Added support for repositories hosted on `git.sr.ht` (Sourcehut) and
`codeberg.org` to the `editor: copy permalink to line` and `editor: open
permalink to line` actions
([#5110](https://github.com/zed-industries/zed/issues/5110)).
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
This PR restores the original signature of `build_permalink`, which
intentionally uses a params struct to avoid mixing up the various `&str`
params that could otherwise be accidentally provided in the wrong order
without being caught by the compiler.
Release Notes:
- N/A
This adds support for Bitbucket.org/Bitbucket Cloud repositories to the
`editor: copy permalink to line` and `editor: open permalink to line`
actions.
Fixes#5110.
Release Notes:
- Added support for repositories hosted on Bitbucket.org (Bitbucket
Cloud) to the `editor: copy permalink to line` and `editor: open
permalink to line` actions.
([#5110](https://github.com/zed-industries/zed/issues/5110)).
I would like to keep diagnostics open on one side, and process them on
the other.
Release Notes:
- Added `editor::OpenExcerptsSplit` (bound to `cmd-k enter`) to open the
selected excerpts in the adjacent pane
- vim: Added `ctrl-w d`, `ctrl-w shift-d` and `ctrl-w space` for
`editor::GoTo{,Type}Definition` and `editor::OpenExcerptsSplit`
This reverts commit 0cebf68306.
Although this thing is very cool, it is a top source of crashes.
Example crash:
```
Segmentation fault: 11 on thread 26
objc_retain +16
invocation function for block in Overlay::onCommandBufferCommit(id<MTLCommandBuffer>) +60
MTLDispatchListApply +52
```
Release Notes:
- Removed "Toggle Graphics Profiler" as it crashes too much.
This PR unifies the event loop code for Wayland and X11. On Wayland,
blocking dispatch is now used. On X11, the invisible window is no longer
needed.
Release Notes:
- N/A
---------
Co-authored-by: Dzmitry Malyshau <kvark@fastmail.com>
Co-authored-by: Tadeo Kondrak <me@tadeo.ca>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: julia <julia@zed.dev>
We couldn't reproduce the panic, but I believe it was possible when
uninstalling an extension while one if its grammars was still loading.
Release Notes:
- Fixed a crash that could happen when uninstalling a language extension
while its grammar was loading.
---------
Co-authored-by: Conrad <conrad@zed.dev>
Follow-up to and fix for #8537.
Turns out that if you set `rules: []` it doesn't mean "no matchers", but
it means "no rules". So let's not set a default here.
Release Notes:
- N/A, see #8537
Co-authored-by: Conrad <conrad@zed.dev>
Fixes#7519
Optimizes file finder subscriptions — it now only subscribes to
worktrees updates instead of all project updates.
Project panel could also be optimized this way, I guess.
Release Notes:
- Fix selection resets in the file finder during language server
startup ([7519](https://github.com/zed-industries/zed/issues/7519))
This uses bounds checking alone to determine hover state to avoid
flicker. It's a short-term solution because the rendering is incorrect.
We think this is better than flickering though and buys us some time as
we work on a more robust solution overall.
Release Notes:
- Fixed flickering when hovering.
---------
Co-authored-by: Nathan <nathan@zed.dev>
This fixes#8533 by allowing users to specify the settings that are
passed to ESLint on workspace initialization.
Example Zed `settings.json` to enable `fixAll` for eslint when
saving/formatting, but only for the `import/order` rule:
```json
{
"languages": {
"JavaScript": {
"code_actions_on_format": {
"source.fixAll.eslint": true
}
}
},
"lsp": {
"eslint": {
"settings": {
"codeActionOnSave": {
"rules": ["import/order"]
}
}
},
}
}
```
The possible settings are described in the README of `vscode-eslint`
here:
https://github.com/Microsoft/vscode-eslint?tab=readme-ov-file#settings-options
- `eslint.codeActionsOnSave.enable` (default: `true`, config key in Zed:
`lsp.eslint.settings.codeActionOnSave.enable`)
- `eslint.codeActionsOnSave.mode` (default: not set by Zed, config key
in Zed: `lsp.eslint.settings.codeActionOnSave.mode`)
- `eslint.codeActionsOnSave.rules` (default: `[]`, config key in Zed:
`lsp.eslint.settings.codeActionOnSave.rules`)
Yes, in the readme it's plural: `codeActionsOnSave`, but since
`eslint-vscode` we're using this old release:
https://github.com/microsoft/vscode-eslint/releases/tag/release%2F2.2.20-Insider
We use the singular version:
https://github.com/microsoft/vscode-eslint/blob/release/2.2.20-Insider/server/src/eslintServer.ts#L461
Our schema looks like this:
```json
{
"lsp": {
"eslint": {
"settings": {
"codeActionOnSave": {
"enable": true,
"rules": ["import/order"],
"mode": "all"
}
}
},
}
}
```
We should probably fix this and upgrade to the newest version of ESLint.
Release Notes:
- Added ability for users to configure settings for ESLint's
`codeActionOnSave`, e.g. specifying `rules` that should be respected
when also using `"code_actions_on_format": {"source.fixAll.eslint":
true}`. These settings can be passed to ESLint as part of the `"lsp"`
part of the Zed settings. Example: `{"lsp": {"eslint": {"settings":
{"codeActionOnSave": { "rules": ["import/order"] }}}}}`
([#8533](https://github.com/zed-industries/zed/issues/8533)).
Demo:
https://github.com/zed-industries/zed/assets/1185253/5c0cf900-9acb-4a70-b89d-49b6eeb6f0e4
This PR does two things to fix
https://github.com/zed-industries/zed/issues/4325:
1. It changes the way `code_actions_on_format` works to send the
possibly configured code actions to _all_ (and not just the primary)
languages servers. That means configured code actions can now be sent to
ESLint, tailwind, ... and other language servers.
2. It enables `codeActionsOnSave` by default for ESLint. That does
**not** mean that by default we will run something on save, but only
that we enable it for ESLint.
Users can then configure their Zed to run the `eslint` code action on
format. Example, for JavaScript:
```json
{
"languages": {
"JavaScript": {
"code_actions_on_format": {
"source.fixAll.eslint": true
}
},
}
}
```
Release Notes:
- Added ability to run ESLint fixes when formatting a buffer. Code
actions configured in
[`code_actions_on_format`](https://zed.dev/docs/configuring-zed#code-actions-on-format)
are now being sent to _all_ language servers connected to a buffer, not
just the primary one. So if a user now sets `"code_actions_on_format": {
"source.fixAll.eslint": true }` in their Zed settings, the
`source.fixAll.eslint` code action will be sent to ESLint, which is not
a primary language server. Since the formatter (prettier, or external
commands, or another language server, ...) still runs, it's important
that these code actions and the formatter don't clash.
([#4325](https://github.com/zed-industries/zed/issues/4325)).
Demo:
https://github.com/zed-industries/zed/assets/1185253/9ef03ad5-1f5c-4d46-b72a-eef611e32f39
Came across this code, saw lots of blue squiggly lines, saw a chance to
simplify the code a little bit and reduce indentation.
(Kinda ironic that I'm the one formatting the prettier code, right?)
Release Notes:
- N/A
This PR fix the "invalid cross-device link" error occurred in linux when
trying to write the settings file atomically, like when click the
"Enable vim mode" checkbox at first start.
```plain
[2024-02-26T22:59:25+08:00 ERROR util] .../zed/crates/settings/src/settings_file.rs:135: Failed to write settings to file "/home/$USER/.config/zed/settings.json"
Caused by:
0: failed to persist temporary file: Invalid cross-device link (os error 18)
1: Invalid cross-device link (os error 18)
```
Currently the `fs::RealFs::atomic_write()` method write to a temp file
created with `NamedTempFile::new()` and then call `persist()` method to
write to the config file path, which actually do a `rename` syscall
under the hood. As the
[issue](https://github.com/Stebalien/tempfile/issues/245) said
> `NamedTempFile::new()` will create a temporary file in your system's
temporary file directory. You need `NamedTempFile::new_in()`.
The temporary file directory in linux is in `/tmp`, which is mounted to
`tmpfs` filesystem, and in most case(all case I guess)
`$HOME/.config/zed` is mounted to a different filesystem. And the
`rename` syscall between different filesystems will return a `EXDEV`
errno, as described in the man page
[rename(2)](https://man7.org/linux/man-pages/man2/renameat2.2.html):
```plain
EXDEV oldpath and newpath are not on the same mounted
filesystem. (Linux permits a filesystem to be mounted at
multiple points, but rename() does not work across
different mount points, even if the same filesystem is
mounted on both.)
```
And as the issue above said, use a different temp dir with
`NamedTempFile::new_in()` for linux platform might be a solution, since
the `rename` syscall provides atomicity.
Release Notes:
- Fix `settings.json` save failed with invalid cross-device link error
in linux
I'm not sure how compliant you're aiming to be with vim, but the `f`
behavior is more useful when it can search on multiple lines instead of
a single one, so I'd like to propose this change.
This change is quite frequent in vim/neovim as a plugin (e.g.
[clever-f](https://github.com/VSCodeVim/Vim),
[improved-ft](https://github.com/backdround/improved-ft.nvim), etc), and
in other vim emulations (e.g.
[vscode-vim](https://github.com/VSCodeVim/Vim)).
Previously, if you had the following files/folders in your project
1-abc
10
11-def
...
2
21-abc
that's how we'd display them.
With this change, we now try to parse them as numbers, if possible, and
use that to sort. If we can't parse a component as a number, we fall
back to normal string comparison.
End result is this:
1-abc
2
10
11-def
...
21-abc
Release Notes:
- Fixed filenames with numeric components (`1.txt`, `1/one.txt`, ...)
not being sorted as numbers, but as string.
Before:
![screenshot-2024-02-27-18 29
43@2x](https://github.com/zed-industries/zed/assets/1185253/2d223126-329f-4ae7-9a12-d33e2c3fe52f)
After:
![after](https://github.com/zed-industries/zed/assets/1185253/f4f98fa0-e66f-40aa-aa28-189143cbb75f)
---------
Co-authored-by: Marshall <marshall@zed.dev>
This fixes#7314 and #7778.
The problem was copying a folder into itself, which is actually quite a
common operation in macOS's `Finder.app`: you select a folder, hit
`cmd-c` and `cmd-v` and have a copy. That's also how it works in VS
Code.
The fix here is to detect when we're copying a folder into itself and
treating it like we're copying a file into itself: we don't want to copy
into the target, we want to copy into the folder one level higher up,
which will then automatically add a ` copy` to the end of the name.
Release Notes:
- Fixed ability to copy folders into themselves by selecting them in
project panel and hitting `copy` and `paste`. Instead of endless
recursion, a copy of the folder is now created.
([#7314](https://github.com/zed-industries/zed/issues/7314)).
Demo:
https://github.com/zed-industries/zed/assets/1185253/2141310a-991d-491d-8498-eb766275a1f5
Reverts zed-industries/zed#7674
@ABckh: reverting this as it introduced a significant performance
slowdown, most likely caused by iterating through all the snapshot
entries to determine whether a directory is foldable/unfoldable/omitted.
It would be great if you could open a new PR that reverts this revert
and addresses the performance issues. Thank you!
/cc: @maxbrunsfeld
Release notes:
- N/A
I think this makes it less chaotic to edit text when the inlay hints are
on.
It's for cases where you're editing to the right side of an inlay hint.
Example:
```rust
for name in names.iter().map(|item| item.len()) {
println!("{:?}", name);
}
```
We display a `usize` inlay hint right next to `name`.
But as soon as you remove that `.` in `names.iter` your cursor jumps
around because the inlay hint has been removed.
With this change we now have a 700ms debounce before we update the inlay
hints.
VS Code seems to have an even longer debounce, I think somewhere around
~1s.
Release Notes:
- Added debouncing to make it easier to edit text when inlay hints are
enabled and to save rendering of inlay hints when scrolling. Both
debounce durations can be configured with `{"inlay_hints":
{"edit_debounce_ms": 700}}` (default) and `{"inlay_hints":
{"scroll_debounce_ms": 50}}`. Set a value to `0` to turn off the
debouncing.
### Before
https://github.com/zed-industries/zed/assets/1185253/3afbe548-dcfb-45a3-ab9f-cce14c04a148
### After
https://github.com/zed-industries/zed/assets/1185253/7ea90e42-bca6-4f6c-995e-83324669ab43
---------
Co-authored-by: Kirill <kirill@zed.dev>
a simple code for html tag support, I've only done the basics, and if
it's okay, I'll optimize and organize the code, and adapt other parts
like `is_multiline`, `always_expands_both_ways`, `target_visual_mode`,
etc
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Release Notes:
- Added
[`:tabo[nly][!]`](https://neovim.io/doc/user/tabpage.html#%3Atabonly),
closes all the tabs except the active one but in the current pane only,
every other split pane remains unaffected.
The version with the `!` force closes the tabs while the one without
asks you to save or discard the changes.
- Added [`:on[ly][!]`](https://neovim.io/doc/user/windows.html#%3Aonly),
closes all the tabs *and* panes except the active one.
The version with the `!` force closes the tabs while the one without
asks you to save or discard the changes.
Since Zed does not have different splits per tab like in Neovim `:only`
works the same as it does in VscodeVim.
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Add plumbing for hosted projects. This will currently show them if they
exist
but provides no UX to create/rename/delete them.
Also changed the `ChannelId` type to not auto-cast to u64; this avoids
type
confusion if you have multiple id types.
Release Notes:
- N/A
/cc @maxbrunsfeld , I didn't remove the field outright since I'm not
sure if the intent is to use it eventually in extensions work.
This is the warning we're getting on 1.77 (release date: 03.21.2024) :
```
warning: field `0` is never read
--> crates/language/src/language_registry.rs:81:12
|
81 | Loaded(PathBuf, tree_sitter::Language),
| ------ ^^^^^^^
| |
| field in this variant
|
= note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
81 | Loaded((), tree_sitter::Language),
| ~~
warning: field `0` is never read
--> crates/language/src/language_registry.rs:82:13
|
82 | Loading(PathBuf, Vec<oneshot::Sender<Result<tree_sitter::Language>>>),
| ------- ^^^^^^^
| |
| field in this variant
|
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
|
82 | Loading((), Vec<oneshot::Sender<Result<tree_sitter::Language>>>),
| ~~
```
Release Notes:
- N/A
Added support of auto collapsed directories, for example when directory
has only one directory inside we should display it as dir1/dir2 (#6935
). Please feel free to propose better solutions, as I am new in Rust
Demo:
https://streamable.com/seo3n9
Release Notes:
- Added support for auto-collapsing directories.
Before this change duplicate channels were ordered arbitrarily, which
put the
collab channel in an inconsistent state.
Release Notes:
- Fixed duplicate channel names appearing in the collab sidebar.
This PR introduces a new `command_palette_hooks` crate that contains the
types used to hook into the behavior of the command palette.
The `CommandPaletteFilter` was previously extracted to the `copilot`
crate in #7095, solely because that was the earliest ancestor of the
crates that depended on it.
The `CommandPaletteInterceptor` was still defined in `command_palette`
itself.
Both of these types were consumed by other crates wanting to influence
the behavior of the command palette, but required taking a dependency on
the entire `command_palette` crate in order to gain access to these
hooks.
By moving them out into their own crate, we can improve the compile
order and make crates like `vim` able to begin building sooner without
having to wait for `command_palette` to finish compiling.
Here's a comparison of the compilation graph before and after (ignore
the timings):
#### Before
<img width="332" alt="Screenshot 2024-02-25 at 12 42 29 PM"
src="https://github.com/zed-industries/zed/assets/1486634/a57c662e-fbc2-41ab-9e30-cca17afa6c73">
#### After
<img width="362" alt="Screenshot 2024-02-25 at 12 51 15 PM"
src="https://github.com/zed-industries/zed/assets/1486634/c1a6d29c-b607-4604-8f1b-e5d318bf8849">
Release Notes:
- N/A
If the list is large (size > overdraw + available height) the
`all_rendered` check was preventing the list from returning an inferred
size. Theoretically we can now report heights which are actually too
small (because not all items were affected during layout), this can be
manually adjusted using the overdraw parameter. In this case its fine
because the picker is inside a max_height which should never be more
then the overdraw we specify (1000 px), and the list will shrink down
either way when the request_measured_layout callback is called again.
Release Notes:
- Fixed flashing of recent projects list when there were a lot of
projects in the list
([#8364](https://github.com/zed-industries/zed/issues/8364#issuecomment-1962849393)).
Partially resolves: https://github.com/zed-industries/zed/issues/7785
Right now, we can engage `Only show installed`, but I've been wanting to
be able to filter down to just uninstalled extensions too, so I can
browse things I don't have. I changed this to have 2 checkboxes,
`Installed` and `Not installed` and both are on by default. You deselect
them to filter down.
<img width="1608" alt="SCR-20240225-etyg"
src="https://github.com/zed-industries/zed/assets/19867440/e2267651-ff86-437b-ba59-89f3d338ea02">
Release Notes:
- Allow extensions list to be filtered down to both installed and not
installed.
Following-up on #8330
Invocation
```bash
cargo-machete --with-metadata --skip-target-dir --fix
````
There is more stuff to fix, but it chokes on `async-lock`:
```
cargo-machete found the following unused dependencies in /x/Code/zed:
rpc -- /x/Code/zed/crates/rpc/Cargo.toml:
async_lock
prost_build
serde_derive
Error: Dependency async_lock not found
```
Release Notes:
- N/A
Turns out auto-closing words was a bad idea. win**do**w, **struct**ure,
**sig**n and so on
They don't serve any purpose in `config.toml` nor `brackets.scm` at this
point, so I removed them>
Release Notes:
- N/A
This PR removes the unused crates for plugin support.
We're currently exploring Wasm-based extensions, and it's unlikely that
we'll be reusing any of this existing work.
Release Notes:
- N/A
This PR renames the `ZedHttpClient` to `HttpClientWithUrl` to make it
slightly clearer that it still is holding a `dyn HttpClient` as opposed
to being a concrete implementation.
Release Notes:
- N/A
This PR makes the labels of the buttons in the extension list adapt to
reflect the current status.
Release Notes:
- Changed the button labels in the extension list to reflect the current
status.
This PR adds a new `argument` vim text object, inspired by
[targets.vim](https://github.com/wellle/targets.vim).
As it's the first vim text object to use the syntax tree, it needed to
operate on the `Buffer` level, not the `MultiBuffer` level, then map the
buffer coordinates to `DisplayPoint` as necessary.
This required two main changes:
1. `innermost_enclosing_bracket_ranges` and `enclosing_bracket_ranges`
were moved into `Buffer`. The `MultiBuffer` implementations were updated
to map to/from these.
2. `MultiBuffer::excerpt_containing` was made public, returning a new
`MultiBufferExcerpt` type that contains a reference to the excerpt and
methods for mapping to/from `Buffer` and `MultiBuffer` offsets and
ranges.
Release Notes:
- Added new `argument` vim text object, inspired by
[targets.vim](https://github.com/wellle/targets.vim).
This is a follow up to #7945. The current behaviour reads the locale and
infers from that which type of time format should be used (12 hour/24
hour).
However, in macOS you can override this behaviour, e.g. you can use
en_US locale but still use the 24 hour clock format (Can be customized
under Settings > General > Date & Format > 24-hour time). You can even
customize the date format.
This PR uses the macOS specific `CFDateFormatter` API, which outputs
time format strings, that respect those settings.
Partially fixes#7956 (as its not implemented for linux)
Release Notes:
- Added localization support for all macOS specific date and time
configurations in chat
This PR fixes uploads the `edit_events` table.
We were trying to insert into a column that didn't exist:
```
HTTP error 500 Internal Server Error: failed to upload to table 'edit_events'
Caused by:
bad response: Code: 16. DB::Exception: No such column os_name in table default.edit_events
```
Release Notes:
- N/A
This PR updates the `EventCoalescer` to use the `SystemClock` trait to
abstract over the clock.
This allows us to test the advancement of time without relying on the
caller passing in the current time.
Release Notes:
- N/A
With this change, interaction with Zed is actually real-time and usable
🚀🎉
The gist of it is - trying to process all of the input events before
rendering anything.
Release Notes:
- N/A
**Note**: this can be further improved in a follow-up.
Currently, once the input and runnables are processed, we'd try to draw
+ render a frame.
Presentation starts with acquiring a new frame. We currently have FIFO
presentation method, so acquiring a frame is blocking on that swapchain
image to become available. As the result, presentation takes around 16
ms, most of which is just busy wait.
Ideally, we'd be able to process more input in this time frame, instead.
**Note2**: it's a bit laggy in Debug for me, but that's just because of
the extra-long `draw` times, which is unrelated to rendering (or
platform support, for the matter). I'm curious how come on MacOS the
`draw()` times in Debug are more modest.
This PR makes it so the background task that reconciles the extensions
database with the blob store only runs on the `collab` service.
This avoids us having multiple of these jobs running at once.
Release Notes:
- N/A
Co-Authored-By: Marshall <marshall@zed.dev>
We broke it by deploying two servers simultaneously.
Release Notes:
- N/A
Co-authored-by: Marshall <marshall@zed.dev>
Release Notes:
The issue is that when welcome page appears settings.json file is not
created yet. So the idea of this fix is to create the file in case it is
not there yet.
- Fixed the toggles on the welcome screen not working if no settings
file exists yet.
([#8153](https://github.com/zed-industries/zed/issues/8153)).
---------
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
I think bold is the least fitting font weight for inlay hints, which
should be subtle hints and not, well, bold.
If someone feels strongly about this, I can revert, but only if we add
the ability to change this per theme.
Until then: beautiful, thin, subtle inlay hints!
Release Notes:
- Improved styling of inlay hints by not making them bold in the editor.
![screenshot-2024-02-23-17 30
29@2x](https://github.com/zed-industries/zed/assets/1185253/89c2a162-76bb-45cd-8b45-2a5bdf8ca87b)
I don't think there's value in retrying 4 times as fast as possible,
especially if we might hit the Github API every time to check for the
newest version.
That gets us in rate limit problems quickly.
Release Notes:
- N/A
As we don't have selection inside the chat right now (which might be
complicated to implement, e.g. cross element selection and markdown
blocks), I think its viable to support copying the whole text of a
message using the message menu:
![image](https://github.com/zed-industries/zed/assets/53836821/6092dfed-0297-457e-9455-ba1e6190e288)
Release Notes:
- Added option to copy the text of a message within the chat
- Moves languages module from `zed` into a separate crate. That way we
have less of a long pole at the end of compilation.
- Removes moot dependencies on editor/picker. This is totally harmless
and might help in the future if we decide to decouple picker from
editor.
Before:
```
Number of crates that depend on 'picker' but not on 'editor': 1
Total number of crates that depend on 'picker': 13
Total number of crates that depend on 'editor': 30
```
After:
```
Number of crates that depend on 'picker' but not on 'editor': 5
Total number of crates that depend on 'picker': 12
Total number of crates that depend on 'editor': 26
```
The more crates depend on just picker but not editor, the better in that
case.
Release Notes:
- N/A
After a lot of back-and-forth, this is a small attempt to implement
solutions (1) and (3) in
https://github.com/zed-industries/zed/issues/7902. The goal is to have a
minimal change that helps users get started with Zed, until we have
extensions ready.
Release Notes:
- Added detection of user-installed `gopls` to Go language server
adapter. If a user has `gopls` in `$PATH` when opening a worktree, it
will be used.
- Added detection of user-installed `zls` to Zig language server
adapter. If a user has `zls` in `$PATH` when opening a worktree, it will
be used.
Example:
I don't have `go` installed globally, but I do have `gopls`:
```
~ $ which go
go not found
~ $ which gopls
/Users/thorstenball/code/go/bin/gopls
```
But I do have `go` in a project's directory:
```
~/tmp/go-testing φ which go
/Users/thorstenball/.local/share/mise/installs/go/1.21.5/go/bin/go
~/tmp/go-testing φ which gopls
/Users/thorstenball/code/go/bin/gopls
```
With current Zed when I run `zed ~/tmp/go-testing`, I'd get the dreaded
error:
![screenshot-2024-02-23-11 14
08@2x](https://github.com/zed-industries/zed/assets/1185253/822ea59b-c63e-4102-a50e-75501cc4e0e3)
But with the changes in this PR, it works:
```
[2024-02-23T11:14:42+01:00 INFO language::language_registry] starting language server "gopls", path: "/Users/thorstenball/tmp/go-testing", id: 1
[2024-02-23T11:14:42+01:00 INFO language::language_registry] found user-installed language server for Go. path: "/Users/thorstenball/code/go/bin/gopls", arguments: ["-mode=stdio"]
[2024-02-23T11:14:42+01:00 INFO lsp] starting language server. binary path: "/Users/thorstenball/code/go/bin/gopls", working directory: "/Users/thorstenball/tmp/go-testing", args: ["-mode=stdio"]
```
---------
Co-authored-by: Antonio <antonio@zed.dev>
![image](https://github.com/zed-industries/zed/assets/2690773/7a0927e8-f32a-4502-8a8a-c7f8e5f325bb)
Fixes https://github.com/zed-industries/zed/issues/7419 by changing the
way "recent projects" modal confirm actions work:
* `menu::Confirm` now reuses the current window when opening a recent
project
* `menu::SecondaryConfirm` now opens a recent project in the new window
* neither confirm tries to open the current project anymore
* modal's placeholder is adjusted to emphasize this behavior
Release Notes:
- Added a way to open recent projects in the new window
Fixes https://github.com/zed-industries/zed/issues/7865
* bind default prettier (re)installation decision to
`prettier_server.js` existence
* ensure the `prettier_server.js` file is created last, after all
default prettier packages installed
* ensure that default prettier directory exists before installing the
packages
* reinstall default prettier if the `prettier_server.js` file is
different from what Zed expects
Release Notes:
- Fixed incorrect default prettier installation process
This PR adds a `SystemClock` trait for abstracting away the system
clock.
This allows us to swap out the real system clock with a
`FakeSystemClock` in the tests, thus allowing the fake passage of time.
We're using this in `Telemetry` to better mock the clock for testing
purposes.
Release Notes:
- N/A
[Profiling](https://crates.io/crates/profiling) crate allows easy
integration with various profiler tools. The best thing is - annotations
compile to nothing unless you request a specific feature.
For example, I used this command to enable Tracy support:
```bash
cargo run --features profiling/profile-with-tracy
```
At the same time I had Tracy tool open and waiting for connection. It
gathered nice stats from the run:
![zed-profiler](https://github.com/zed-industries/zed/assets/107301/5233045d-078c-4ad8-8b00-7ae55cf94ebb)
Release Notes:
- N/A
Move away from columns of icons towards the "changed" info dot we used
for files.
Secondary actions for chat/notes still show up (if you're lucky) on
hover.
Co-Authored-By: Marshall <marshall@zed.dev>
Release Notes:
- Improved design of collab panel
---------
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
I really think storybook is a cool standalone app but there are some
usability issues that are getting in the way of making this a fun tool
to use.
Currently it is not easy to gracefully exit out of storybook.
In fact even trying to Ctrl-c out of storybook seems currently broken to
me...
So the only real way to exit out of storybook is to kill the process
after a Ctrl-z.
This PR attempts to make this much easier by adding a simple app_menu
with a menu item called quit along with the ability to *Cmd-q* out of
storybook as well...
Both the menu item quit and *Cmd-q* gracefully exit storybook.
There are still a bunch of issues with storybook which I plan on
addressing in future PR's but this is a start and something that to me
is the highest priority to make storybook more functional and easy to
use moving forward.
One of my longer term goals of storybook is to have it be a nice stand
alone application similar to
[Loungy](https://github.com/MatthiasGrandl/Loungy) which can be used as
a nice tutorial application for how to develop a real world *gpui* app.
For that reason I added a *assets/keymaps/storybook.json* file as well.
Fix an issue where the `ime_key` is sometimes an empty string, and
pressing a keystroke replaces the selected text.
E.g. select some text, press `Escape`: selected text is deleted.
Release Notes:
- vim: Added a setting to control default clipboard behaviour. `{"vim":
{"use_system_clipboard": "never"}}` disables writing to the clipboard.
`"on_yank"` writes to the system clipboard only on yank, and `"always"`
preserves the current behavior. ([#4390
](https://github.com/zed-industries/zed/issues/4390))
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
I ran into this when trying out which keybindings work and accidentally
added empty tasks. They get then added to the task inventory and
displayed in the picker.
Release Notes:
- Fixed empty tasks being added to the list of tasks when using `task:
spawn`
---------
Co-authored-by: Kirill <kirill@zed.dev>
Release Notes:
- Fixed auto-inserted brackets (or quotes) not being removed when they
were inserted as part of a snippet.
([#4605](https://github.com/zed-industries/issues/4605))
---------
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Because the `repository` url field is defined via the user's
`extension.json` file, a user could insert a malicious link. I want to
be able to preview repository urls before clicking the button.
Release Notes:
- Add url preview tooltip to repository link in extensions view.
When no project is selected, the recent project dropdown is displaying
an empty string, making the button basically impossible to click. This
PR adds a placeholder value for that case.
Here is what it looks like now:
![image](https://github.com/zed-industries/zed/assets/53836821/c831a1eb-722e-4189-8f8b-8b3039daf8f8)
Release Notes:
- Added placeholder to titlebar when no project is selected
Before:
```
[2024-02-21T18:55:55+02:00 INFO language::language_registry] starting language server "eslint", path: "/Users/someonetoignore/Downloads/eslint-configs-demo", id: 2
[2024-02-21T18:55:56+02:00 INFO lsp] 2 unhandled notification window/logMessage:
{
"type": 3,
"message": "ESLint server running in node v18.15.0"
}
[2024-02-21T18:55:56+02:00 INFO lsp] 2 unhandled notification eslint/confirmESLintExecution:
{
"scope": "local",
"uri": "file:///Users/someonetoignore/Downloads/eslint-configs-demo/index.js",
"libraryPath": "/Users/someonetoignore/Downloads/eslint-configs-demo/node_modules/eslint/lib/api.js"
}
```
After:
```
[2024-02-21T18:57:31+02:00 INFO language::language_registry] starting language server "eslint", path: "/Users/someonetoignore/Downloads/eslint-configs-demo", id: 2
[2024-02-21T18:57:32+02:00 INFO lsp] Language server with id 2 sent unhandled notification window/logMessage:
{
"type": 3,
"message": "ESLint server running in node v18.15.0"
}
[2024-02-21T18:57:32+02:00 INFO project::prettier_support] Fetching default prettier and plugins: [("prettier-plugin-tailwindcss", "0.5.11"), ("prettier", "3.2.5")]
[2024-02-21T18:57:32+02:00 INFO lsp] Language server with id 2 sent unhandled notification eslint/confirmESLintExecution:
{
"scope": "local",
"uri": "file:///Users/someonetoignore/Downloads/eslint-configs-demo/index.js",
"libraryPath": "/Users/someonetoignore/Downloads/eslint-configs-demo/node_modules/eslint/lib/api.js"
}
```
We have to pass a name there too, but the problem here is that the
unhandled message callback is created very early, along with the binary,
but the server name is received from the LSP initialize response, which
is a totally separate piece of code.
I plan to refactor that code next, but so far, improve the logs at least
slightly.
Release Notes:
- N/A
Fixes#8096
# Bug description
I was experimenting with adding extensions and almost went crazy trying
to make my demo extension work. It appeared that I was copying files
with Finder that creates hidden `.DS_Store` files which interfered with
Zed's loading logic. It assumes that `languages/` directory contains
only directories and never files and so it crashes when meets
`.DS_Store`. This makes any extension stop working after it has been
viewed via Finder
# Change
Check if path is directory when loading extension languages (so it will
skip .DS_Store files)
This changes the format of runnables slightly (the top-level object is
now a sequence, not a map).
The 2nd commit pulls in aliases from .zshrc and co.
Release Notes:
- N/A
In #6954 a user has trouble using copilot. We haven't gotten to the
bottom of the problem, but one problem is that apparently sometimes (I'm
going to find out when) copilot sends an `"OK"` status message without a
username. This is from the user's logs:
2024-02-20T15:28:41-03:00 [ERROR] failed to deserialize response from
language server: missing field `user`. Response from language server:
"{\"status\":\"OK\"}"
The official `copilot.vim` plugin handles this as if the user is not
authenticated (!= authorized):
1a284014d2/autoload/copilot.vim (L574-L579)
So that's what I'm doing here too.
Release Notes:
- Fixed wrong handling of Copilot sign-in status in rare cases.
This should help us debug more failures because we can now see what
exactly was started.
Release Notes:
- N/A
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Max <max@zed.dev>
Release Notes:
- Added `workspace::SendKeystrokes` to enable mapping from one key to a
sequence of others
([#7033](https://github.com/zed-industries/zed/issues/7033)).
Improves #7033. Big thank you to @ConradIrwin who did most of the heavy
lifting on this one.
This PR allows the user to send multiple keystrokes via custom
keybinding. For example, the following keybinding would go down four
lines and then right four characters.
```json
[
{
"context": "Editor && VimControl && !VimWaiting && !menu",
"bindings": {
"g z": [
"workspace::SendKeystrokes",
"j j j j l l l l"
],
}
}
]
```
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Undoubtedly not perfect, but this should be something we can work off
of.
Note that matching keybindings with ctrl in them is currently broken on
linux (or at least x11). This keymap might just manage to be less useful
than using the macos one on linux until that is fixed... the proximate
cause of this is that the `key` field of the `Keystroke` struct looks
like `"\u{e}"` instead of `"n"` when `ctrl-n` is pressed.
Release Notes:
- N/A
With `send_and_check_request` we'd be blocking both the main loop and
the caller. `send_request` is only going to be blocking on the main loop
when processing the request.
Release Notes:
- N/A
Based on a flamegraph from `perf`/`hotspot`, we are spending 40% of time
redrawing, another 40% of time downloading stuff (i.e. rust toolchain),
and the rest on text rendering, layout and such. This is with Vulkan
Validation (see https://github.com/zed-industries/zed/pull/8044).
I'm also wondering if it would be better with #7758, but regardless we
should have no problem rendering at 60-120 fps and processing user
input. More follow-ups are expected here.
This PR bumps the tree-sitter-nu commit to the latest supported by the
nushell team. It also includes the latest highlights.scm
Release Notes:
Bumped `nu` tree sitter dependency and highlights.scm
This small inconsistency was mentioned on the discord. This fixes it.
Release Notes:
- Themes: Renamed `scrollbar_thumb.background` to
`scrollbar.thumb.background` to be consistent with other style
properties.
---------
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
@ConradIrwin here's our current implementation for auto detecting links
in the chat.
We also fixed an edge case where the close reply to preview button was
cut off (rendered off screen).
Release Notes:
- Added auto detection for links in the chat panel.
---------
Co-authored-by: Remco Smits <62463826+RemcoSmitsDev@users.noreply.github.com>
This PR enables server side decorations on Wayland if possible. This is
stopgap solution, so that the window can be moved, resized and dragged
on Wayland sessions at all.
![image](https://github.com/zed-industries/zed/assets/25827180/3dc9af53-76c0-4664-8746-ed6a6e5eafe7)
Since Wayland compositors can decide to force either mode (as in,
forcing server or client side decorations), this requires additional
handling in zed. Since zed doesn't provide any of that handling as of
now, as a temporary solution server side decorations are always
requested.
This is a compilation of fixes for errors that appeared in dependent
crates in Windows.
- wezterm (zed-industries/wezterm#1)
- tree-sitter-svelte (Himujjal/tree-sitter-svelte#54)
- tree-sitter-uiua (shnarazk/tree-sitter-uiua#25)
- tree-sitter-haskell (I sent a PR, but upstream source is regenerated
and no longer errors.)
Release Notes:
- N/A