bda5713
zed 0.130.5
Joseph T. Lyons created
bda5713
zed 0.130.5
Joseph T. Lyons created
778e1ad
Fix panic when loading malformed Wasm files (cherry-pick #10370) (#10372)
Cherry-picked Fix panic when loading malformed Wasm files (#10370)
This PR fixes a potential panic that could occur when loading malformed
Wasm files.
We now use the `parse_wasm_extension_version` function that was
previously used just to extract the Zed extension API version from the
Wasm bytes as a pre-validation step. By parsing the entirety of the Wasm
file here instead of returning as soon as we find the version, the
invalid Wasm bytes are now surfaced as an `Err` instead of a panic.
We were able to replicate the panic using the following test:
```rs
#[gpui::test]
async fn test_bad_wasm(cx: &mut TestAppContext) {
init_test(cx);
let wasm_host = cx.update(|cx| {
WasmHost::new(
FakeFs::new(cx.background_executor().clone()),
FakeHttpClient::with_200_response(),
FakeNodeRuntime::new(),
Arc::new(LanguageRegistry::test(cx.background_executor().clone())),
PathBuf::from("/the/work/dir".to_string()),
cx,
)
});
let mut wasm_bytes = std::fs::read("/Users/maxdeviant/Library/Application Support/Zed/extensions/installed/dart/extension.wasm").unwrap();
// This is the error message we were seeing in the stack trace:
// range end index 267037 out of range for slice of length 253952
dbg!(&wasm_bytes.len());
// Truncate the bytes to the same point:
wasm_bytes.truncate(253952);
std::fs::write("/tmp/bad-extension.wasm", wasm_bytes.clone()).unwrap();
let manifest = Arc::new(ExtensionManifest {
id: "the-extension".into(),
name: "The Extension".into(),
version: "0.0.1".into(),
schema_version: SchemaVersion(1),
description: Default::default(),
repository: Default::default(),
authors: Default::default(),
lib: LibManifestEntry {
kind: None,
version: None,
},
themes: Default::default(),
languages: Default::default(),
grammars: Default::default(),
language_servers: Default::default(),
});
// π₯
let result = wasm_host
.load_extension(wasm_bytes, manifest, cx.executor())
.await;
dbg!(result.map(|_| ()));
```
Release Notes:
- Fixed a crash that could occur when loading malformed Wasm extensions
([#10352](https://github.com/zed-industries/zed/issues/10352)).
---------
Co-authored-by: Max <max@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Max <max@zed.dev>
gcp-cherry-pick-bot[bot] , Marshall Bowers , and Max created
044b04a
v0.130.x stable
Joseph T. Lyons created
b038248
zed 0.130.4
Marshall Bowers created
fbfbc68
Use first line comment prefix when toggling comments (cherry-pick #10335) (#10339)
Cherry-picked Use first line comment prefix when toggling comments (#10335) This fixed an issue introduced in https://github.com/zed-industries/zed/pull/10126, where, when toggling comments in a language with multiple line comment prefixes (e.g. Gleam, Erlang) Zed would insert the *last* prefix instead of the first. Release Notes: - Fixed an issue where the `toggle comments` command inserted the wrong line comment prefix in some languages (preview only). Co-authored-by: Marshall <marshall@zed.dev> Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com> Co-authored-by: Marshall <marshall@zed.dev>
gcp-cherry-pick-bot[bot] , Max Brunsfeld , and Marshall created
67b5296
zed 0.130.3
Marshall Bowers created
f7fe065
Only apply host-side executable fix to binaries downloaded by the extension (cherry-pick #10318) (#10319)
Cherry-picked Only apply host-side executable fix to binaries downloaded by the extension (#10318) This PR makes it so our temporary host-side workaround for setting certain language server binaries as executable only applies to binaries that are downloaded by the extension. Previously we would do this for any binary, including ones that could have been sourced from the $PATH. Release Notes: - Fixed a file permissions issue when trying to use a Zig language server (`zls`) present on the $PATH. Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
gcp-cherry-pick-bot[bot] and Marshall Bowers created
d4a59f6
zed 0.130.2
Conrad Irwin created
4976d8f
Respect language server's capabilities when calling `GetReferences` (cherry-pick #10285) (#10291)
Cherry-pick 56c0345cf30737d4d6db8adad9373c93fce338a0 into `v0.130.x`. This PR makes Zed respect the language server's capabilities when calling the `GetReferences` command (used in "Find All References", etc.). This fixes a crash that could occur when using Zed with Gleam v1.0. Release Notes: - Made "Find All References" respect the language server's capabilities. This fixes some instances where certain language servers would stop working after receiving a "Find All References" request. Co-authored-by: Max <max@zed.dev>
Marshall Bowers and Max created
03d0641
Fix panic in visual line mode with folds (cherry-pick #10284) (#10290)
Cherry-picked Fix panic in visual line mode with folds (#10284) Fixes: #10266 Release Notes: - Added/Fixed/Improved ... ([#<public_issue_number_if_exists>](https://github.com/zed-industries/zed/issues/<public_issue_number_if_exists>)). Optionally, include screenshots / media showcasing your addition that can be included in the release notes. **or** - N/A Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
gcp-cherry-pick-bot[bot] and Conrad Irwin created
d43f95d
Fix panic when deleting just-generated text (cherry-pick #10282) (#10287)
Cherry-picked Fix panic when deleting just-generated text (#10282) We ran into a panic when deleting text that was just generated by a code action. This fixes it by ensuring we don't run into a 0-minus-1 panic when a buffer_range is empty. Release Notes: - Fixed panic that could occur when deleting generated-by-unsaved text. Co-authored-by: Conrad <conrad@zed.dev> Co-authored-by: Thorsten Ball <mrnugget@gmail.com> Co-authored-by: Conrad <conrad@zed.dev>
gcp-cherry-pick-bot[bot] , Thorsten Ball , and Conrad created
07b70cd
tasks: fix panic in render_match (cherry-pick #10137) (#10288)
Cherry-picked tasks: fix panic in render_match (#10137) Release Notes: - Fixed panic in tasks modal (Preview only). Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
gcp-cherry-pick-bot[bot] and Piotr Osiewicz created
77bd4dc
Fix panic in drag entered (cherry-pick #10277) (#10286)
Cherry-picked Fix panic in drag entered (#10277) Co-Authored-By: Kirill <kirill@zed.dev> Release Notes: - Fixed panic when dragging into Zed. Optionally, include screenshots / media showcasing your addition that can be included in the release notes. **or** - N/A Co-authored-by: Kirill <kirill@zed.dev> Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com> Co-authored-by: Kirill <kirill@zed.dev>
gcp-cherry-pick-bot[bot] , Conrad Irwin , and Kirill created
b6fd948
Return back the ability to save non-dirty singleton buffers (#10174)
Kirill Bulatov created
b33f7c6
zed 0.130.1
Thorsten Ball created
e950a99
Improve handling of prettier errors on format (#10156)
When no formatter for a language is specified, Zed has the default behaviour: 1. Attempt to format the buffer with `prettier` 2. If that doesn't work, use the language server. The problem was that if `prettier` failed to format a buffer due to legitimate syntax errors, we simply did a fallback to the language server, which would then format over the syntax errors. With JavaScript/React/TypeScript projects this could lead to a situation where 1. Syntax error was introduced 2. Prettier fails 3. Zed ignores the error 4. typescript-language-server formats the buffer despite syntax errors This would lead to some very weird formatting issues. What this PR does is to fix the issue by handling `prettier` errors and results in two user facing changes: 1. When no formatter is set (or set to `auto`) and if we attempted to start a prettier instance to format, we will now display that error and *not* fall back to language server formatting. 2. If the formatter is explicitly set to `prettier`, we will now show errors if we failed to spawn prettier or failed to format with it. This means that we now might show *more* errors than previously, but I think that's better than not showing anything to the user at all. And, of course, it also fixes the issue of invalid syntax being formatted by the language server even though `prettier` failed with an error. Release Notes: - Improved error handling when formatting buffers with `prettier`. Previously `prettier` errors would be logged but ignored. Now `prettier` errors are shown in the UI, just like language server errors when formatting. And if no formatter is specified (or set to `"auto"`) and Zed attempts to use `prettier` for formatting, then `prettier` errors are no longer skipped. That fixes the issue of `prettier` not formatting invalid syntax, but its error being skipped, leading to `typescript-language-server` or another language server formatting invalid syntax.
Thorsten Ball created
8c05d78
v0.130.x preview
Joseph T. Lyons created
469be39
file_icons: Add license file (#10128)
This PR adds a missing license file to the `file_icons` crate. Release Notes: - N/A
Marshall Bowers created
db5d53d
clojure: Add license file (#10127)
This PR adds a symlink to the `LICENSE-APACHE` file for the Clojure extension. I knew I was forgetting something π Release Notes: - N/A
Marshall Bowers created
b118b76
editor: Fix "Toggle comments" not respecting multiple line_comments in language config (#10126)
This does not try to heuristically pick a comment style based on surroundings anyhow. It does improve our story around uncommenting though. Fixes #10113. Release Notes: - Fixed "Toggle comment" action not working in presence of non-default line comments such as doc comments in Rust ([#10113](https://github.com/zed-industries/zed/issues/10113)).
Piotr Osiewicz created
57a1b9b
tab_switcher: Add tab close buttons (#9968)
Support for closing tabs from Tab Switcher: - Close button color matches the indicator color to preserve the information that the buffer is dirty (as in SublimeText). - `ctrl-backspace` closes the currently selected item. https://github.com/zed-industries/zed/assets/2101250/8ea33911-2f62-4199-826d-c17556db8e9a Release Notes: - N/A
Andrew Lygin created
8eeecda
Add `crate` keyword to Rust (#10110)
Release Notes: - Fixed `crate` keyword not being highlighted in Rust files. Ref: #10104 And I make a sort for them.
Jason Lee created
eb231d0
Add `code_actions` as `formatter` type (#10121)
This fixes #8992 and solves a problem that ESLint/Prettier/... users
have been running into:
They want to format _only_ with ESLint, which is *not* a primary
language server (so `formatter: language server` does not help) and it
is not a formatter.
What they want to use is what they get when they have configured
something like this:
```json
{
"languages": {
"JavaScript": {
"code_actions_on_format": {
"source.fixAll.eslint": true
}
}
}
}
```
BUT they don't want to run the formatter.
So what this PR does is to add a new formatter type: `code_actions`.
With that, users can only use code actions to format:
```json
{
"languages": {
"JavaScript": {
"formatter": {
"code_actions": {
"source.fixAll.eslint": true
}
}
}
}
}
```
This means that when formatting (via `editor: format` or on-save) only
the code actions that are specified are being executed, no formatter.
Release Notes:
- Added a new `formatter`/`format_on_save` option: `code_actions`. When
configured, this uses language server code actions to format a buffer.
This can be used if one wants to, for example, format a buffer with
ESLint and *not* run prettier or another formatter afterwards. Example
configuration: `{"languages": {"JavaScript": {"formatter":
{"code_actions": {"source.fixAll.eslint": true}}}}}`
([#8992](https://github.com/zed-industries/zed/issues/8992)).
---------
Co-authored-by: JH Chabran <jh@chabran.fr>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Thorsten Ball , JH Chabran , and Marshall Bowers created
654504d
Remove `basic.conf` (#10120)
This PR removes the `basic.conf` file. In #10099 we suppressed some typo warnings that had cropped up in this file, but it turns out we don't need the file at all. Release Notes: - N/A
Marshall Bowers created
08e8ffc
docs: minor changes to ESLint docs (#10116)
We allow more than just `shortenToSingleLine`, so let's document the whole thing. Release Notes: - N/A
Thorsten Ball created
027897e
Do not spawn oneshot tasks from blank prompts (#10115)
Kirill Bulatov created
c4ceeb7
Fix git blame not working correctly with submodules (#10114)
This fixes #9958 by using the correct working directory in which to run `git blame`. This wasn't an issue for a single repository, because we could go from `.git` one directory up, but it doesn't work for submodules. Luckily there's a `workdir()` method on `self.repository` that does exactly what we need. In submodule:  Not in submodule:  Release Notes: - N/A
Thorsten Ball created
58aec1d
Do not push invisible local worktrees into recent documents (#10112)
Follow-up of https://github.com/zed-industries/zed/pull/9919 that removes invisible worktrees from the list, to avoid things like  Release Notes: - N/A
Kirill Bulatov created
9aad30a
Query code actions and hovers from all related local language servers (from remote clients) (#10111)
Supersedes https://github.com/zed-industries/zed/pull/8634 Fixes https://github.com/zed-industries/zed/issues/7947 by continuing https://github.com/zed-industries/zed/pull/9943 with the remote part. Now, clients are able to issue collab requests, that query all related language servers, not only the primary one. Such mode is enabled for GetHover and GetCodeActions LSP requests only. Release Notes: - Added Tailwind CSS hover popovers for Zed in multi player mode ([7947](https://github.com/zed-industries/zed/issues/7947))
Kirill Bulatov created
3a0d3ce
Compute scrollbar markers asynchronously (#10080)
Refs #9647 Fixes https://github.com/zed-industries/zed/issues/9792 This pull request moves the computation of scrollbar markers off the main thread, to prevent them from grinding the editor to a halt when we have a lot of them (e.g., when there are lots of search results on a large file). With these changes we also avoid generating multiple quads for adjacent markers, thus fixing an issue where we stop drawing other primitives because we've drawn too many quads in the scrollbar. Release Notes: - Improved editor performance when displaying lots of search results, diagnostics, or symbol highlights in the scrollbar ([#9792](https://github.com/zed-industries/zed/issues/9792)). --------- Co-authored-by: Antonio Scandurra <me@as-cii.com> Co-authored-by: Nathan <nathan@zed.dev>
Thorsten Ball , Antonio Scandurra , and Nathan created
7dbcace
Fix accidentally dropping shell environment variable (#10105)
Previously this code would run the changed commend, take its output, remove the `marker` from the front and then split on `0` byte. Problem was that `echo` adds a newline, which we did *NOT* skip. So whatever `env` printed as the first environment variable would have a `\n` in front of it. Instead of setting, say, `HOME`, Zed would set `\nHOME`. This change fixes the issue by switching to `printf '%s' marker`, which is more portable than using `echo -n`. This is related to https://github.com/zed-industries/zed/issues/9786 but I'm not sure yet whether that fixes it. Release Notes: - Fixed Zed sometimes missing environment variables from shell in case they were the first environment variable listed by `/usr/bin/env`.
Thorsten Ball created
463c16a
Allow users to configure ESLint's `problems` settings (#9981)
Presently the only available setting under `problems` is
`shortenToSingleLine`, which defaults to `false`.
Example Zed `settings.json` to shorten eslint error squiggles to only
show on the first line of the problem:
```json
{
"lsp": {
"eslint": {
"settings": {
"problems": {
"shortenToSingleLine": true
}
}
}
}
}
```
Release Notes:
- Added support for configuring ESLint `problems` settings, ie. `{"lsp":
{"eslint": {"settings": {"problems": {"shortenToSingleLine": true}}}}}`
Demo:
https://github.com/zed-industries/zed/assets/2072378/379faa75-1f37-4fd1-85da-1510f1397d07
William Villeneuve created
5a2a85a
Fix vim code working on display map chars (#10103)
Release Notes: - vim: Fixed motion bugs when softwrap, folds or inlay hints were used.
Conrad Irwin created
754547f
Fix mention notifications are not updated after message change and not removed after a message is deleted (#9847)
@ConradIrwin This is a followup for #9035 as agreed. Release Notes: - Fixed mention notifications are updated when channel message is updated. And mention notifications are removed when message is removed. --------- Co-authored-by: Bennet Bo Fenner <53836821+bennetbo@users.noreply.github.com>
Remco Smits and Bennet Bo Fenner created
fe7b12c
fix rejoin after quit (#10100)
Release Notes: - collab: Fixed rejoining channels quickly after a restart
Conrad Irwin created
8958c9e
Suppress typos in `basic.conf` (#10099)
This PR updates the `typos` configuration to suppress some typos in `basic.conf`. AFAICT there must have been an update to `typos` that caused this new warning to appear. Release Notes: - N/A
Marshall Bowers created
7d5048e
Revert PR #6924 - go to reference when there's only one (#10094)
This PR reverts #6924, for the reasons stated in https://github.com/zed-industries/zed/pull/6924#issuecomment-2033076300. It also fixes an issue were the `find_all_references_task_sources` wasn't cleaned up in all cases. Release Notes: - N/A --------- Co-authored-by: Marshall <marshall@zed.dev> Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Max Brunsfeld , Marshall , and Marshall Bowers created
65cde17
Fix collab logging (#10095)
span! statically determines which fields are available, and record silently fails if you write to a field that is not available :/ Release Notes: - N/A
Conrad Irwin created
9317fe4
Revert "Revert "Revert dependency updates in #9836 (#10089)""
This reverts commit c8b14ee2cb976ca48b6df5fdf068c18c1d04c7a8.
Conrad Irwin created
c8b14ee
Revert "Revert dependency updates in #9836 (#10089)"
This reverts commit 55c897d993e63f90645acd1b08a21d81ab402f16.
Conrad Irwin created
55c897d
Revert dependency updates in #9836 (#10089)
Due to: https://github.com/zed-industries/zed/issues/9985 and an abundance of caution, I'm reverting the image and svg rendering updates for now until we can debug the issue. cc: @niklaswimmer Release Notes: - N/A
Mikayla Maki created
6121bfc
Extract Clojure support into an extension (#10088)
This PR extracts Clojure support into an extension and removes the built-in Clojure support from Zed. Release Notes: - Removed built-in support for Clojure, in favor of making it available as an extension. The Clojure extension will be suggested for download when you open a `.clj` or other Clojure-related files. --------- Co-authored-by: Max <max@zed.dev>
Marshall Bowers and Max created
46544d7
Revert PR #8327 - Fix autocomplete completions being cut in half (#10084)
This reverts https://github.com/zed-industries/zed/pull/8327 That PR introduced a regression where completions' syntax highlighting would be corrupted in a non-deterministic way, such that it varied from frame to frame: In the screenshot below, many of the field names (e.g. `cursor`, `depth`) are incorrectly colored as types instead of fields. The `finished_states` field has highlighting that changes at the wrong offset. All of these values changed from frame to frame, creating a strange flickering effect: <img width="599" alt="Screenshot 2024-04-01 at 5 56 36β―PM" src="https://github.com/zed-industries/zed/assets/326587/b6a48f02-f146-4f76-92e6-32fb417d86c0"> Release Notes: - N/A
Max Brunsfeld created
8df888e
task: Add "remove" button next to oneshot tasks (#10083)
Release Notes: - Added a "remove" button next to oneshot tasks in tasks modal.
Piotr Osiewicz created
a1cb677
Make conversions to `wasmtime::Result` postfix-friendly (#10082)
This PR refactors the conversions to `wasmtime::Result` to use a trait so that we can perform the conversions in a postfix-friendly way. Release Notes: - N/A
Marshall Bowers created
c62239e
Include commit hash in Nightly & Dev builds (#10054)
Release Notes: - N/A <img width="1338" alt="image" src="https://github.com/zed-industries/zed/assets/16290753/c8442dbe-d293-46ef-abb1-ed8a6d9bf37d"> --------- Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
moshyfawn and Marshall Bowers created
15ef3f3
Add Tailwind autocomplete for Vue (#10078)
This fixes #4403 by adding TailwindLsp to .vue files too and autocomplete aswell  Release Notes: - Added Tailwind support in `.vue` files ([#4403](https://github.com/zed-industries/zed/issues/4403)).
RenΓ© created
ad03a7e
Remove tooltips on scroll wheel events (#10069)
This fixes #9928 by invalidating the tooltip on mouse scroll. I think _ideally_ we'd have a solution that only invalidates it if, after mouse scroll, we're not hovering over the element. But I tried that (by essentially duplicating the code for `MouseMoveEvent` but that lead to some inconsistencies. I think we don't redraw when we finish scrolling. This now behaves exactly like tooltips in Chrome: invalidate on scroll, move mouse again to trigger the tooltip. It also behaves like the hover tooltips in the editor. https://github.com/zed-industries/zed/assets/1185253/05b9170e-414c-4453-84e5-90510b943c15 Release Notes: - N/A
Thorsten Ball created
84cca62
Fix alignment in git blame gutter (#10067)
Fixes #9977. Instead of doing nasty string alignment, this now uses the layout engine.  Release Notes: - N/A
Thorsten Ball created
b43602f
editor: indent from cursor position with a single selection (#10073)
In 9970 @JosephTLyons noticed that tab + tab_prev action sequence leaves a buffer in the dirty state, whereas "similar" indent-outdent does not. I've tracked it down to the fact that tabs are always inserted at the start of the line, regardless of the cursor position, whereas tab-prevs act from cursor position. This PR adjust tab/tab-prev actions (and indent-outdent) to act from cursor position if possible. That way we can correctly report buffer dirty state for these event sequences. Fixes #9970 Release Notes: - Fixed buffer being marked as dirty when using tab/tab-prev actions.
Piotr Osiewicz created