Commit Graph

18524 Commits

Author SHA1 Message Date
Piotr Osiewicz
7b73e2824b
fs: allocate backing storage once in Fs::load (#9020)
`futures_lite::AsyncReadExt::read_to_string` (that we use in
`RealFs::load`) explicitly does not allocate memory for String contents
up front, which leads to excessive reallocations. That reallocation time
is a significant contributor to the time we spend loading files (esp
large ones). For example, out of ~1s that it takes to open up a 650Mb
ASCII buffer on my machine (after changes related to fingerprinting from
#9007), 350ms is spent in `RealFs::load`.
This change slashes that figure to ~110ms, which is still *a lot*. About
60ms out of 110ms remaining is spent zeroing memory. Sadly,
`AsyncReadExt` API forces us to zero a buffer we're reading into
(whether it's via read_to_string or read_exact), but at the very least
this commit alleviates unnecessary reallocations.

We could probably use something like
[simdutf8](https://docs.rs/simdutf8/latest/simdutf8/) to speed up UTF8
validation in this method as well, though that takes only about ~18ms
out of 110ms, so while it is significant, I've left that out for now.
Memory zeroing is a bigger problem at this point.

Before:

![image](https://github.com/zed-industries/zed/assets/24362066/5e53c004-8a02-47db-bc75-04cb4113a6bc)

After:

![image](https://github.com/zed-industries/zed/assets/24362066/00099032-d647-4683-b290-eaeb969cac4a)

/cc @as-cii 

Release Notes:

- Improved performance when loading large files.
2024-03-08 14:40:26 +01:00
Kirill Bulatov
1081ba7a62
Adjust to newer logic from zed-industries/cargo-bundle (#9058)
Zed uses a fork of cargo-bundle, that got upstream changes and
9e185bd44d
into the deploy branch.

Remove a TODO and adjust the script to the new packaging logic.


Release Notes:

- N/A
2024-03-08 13:37:10 +02:00
Conrad Irwin
ed8aa6d200
Fix panic in layout_line when Y coordinate is too high (#9052)
Release Notes:

- N/A
2024-03-07 22:33:44 -07:00
Valentine Briese
af564242e1
Make comment above util::fs::remove_matching a doc comment (#9051)
Just this one little thing, noticed it while working on an unrelated
pull request.

Release Notes:

- N/A
2024-03-07 21:15:52 -08:00
EricApostal
aa7be4b5d8
Add clipboard support for Windows (#8978)
Release Notes:

- Added Read / Write clipboard support to Windows via copypasta

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-07 20:16:38 -08:00
Conrad Irwin
866d791760
Fix joining hosted projects (#9038)
Release Notes:

- N/A
2024-03-07 19:56:41 -07:00
Rom Grk
f67abd2943
vim: smartcase find option (#9033)
Release Notes:

- Added option `use_smartcase_find` to the vim-mode
2024-03-07 19:44:20 -07:00
Rom Grk
d247086b21
vim: subword motions (#8725)
Add subword motions to vim, inspired by
[nvim-spider](https://github.com/chrisgrieser/nvim-spider),
[CamelCaseMotion](https://github.com/bkad/CamelCaseMotion).


Release Notes:

- Added subword motions to vim
2024-03-07 19:36:12 -07:00
rauan
467a179837
Add Elixir symbols in outline view (#8761)
Release Notes:

- Improved: Add `@callback`, `@type` and `@typep` Elixir symbols in
outline view



https://github.com/zed-industries/zed/assets/14976415/208d3def-f49e-41e0-a306-fb8e00317e6b
2024-03-07 19:35:01 -07:00
Small White
b50f86735f
Impl drag-drop action for Windows (#8959)
### Description

This is a part of #8809 



https://github.com/zed-industries/zed/assets/14981363/2b085b9d-8b83-4ac7-8b84-07c679760eba




Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-07 15:59:48 -08:00
Small White
e85d484952
Fix terminal on Windows (#8999)
### Description

Since [this PR](https://github.com/alacritty/alacritty/pull/7796) has
been merged, so we can delete the `todo`s in `terminal` module.


Release Notes:

- N/A
2024-03-07 15:54:58 -08:00
Rom Grk
2d83580df4
linux: enable test TextSystem (#9037)
Make text tests work on linux.
2024-03-07 15:51:52 -08:00
白山風露
a90a667fd0
Windows: Add document (#8948)
Release Notes:

- N/A
2024-03-07 15:41:15 -08:00
Bing Wang
35c7b5d7dd
Add vulkan linux dependency (#8932)
Release Notes:

- Fixed ([#8934](https://github.com/zed-industries/zed/issues/8934)).

Optionally, include screenshots / media showcasing your addition that
can be included in the release notes.

**or**

- N/A

Signed-off-by: pigletfly <wangbing.adam@gmail.com>
2024-03-07 15:40:27 -08:00
Kirill Bulatov
ffebe2e4a6
Initial Linux nightly bundles upload (#8913)
Changes Zed CI to build and upload Linux nightly bundles.

* `todo!(linux)` are replaced with `TODO linux` to make `todo!`-based
workflows more convenient
* renames `run-build-dmg` label into `run-bundling`, also renames a few
GH Actions entries to be more generic
* make another upload path for Linux, which keeps a separate file with SHA to version the nightly artifact.
* adds a `*.deb` package building with a couple of caveats, marked with
new `TODO linux` entries:

1. `cargo-bundle` is not very flexible, so it generates artifacts with
the structure and names that we're unable to alter before/during the
generation.
For that, a set of extra steps is made by repacking the *.deb package —
this is not very portable between different Linux distros, so later one
needs to find a way to combine multiple package types in this script.

2. `cargo-bundle` is not able to properly generate the *.msi bundle
despite declaring it in the features:
https://github.com/burtonageo/cargo-bundle/issues/116
Windows needs to invent its own way of bundling or fix the tool.

3. Both `cli` and `zed` binaries are added into the archive under
`/usr/local/bin/` path with their `-$channel` suffix
(-nightly/-preview/-dev/-stable) and a `/usr/local/bin/zed ->
/usr/local/bin/cli-nightly` symlink is made to make CLI work as Zed
launcher:
```
~/work/zed kb/linux-nightly:origin/kb/linux-nightly*​ ❯ dpkg -c target/zed_amd64.deb 
drwxr-xr-x allaptop/allaptop 0 2024-03-06 00:53 ./
drwxr-xr-x allaptop/allaptop 0 2024-03-06 00:53 ./usr/
drwxr-xr-x allaptop/allaptop 0 2024-03-06 00:53 ./usr/local/
drwxr-xr-x allaptop/allaptop 0 2024-03-06 00:53 ./usr/local/bin/
-rwxr-xr-x allaptop/allaptop 8746832 2024-03-06 00:53 ./usr/local/bin/cli-nightly
-rwxr-xr-x allaptop/allaptop 689078560 2024-03-06 00:53 ./usr/local/bin/zed-nightly
drwxr-xr-x allaptop/allaptop         0 2024-03-06 00:53 ./usr/share/
drwxr-xr-x allaptop/allaptop         0 2024-03-06 00:53 ./usr/share/applications/
-rw-r--r-- allaptop/allaptop       153 2024-03-06 00:53 ./usr/share/applications/zed.desktop
drwxr-xr-x allaptop/allaptop         0 2024-03-06 00:53 ./usr/share/icons/
drwxr-xr-x allaptop/allaptop         0 2024-03-06 00:53 ./usr/share/icons/hicolor/
drwxr-xr-x allaptop/allaptop         0 2024-03-06 00:53 ./usr/share/icons/hicolor/1024x1024@2x/
drwxr-xr-x allaptop/allaptop         0 2024-03-06 00:53 ./usr/share/icons/hicolor/1024x1024@2x/apps/
-rw-r--r-- allaptop/allaptop    716288 2024-03-06 00:53 ./usr/share/icons/hicolor/1024x1024@2x/apps/zed.png
drwxr-xr-x allaptop/allaptop         0 2024-03-06 00:53 ./usr/share/icons/hicolor/512x512/
drwxr-xr-x allaptop/allaptop         0 2024-03-06 00:53 ./usr/share/icons/hicolor/512x512/apps/
-rw-r--r-- allaptop/allaptop    239870 2024-03-06 00:53 ./usr/share/icons/hicolor/512x512/apps/zed.png
lrwxrwxrwx allaptop/allaptop         0 2024-03-06 00:53 ./usr/local/bin/zed -> /usr/local/bin/cli-nightly
```

But the CLI does not work under Linux yet and there's no way to install
that CLI from Zed now; Zed binary itself is not able to open
`file/location:12:34`-like things and set up the env properly, but is
able to start or open a directory.

So, this structure can be considered temporary and changed, if needed.

4. Zed Nightly on Linux does not know how to update itself, so all
nightly publishing is not picked up automatically.

5. Rust cache from `main` builds does not get shared between CI jobs,
due to being run in a different CI job that forms a different CI key, so
```
      - name: Cache dependencies
        uses: swatinem/rust-cache@v2
        with:
          save-if: ${{ false }}
```
would not work.
This makes Linux bundling jobs long.

Release Notes:

- N/A
2024-03-07 23:22:53 +02:00
Conrad Irwin
e85f190128
Fix 0 notes versions being always unread (#9030)
Co-Authored-By: Max <max@zed.dev>
Co-Authored-By: Nathan <nathan@zed.dev>

Release Notes:

- Fixed empty notes always showing as unread

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Nathan <nathan@zed.dev>
2024-03-07 13:53:05 -07:00
Conrad Irwin
284a57d4d1
Fix panic in open urls (#9032)
Co-Authored-By: Nathan <nathan@zed.dev>

Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
2024-03-07 13:52:50 -07:00
Rom Grk
9068911eb4
wayland: don't dispatch modifier key events (#9027)
Modifier keys are dispatched as events on wayland, unlike macos. This
prevents pending bindings from matching, because something like e.g. `g
shift-e` is received by the key matcher as `g shift shift-e`.
2024-03-07 12:42:48 -08:00
Max Brunsfeld
27518f4280 Fix extension store test failure on main due to wasi-sdk download 2024-03-07 10:53:28 -08:00
Conrad Irwin
86748a09e7
Denormalize buffer operations (#9026)
This should significantly reduce database load on redeploy.

Co-Authored-By: Max <max@zed.dev>
Co-Authored-By: Nathan <nathan@zed.dev>

Release Notes:

- Reduced likelihood of being disconnected during deploys

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Nathan <nathan@zed.dev>
2024-03-07 11:35:47 -07:00
d1y
b5370cd15a
Remove git_commit syntax highlighting from core Zed (#9025)
Fallback to extension
https://github.com/zed-industries/extensions/pull/307

Release Notes:

- Remove git_commit syntax highlighting from Zed core, `git-firefly` extension replaced that

Co-authored-by: William Desportes <williamdes@wdes.fr>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2024-03-07 20:23:44 +02:00
Kirpal Grewal
85e6bc94e9
Enable clippy::suspicious_to_owned (#9004)
Another small change: calling to owned on the `Cow` was cloning the
`Cow`, not its contents and so calling `clone` makes this more explicit
2024-03-07 11:30:40 -05:00
Yesterday17
105e654dce
Include font_features in cache key for fonts (#8928)
## Release Notes

- Fixed font ligatures not always respecting the setting
([#4313](https://github.com/zed-industries/zed/issues/4313)).

## Preview


![20240306133121_rec_-convert](https://github.com/zed-industries/zed/assets/8667822/dc2aaa00-41d0-4fe9-8d9c-80e1f047894d)
2024-03-07 11:06:19 -05:00
Max
6b8984279f
Pluralize and order user menu items for consistency (#9013)
Release Notes:

- N/A
2024-03-07 17:59:33 +02:00
Jason Lee
bc7fb9f253
Show tooltip with item paths for recent project picker items (#8987)
Before

![empty-tooltip](https://github.com/zed-industries/zed/assets/5518/4a00158c-5ae1-4ef9-8686-d4c188a99050)

After

![output](https://github.com/zed-industries/zed/assets/5518/b30f8272-485d-40e1-989a-facd122e96c8)

Release Notes:

- Fixed empty tooltip for recent projects picker items
2024-03-07 17:35:48 +02:00
Piotr Osiewicz
d450fde1ed language: Track buffer dirty state based on edits, not on file contents 2024-03-07 14:11:35 +01:00
Anthony Eid
4c9c9df730
Add ZED_SELECTED_TEXT variable to tasks (#8865)
Tasks are able to access a users selected text using the environment
variable "ZED_SELECTED_TEXT".

Release notes:

- Added ZED_SELECTED_TEXT task variable which contains contents of
selection
2024-03-07 11:59:25 +01:00
Piotr Osiewicz
3a9ec906af
task: make ZED_FILE return abs path, for real this time (#9000)
Release Notes:

- Fixed ZED_FILE environment variable containing a relative path, not an
absolute one.
2024-03-07 11:50:07 +01:00
Floyd Wang
01fe3eec4d
Fix project panel icon bouncing when renaming (#8988)
I found the project panel icon has a little bounce when I tried to
rename some files.

Release Notes:

- Fix project panel icon bouncing when renaming.

## Before



https://github.com/zed-industries/zed/assets/28998859/76f04c33-da68-40e2-9c83-045e78187679

**Set `buffer_line_height` to `standard`**


https://github.com/zed-industries/zed/assets/28998859/9a9eca93-5fda-4060-ba1d-0cd4e0486eb8



## After


https://github.com/zed-industries/zed/assets/28998859/29b49f1c-a9ae-4281-8921-8f1d8dd74262

**Set `buffer_line_height` to `standard`**


https://github.com/zed-industries/zed/assets/28998859/8f1ccbb5-fe0e-4905-97c4-cb7431e5dc46
2024-03-07 09:18:59 +01:00
Joseph T. Lyons
0a07746381 Delete tasks.md
Moved documentation to zed.dev
2024-03-07 01:08:20 -05:00
Joseph T. Lyons
026cdc617c Update tasks.md 2024-03-07 01:02:07 -05:00
Thorsten Ball
4238793d16
Add [x/]x to select larger/smaller syntax node in Vim (#8985)
`[x` will select the larger syntax node, `]x` the smaller one. Inspired
by https://github.com/tpope/vim-unimpaired.

Release Notes:

- Added `[x` and `]x` as default keybindings in Vim mode to select
larger and smaller syntax nodes respectively.
2024-03-07 06:53:17 +01:00
Conrad Irwin
1a9387035d
Only 5s of data! (#8983)
This is still 200Mb in production, and takes several minutes to process
and download.

Release Notes:

- N/A
2024-03-06 21:35:46 -07:00
Conrad Irwin
4f53e6e9a0 Update cargo.lock 2024-03-06 20:55:34 -07:00
Conrad Irwin
75a42c27db
Migrate from scrypt to sha256. (#8969)
This reduces the server time to compute the hash from 40ms to 5µs,
which should remove this as a noticable chunk of CPU time in production.

(An attacker who has access to our database will now need only 10^54
years of CPU time instead of 10^58 to brute force a token).

Release Notes:

- Improved sign in latency by 40ms.
2024-03-06 20:51:43 -07:00
Evren Sen
4d2156e2ad
Improved message hovering in chat panel (#8977)
Highlights messages on hover and fixed a more concise position for the
popover menu button.

Before:


https://github.com/zed-industries/zed/assets/146845123/39cab30f-659f-4164-a4ac-1dfee796e016

<img width="368" alt="Screenshot 2024-03-07 at 01 08 24"
src="https://github.com/zed-industries/zed/assets/146845123/74f41243-2dc2-4839-a733-9db3109e4665">

<img width="313" alt="Screenshot 2024-03-07 at 01 04 39"
src="https://github.com/zed-industries/zed/assets/146845123/f66c764d-488a-4303-b66e-f75835df6949">

After:


https://github.com/zed-industries/zed/assets/146845123/ac059c0d-7b16-4fd5-bbd7-ca96e1a6dfe1


<img width="368" alt="Screenshot 2024-03-07 at 01 09 42"
src="https://github.com/zed-industries/zed/assets/146845123/fa8940f6-52b4-489d-b0d3-d0e9443e2de2">

<img width="313" alt="Screenshot 2024-03-07 at 01 04 31"
src="https://github.com/zed-industries/zed/assets/146845123/850226f3-2c70-4a90-bb35-4a4cb0b7a219">


Thank you for the help @ConradIrwin and @RemcoSmitsDev !


Release Notes:
- Improved message hovering in chat panel
2024-03-06 20:47:19 -07:00
L
9481b346e2
Fix issue template formatting (#8866)
Release Notes:
- N/A

Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
2024-03-06 22:11:48 -05:00
Mikayla Maki
8a92d28663
Remove todo! comments (#8981)
Switching fully to normal `todo` style

Release Notes:

- N/A
2024-03-06 18:25:20 -08:00
Bennet Bo Fenner
8be4b4d75d
Support emoji shortcodes in chat (#8455)
Completes: https://github.com/zed-industries/zed/issues/7299

Suggestions


https://github.com/zed-industries/zed/assets/53836821/2a81ba89-4634-4d94-8370-6f76ff3e9403

Automatically replacing shortcodes without using the completions (only
enabled when `message_editor` > `auto_replace_emoji_shortcode` is
enabled in the settings):


https://github.com/zed-industries/zed/assets/53836821/10ef2b4b-c67b-4202-b958-332a37dc088e






Release Notes:

- Added autocompletion for emojis in chat when typing emoji shortcodes
([#7299](https://github.com/zed-industries/zed/issues/7299)).
- Added support for automatically replacing emoji shortcodes in chat
(e.g. typing "👋" will be converted to "👋")

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-03-06 19:18:29 -07:00
Mikayla Maki
c0edb5bd6c
GPUI custom window prompts (#8980)
This adds a GPUI fallback for window prompts. Linux does not support
this feature by default, so we have to implement it ourselves.

This implementation also makes it possible for GPUI clients to override
the platform prompts with their own implementations.

This is just a first pass. These alerts are not keyboard accessible yet,
does not reflect the prompt level, they're implemented in-window, rather
than as popups, and the whole feature need a pass from a designer.
Regardless, this gets us one step closer to Linux support :)

<img width="650" alt="Screenshot 2024-03-06 at 5 58 08 PM"
src="https://github.com/zed-industries/zed/assets/2280405/972ebb55-fd1f-4066-969c-a87f63b22a6f">

Release Notes:

- N/A
2024-03-06 18:15:06 -08:00
bbb651
c8e03ce42a
Wayland: Support integer scaling without wp_fractional_scale (#8886)
Release Notes:
- N/A

`DoubleBuffered` is not currently very necessary because we only care
about a single field `OutputState::scale` but I think it can be useful
for other objects as it's a fairly common pattern in wayland.
2024-03-06 18:13:23 -08:00
intigonzalez
74e7611ceb
windows: get current display size (#8916)
For the moment the windows port has a single display with hard-coded
values.

This first PR is just to at least fetch the **actual size of the current
display**. The idea
is using this code as a first template to start getting familar with the
code base
and prepare the work for enumerating all displays.
2024-03-06 18:12:44 -08:00
Conrad Irwin
0b87be71e6
Make anchor_in_excerpt Optional (#8975)
We were seeing panics due to callers assuming they had valid
excerpt_ids, but that cannot easily be guaranteed across await points as
anyone may remove an excerpt.

Release Notes:

- Fixed a panic when hovering in a multibuffer
2024-03-06 18:55:36 -07:00
Kirill Bulatov
ae5ec9224c
Small fixes to task modal & long commands (#8974)
* Show the entire task tooltip on terminal tab hover:
<img width="979" alt="Screenshot 2024-03-07 at 01 40 56"
src="https://github.com/zed-industries/zed/assets/2690773/bc274a5c-70f6-4f3d-87b4-04aff3594089">

* Scroll to the end of the query when a menu label is reused as a query:
<img width="658" alt="Screenshot 2024-03-07 at 01 41 03"
src="https://github.com/zed-industries/zed/assets/2690773/972857f4-36db-49dc-8fa1-dd15e0470660">

Release Notes:

- Improved task modal UX with long bash-like commands
2024-03-07 03:21:11 +02:00
Conrad Irwin
ca37d39109
add a script to get a flamegraph of collab in production (#8972)
Add `./script/collab-flamegraph` so you can profile in production (or
staging)

Release Notes:

- N/A
2024-03-06 16:39:48 -07:00
Max Brunsfeld
675ae24964
Add a command for building and installing a locally-developed Zed extension (#8781)
This PR adds an `zed: Install Local Extension` action, which lets you
select a path to a folder containing a Zed extension, and install that .
When you select a directory, the extension will be compiled (both the
Tree-sitter grammars and the Rust code for the extension itself) and
installed as a Zed extension, using a symlink.

### Details

A few dependencies are needed to build an extension:
* The Rust `wasm32-wasi` target. This is automatically installed if
needed via `rustup`.
* A wasi-preview1 adapter WASM module, for building WASM components with
Rust. This is automatically downloaded if needed from a `wasmtime`
GitHub release
* For building Tree-sitter parsers, a distribution of `wasi-sdk`. This
is automatically downloaded if needed from a `wasi-sdk` GitHub release.

The downloaded artifacts are cached in a support directory called
`Zed/extensions/build`.

### Tasks

UX

* [x] Show local extensions in the Extensions view
* [x] Provide a button for recompiling a linked extension
* [x] Make this action discoverable by adding a button for it on the
Extensions view
* [ ] Surface errors (don't just write them to the Zed log)

Packaging

* [ ] Create a separate executable that performs the extension
compilation. We'll switch the packaging system in our
[extensions](https://github.com/zed-industries/extensions) repo to use
this binary, so that there is one canonical definition of how to
build/package an extensions.

### Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-03-06 15:35:22 -08:00
Conrad Irwin
e273198ada
Debounce language server updates (#8953)
We'll send at least one every 100ms, but may send more if other messages
are sent on the connection.

Release Notes:

- Fixed some slowness when collaborating with verbose language servers.
2024-03-06 15:58:22 -07:00
Small White
af87fb98d0
Implement more GPUI services on windows. (#8940)
### Description

This is a part of #8809 , impl the following functions:

- `os_version`
- `local_timezone`
- `double_click_interval`
- `set_cursor_style`
- `open_url`
- `reveal_path`

Release Notes:
- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-03-06 12:48:43 -08:00
Andrew Lygin
effc317a06
Fix project panel scrolling position restoration (#8961)
Project panel loses the last scrolling position every time the user
hides/shows it. This PR fixes the problem.

The reason of the problem is that `UniformListScrollHandle`, which is
intended to store the scrolling position between redrawings, is only
used for ad-hoc autoscrollings to the list items, while the
`interactivity.scroll_handle` that is responsible for the scrolling
position, doesn't survive the project panel hiding.

How the problem looks:


https://github.com/zed-industries/zed/assets/2101250/7c7e3da6-9a9d-4f28-a181-ee9547349d4c

Release Notes:

- Fixed scrolling position restoration in the Project Panel.
2024-03-06 12:00:51 -08:00
Max Brunsfeld
6bbd09e28e
Emit the WorktreeUpdatedEntries event for all projects, not just local (#8963)
Fixes a regression introduced in
https://github.com/zed-industries/zed/pull/8846 (which hasn't yet been
released), in which the project panel didn't update correctly for remote
projects when collaborating.

Release Notes:

- N/A
2024-03-06 11:58:18 -08:00