bc6e7db
zed 0.131.4
Conrad Irwin created
bc6e7db
zed 0.131.4
Conrad Irwin created
18f0bc4
Fix emojis when rendering with the system ui font (cherry-pick #10491) (#10493)
Cherry-picked Fix emojis when rendering with the system ui font (#10491) Release Notes: - N/A Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
gcp-cherry-pick-bot[bot] and Conrad Irwin created
4ef4748
Use buffer font for search (cherry-pick #10455) (#10494)
Cherry-picked Use buffer font for search (#10455) It's wierd to type code/regex in the UI font Release Notes: - Continue to use buffer font for search Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
gcp-cherry-pick-bot[bot] and Conrad Irwin created
3082408
Use buffer font when rendering editor breadcrumbs and diagnostics (cherry-pick #10488) (#10495)
Cherry-picked Use buffer font when rendering editor breadcrumbs and diagnostics (#10488) Before: <img width="592" alt="Screenshot 2024-04-12 at 12 00 00 PM" src="https://github.com/zed-industries/zed/assets/2280405/3251743e-4f2c-4ca3-9bc5-88f37660f7b9"> After: <img width="673" alt="Screenshot 2024-04-12 at 12 11 37 PM" src="https://github.com/zed-industries/zed/assets/2280405/6a8ac597-261a-45d9-bf2a-a673b6f26b0e"> Release Notes: - N/A Co-authored-by: Mikayla Maki <mikayla@zed.dev>
gcp-cherry-pick-bot[bot] and Mikayla Maki created
5df5a40
zed 0.131.3
Kyle Kelley created
ca62f6e
Do not show image viewer for SVGs (cherry-pick #10435) (#10447)
Cherry-picked Do not show image viewer for SVGs (#10435) Absent some ability to toggle between viewing and editing a file, I think it would be best to get a fix out quick for people to edit SVGs as text files. Release Notes: - Fixed editing of SVG images by disabling it from the image viewer ([#10403](https://github.com/zed-industries/zed/issues/10403)). Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
gcp-cherry-pick-bot[bot] and Kyle Kelley created
b01c07b
zed 0.131.2
Marshall Bowers created
c35c957
Validate content-length of downloaded extension tar gz files (cherry-pick #10430) (#10440)
Cherry-picked Validate content-length of downloaded extension tar gz files (#10430) Release Notes: - Fixed a bug where extension installation would appear to succeed even if the download did not complete due to network interruptions ([#10330](https://github.com/zed-industries/zed/issues/10330)). 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
0137e7e
zed 0.131.1
Kirill Bulatov created
25b8e46
Use proper Workspace references when querying for tasks by name (#10383)
Closes https://github.com/zed-industries/zed/issues/10380 Release Notes: - Fixed Zed panicking when running tasks via a keybinding ([10380](https://github.com/zed-industries/zed/issues/10380))
Kirill Bulatov created
04e6d5d
Fix panic when loading malformed Wasm files (cherry-pick #10370) (#10371)
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
547d022
v0.131.x preview
Joseph T. Lyons created
fc10201
Remove occasionally incorrect expectation (#10358)
This panic has occured a handful of times, I think it must be the case that: 1. Item is dropped outside of an update loop 2. The next update is this one In that case no flush effects will have called the release observers yet, but we cannot upgrade the WeakModel because the ref count is 0 Release Notes: - Fixed a (rare) panic while collaborating
Conrad Irwin created
7abb63c
Improve the ergonomics of creating local buffers (#10347)
This PR renames `language::Buffer::new` to `language::Buffer::local` and
simplifies its interface. Instead of taking a replica id (which should
always be 0 for the local case) and a `BufferId`, which was awkward and
verbose to construct, it simply takes text and a `cx`.
It uses the `cx` to derive a `BufferId` from the `EntityId` associated
with the `cx`, which should always be positive based on the following
analysis...
We convert the entity id to a u64 using this method on `EntityId`, which
is defined by macros in the `slotmap` crate:
```rust
pub fn as_ffi(self) -> u64 {
(u64::from(self.version.get()) << 32) | u64::from(self.idx)
}
```
If you look at the type of `version` in `KeyData`, it is non-zero:
```rust
#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct KeyData {
idx: u32,
version: NonZeroU32,
}
```
This commit also adds `Context::reserve_model` and
`Context::insert_model` to determine a model's entity ID before it is
created, which we need in order to assign a `BufferId` in the background
when loading a buffer asynchronously.
Release Notes:
- N/A
---------
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Nathan Sobo and Piotr Osiewicz created
664efef
Remove line breaks when displaying file names in the project panel (#10231)
- Fixed #8603 For the label title of the project panel, I find that there is no place to use to get the title of the label to do some operations, it should be safe to modify it, but I'm not sure how we need to modify the problem, I can think of two scenarios: 1. Modify every place where you don't want multiple lines to appear 2. Make the label only display a single line (e.g. provide a new parameter, or a new label type?)
Hans created
26299fb
chat panel: Fix new messages indicator appearing when message was deleted (#10278)
Release Notes: Fixed an issue where the "New messages" indicator in the channel chat would be shown even if the message was deleted
Bennet Bo Fenner created
39e0e26
Line numbers short mode (#10354)
Followup to #10327 It can be enabled with the following setting: "line_indicator_format": "short" No release note, as the original change didn't go out to Preview yet. /cc @bartekpacia @0x2CA Release Notes: - N/A
Piotr Osiewicz created
4151ba1
X11: Don't emit keypress events for modifiers (#10271)
This fixes certain shortcuts/motions on X11 like in vim mode "v i )", where previously zed would interpret it as "v i SHIFT )" due to the x11 backend emitting key press events for modifier keys even though other platforms like Wayland don't. This also adds support for ModifiersChanged events to X11 Release Notes: - Fixed vim motions like "v i )" not working on X11 ([#10199](https://github.com/zed-industries/zed/issues/10199)).
Kamal Ahmad created
6ac3431
Windows: Fix render resource not being released (#10233)
Release Notes: - N/A
CharlesChen0823 created
c763c8c
windows: Implement `restart` action (#10234)
Release Notes: - N/A
张小白 created
bfd9bb8
Use shared text system on Linux and Windows (#10098)
closes #10129 closes #10269 Release Notes: - N/A
Ezekiel Warren created
8f69eac
Update blade to a version that can run GLES for Zed (#10243)
Release Notes: - N/A Picks up https://github.com/kvark/blade/pull/105, https://github.com/kvark/blade/pull/97, and more Switches the presentation to be non-blocking, which will improve the latency slightly. Allows to start playing with GLES backend, e.g. ```bash cd crates/gpui RUSTFLAGS="--cfg gles" CARGO_TARGET_DIR=./target-gl cargo run --example hello_world ``` It doesn't currently render properly due to an issue that needs investigation, see https://github.com/kvark/blade/pull/105#issuecomment-2041006542 But at least it's a start Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Dzmitry Malyshau and Mikayla Maki created
3fc08a0
Fix a bug from the Linux rewrite where Wayland windows would not render properly (#10343)
Release Notes: - N/A
Mikayla Maki created
fff197b
Show lines selected & selection quantity in status bar (#10327)
Fixes #4204     Release Notes: - Line number indicator now shows number of lines selected and a number of selections.
Piotr Osiewicz created
6b320b9
Fix cleanup of LSP request status messages (#10336)
This fixes a bug in https://github.com/zed-industries/zed/pull/9818, where the status was not removed if the request failed. It also adds replication of these new status messages to guests when collaborating. Release Notes: - Fixed an issue where the status of failed LSP actions was left in the status bar --------- Co-authored-by: Marshall <marshall@zed.dev> Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Max Brunsfeld , Marshall , and Marshall Bowers created
a0ee29a
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>
Max Brunsfeld and Marshall created
0331fde
Parse human readable module name for Rust tasks (#10337)
Part of https://github.com/zed-industries/zed/issues/10132 extracted out of a bigger PR that refactors tasks and shows labels that look more like commands (ergo needs better readable package names) Release Notes: - N/A
Kirill Bulatov created
7dfc718
Use task icons for all kinds of tasks (#10333)
<img width="565" alt="image" src="https://github.com/zed-industries/zed/assets/2690773/cbb59154-1153-459a-978c-8c125e879d27"> <img width="562" alt="image" src="https://github.com/zed-industries/zed/assets/2690773/d3f65a09-2f75-4db8-85c2-1abb591e609c"> Release Notes: - Added more icons to task modal
Kirill Bulatov created
759c65d
Show errors when failing to create directories on startup (#10326)
Release Notes: - Improved error reporting on startup ([#9036](https://github.com/zed-industries/zed/issues/9036)).
Conrad Irwin created
0533923
Reduce memory usage to represent buffers by up to 50% (#10321)
This should help with some of the memory problems reported in https://github.com/zed-industries/zed/issues/8436, especially the ones related to large files (see: https://github.com/zed-industries/zed/issues/8436#issuecomment2037442695), by **reducing the memory required to represent a buffer in Zed by ~50%.** ### How? Zed's memory consumption is dominated by the in-memory representation of buffer contents. On the lowest level, the buffer is represented as a [Rope](https://en.wikipedia.org/wiki/Rope_(data_structure)) and that's where the most memory is used. The layers above — buffer, syntax map, fold map, display map, ... — basically use "no memory" compared to the Rope. Zed's `Rope` data structure is itself implemented as [a `SumTree` of `Chunks`](https://github.com/zed-industries/zed/blob/8205c52d2bc204b8234f9306562d9000b1691857/crates/rope/src/rope.rs#L35-L38). An important constant at play here is `CHUNK_BASE`: `CHUNK_BASE` is the maximum length of a single text `Chunk` in the `SumTree` underlying the `Rope`. In other words: It determines into how many pieces a given buffer is split up. By changing `CHUNK_BASE` we can adjust the level of granularity withwhich we index a given piece of text. Theoretical maximum is the length of the text, theoretical minimum is 1. Sweet spot is somewhere inbetween, where memory use and performance of write & read access are optimal. We started with `16` as the `CHUNK_BASE`, but that wasn't the result of extensive benchmarks, more the first reasonable number that came to mind. ### What This changes `CHUNK_BASE` from `16` to `64`. That reduces the memory usage, trading it in for slight reduction in performance in certain benchmarks. ### Benchmarks I added a benchmark suite for `Rope` to determine whether we'd regress in performance as `CHUNK_BASE` goes up. I went from `16` to `32` and then to `64`. While `32` increased performance and reduced memory usage, `64` had one slight drop in performance, increases in other benchmarks and substantial memory savings. | `CHUNK_BASE` from `16` to `32` | `CHUNK_BASE` from `16` to `64` | |-------------------|--------------------| |  |  | ### Real World Results We tested this by loading a 138 MB `*.tex` file (parsed as plain text) into Zed and measuring in `Instruments.app` the allocation. #### standard allocator Before, with `CHUNK_BASE: 16`, the memory usage was ~827MB after loading the buffer. | `CHUNK_BASE: 16` | |---------------------| |  | After, with `CHUNK_BASE: 64`, the memory usage was ~396MB after loading the buffer. | `CHUNK_BASE: 64` | |---------------------| |  | #### `mimalloc` `MiMalloc` by default and that seems to be pretty aggressive when it comes to growing memory. Whereas the std allocator would go up to ~800mb, MiMalloc would jump straight to 1024MB. I also can't get `MiMalloc` to work properly with `Instruments.app` (it always shows 15MB of memory usage) so I had to use these `Activity Monitor` screenshots: | `CHUNK_BASE: 16` | |---------------------| |  | | `CHUNK_BASE: 64` | |---------------------| |  | ### Release Notes Release Notes: - Reduced memory usage for files by up to 50%. --------- Co-authored-by: Antonio <antonio@zed.dev>
Thorsten Ball and Antonio created
b6857ca
Use v0.0.6 of the `zed_extension_api` for extensions that need it (#10324)
This PR updates the extensions dependent on v0.0.6 of the `zed_extension_api` crate to use the now-published version on crates.io instead of a path dependency. The impacted extensions are: - `dart` - `gleam` - `haskell` - `svelte` Release Notes: - N/A
Marshall Bowers created
132b8aa
Improve extension API documentation (#10322)
This PR adds some more documentation to symbols exported from the `zed_extension_api` crate. Release Notes: - N/A
Marshall Bowers created
4140583
Switch to the system UI font on macOS (#10317)
To reference the system font, use the special ".SystemUIFont" family name. /cc @PixelJanitor Release Notes: - Switched to the system UI font for user interface elements on macOS. Co-authored-by: Antonio Scandurra <antonio@zed.dev>
Nathan Sobo and Antonio Scandurra created
8205c52
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.
Marshall Bowers created
4fb9f41
gpui/metal: Clamp max texture width/height to 16kB (#10314)
Fixed #10149 A user had Zed crash due to invalid font size in settings. It turned out the width/height of glyphs does not pass validation in Metal texture initialization with a large enough font size. All modern Macs have a max texture width/height of 16kB (barring Apple A8, used by iPhone 6 back in 2014, which uses 8kB). This commit clamps texture size at 16kB. Note that while it fixes Zed crash, using a font size that hits the limit is still pretty unusable - the users will still have a pretty unusable editor, but at least it won't crash for them. Release Notes: - Fixed crashes with huge `buffer_font_size` values.
Piotr Osiewicz created
935e0d5
Improve Find/Replace shortcuts (#10297)
This PR changes ways the Find/Replace functionality in the Buffer/Project Search is accessible via shortcuts. It makes those panels work the same way as in VS Code and Sublime Text. The details are described in the issue: [Make Find/Replace easier to use](https://github.com/zed-industries/zed/issues/9142) There's a difficulty with the Linux keybindings: VS Code uses on MacOS (this PR replicates it): | Action | Buffer Search | Project Search | | --- | --- | --- | | Find | `cmd-f` | `cmd-shift-f` | | Replace | `cmd-alt-f` | `cmd-shift-h` | VS Code uses on Linux (this PR replicates all but one): | Action | Buffer Search | Project Search | | --- | --- | --- | | Find | `ctrl-f` | `ctrl-shift-f` | | Replace | `ctrl-h` ❗ | `ctrl-shift-h` | The problem is that `ctrl-h` is already taken by the `editor::Backspace` action in Zed on Linux. There's two options here: 1. Change keybinding for `editor::Backspace` on Linux to something else, and use `ctrl-h` for the "replace in buffer" action. 2. Use some other keybinding on Linux in Zed. This PR introduces `ctrl-r` for this purpose, though I'm not sure it's the best choice. What do you think? fixes #9142 Release Notes: - Improved access to "Find/Replace in Buffer" and "Find/Replace in Files" via shortcuts (#9142). Optionally, include screenshots / media showcasing your addition that can be included in the release notes. - N/A
Andrew Lygin created
cc367d4
Sanitize ranges in code labels coming from extensions (#10307)
Without any sanitization, extensions would be able to crash zed, because the editor code assumes these ranges are valid. Release Notes: - N/A
Max Brunsfeld created
a4566c3
gleam: Strip newlines in completion details returned from language server (#10304)
This PR updates the Gleam extension to strip out newlines in the completion details returned from the language server. These newlines were causing the completion menu to compute a large height for each item, resulting in lots of empty space in the completion menu: <img width="878" alt="Screenshot 2024-04-08 at 8 53 29 PM" src="https://github.com/zed-industries/zed/assets/1486634/383c52ec-e5cb-4496-ae4c-28744b4ecaf5"> The approach to stripping newlines allocates a bit more than I would like. It would be good to see if it is possible for the Gleam language server to not send us these newlines in the first place. Release Notes: - N/A
Marshall Bowers created
843aad8
Flip the optionality of the `auto_update` setting (#10302)
This PR flips the optionality of the `AutoUpdateSettingContent` to make it a bit easier to work with. #### Before ```rs struct AutoUpdateSettingContent(Option<bool>); type FileContent = AutoUpdateSettingContent; ``` #### After ```rs struct AutoUpdateSettingContent(bool); type FileContent = Option<AutoUpdateSettingContent>; ``` Release Notes: - N/A
Marshall Bowers created
def87a8
WIP: Refactor Linux platform implementation (#10227)
This puts the Linux platform implementation at a similar code style and quality to the macOS platform. The largest change is that I collapsed the `LinuxPlatform` -> `[Backend]` -> `[Backend]State` -> `[Backend]StateInner` to just `[Backend]` and `[Backend]State`, and in the process removed most of the `Rc`s and `RefCell`s. TODO: - [x] Make sure that this is on-par with the existing implementation - [x] Review in detail, now that the large changes are done. - [ ] Update the roadmap Release Notes: - N/A
Mikayla Maki created
ee1642a
Fix broken loading of `auto_update` setting (#10301)
This PR fixes a panic when attempting to load the `auto_update` setting. This was leftover from #10296. I'm going to see if there's a better way we can handle these cases so they're more obviously correct. Release Notes: - N/A
Marshall Bowers created
7c5bc3c
Add the ability for extensions to provide language settings (#10296)
This PR adds the ability for extensions to provide certain language settings via the language `config.toml`. These settings are then merged in with the rest of the settings when the language is loaded from the extension. The language settings that are available are: - `tab_size` - `hard_tabs` - `soft_wrap` Additionally, for bundled languages we moved these settings out of the `settings/default.json` and into their respective `config.toml`s . For languages currently provided by extensions, we are leaving the values in the `settings/default.json` temporarily until all released versions of Zed are able to load these settings from the extension. --- Along the way we ended up refactoring the `Settings::load` method slightly, introducing a new `SettingsSources` struct to better convey where the settings are being loaded from. This makes it easier to load settings from specific locations/sets of locations in an explicit way. Release Notes: - N/A --------- Co-authored-by: Max <max@zed.dev> Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Marshall Bowers , Max , and Max Brunsfeld created
4a3032c
Append `-- --nocapture` to Rust function-level tests (#10299)
Release Notes: - N/A
Kirill Bulatov created
f327118
vim: Allow search with operators & visual mode (#10226)
Fixes: #4346 Release Notes: - vim: Add search motions (`/,?,n,N,*,#`) in visual modes and as targets for operators like `d`,`c`,`y` ([#4346](https://github.com/zed-industries/zed/issues/4346)).
Conrad Irwin created
f9bf60f
vim: Fix cgn backwards movement when there is no matches (#10237)
Release Notes: - Fixed `cgn` backwards movement problem in #9982 There are two issues: - When there are no more matches, the next repetition still moves the cursor to the left. After that, the recording is cleared. For this I simply move the cursor to the right, but it doesn't work when the cursor is at the end of the line. - If `cgn` is used when there are no matches, it cleans the previous recorded actions. Maybe there should be a way to revert the recording. This also happens when using `c` and `esc` --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
joaquin30 and Conrad Irwin created
0390df2
Fix block cursor does not render italic for vim (#10249)
Release Notes: - Fixed #8799
Hans created
cf5a113
Don't panic when multiple Zed instances are open (#10295)
This stops an annoying panic that can occur when developing Zed Release Notes: - N/A
Mikayla Maki created
7dccbd8
markdown preview: Improve live preview (#10205)
This PR contains various improvements for the markdown preview (some of which were originally part of #7601). Some improvements can be seen in the video (see also release notes down below): https://github.com/zed-industries/zed/assets/53836821/93324ee8-d366-464a-9728-981eddbfdaf7 Release Notes: - Added action to open markdown preview in the same pane - Added support for displaying channel notes in markdown preview - Added support for displaying the current active editor when opening markdown preview - Added support for scrolling the editor to the corresponding block when double clicking an element in markdown preview - Improved pane creation handling when opening markdown preview - Fixed markdown preview displaying non-markdown files
Bennet Bo Fenner created
d009d84
Add support for using a language server with multiple languages (#10293)
This PR updates the `extension.toml` to allow specifying multiple languages for a language server to work with. The `languages` field takes precedence over `language`. In the future the `language` field will be removed. As part of this, the Emmet extension has been extended with support for PHP and ERB. Release Notes: - N/A --------- Co-authored-by: Max <max@zed.dev>
Marshall Bowers and Max created
5e44748
Adjust string splitting function (#10221)
- Fixed #9729 and #10193 This commit fixes an issue where the string splitting function was handling characters in the input string improperly. We adjusted the use of the `take_while` function to calculate the length of the numeric prefix, rather than directly splitting the string, thus correctly splitting the string into a numeric prefix part and the remaining part
Hans created