Commit Graph

14054 Commits

Author SHA1 Message Date
Joseph T. Lyons
c58d72ea2b
Improve automatic indentation in Gleam code files (#8098)
Release Notes:

- Improved automatic indentation in Gleam code files
([#7295](https://github.com/zed-industries/zed/issues/7295)).
2024-02-20 23:55:42 -05:00
Joseph T. Lyons
58a5a1eb8f
Automatically indent the cursor when adding a newline after a { in Gleam code files (#8097)
Fixes: https://github.com/zed-industries/zed/issues/7295

Release Notes:

- Fixed a bug where adding a newline after a `{` would not automatically
indent the cursor in Gleam code files
([#7295](https://github.com/zed-industries/zed/issues/7295)).
2024-02-20 23:37:15 -05:00
gmorenz
cd640a87a9
Improve key handling on x11, sharing wayland implementation (#8094)
Makes keyboard shortcuts work on x11.

Release Notes:

- N/A
2024-02-20 16:04:52 -08:00
Kirill Bulatov
c97ecc7326
Add initial CI job for Windows target (#8088)
Clippy is disabled for now, due to many warnings in both `gpui` and
other code, see
https://github.com/zed-industries/zed/actions/runs/7980269779/job/21789529800
for more details.

Also, due to `#!/usr/bin/env bash` shebang in the `script/clippy`, it
starts in Windows CI with `shell: C:\Program Files\Git\bin\bash.EXE
-euxo pipefail {0}`

https://github.com/zed-industries/zed/actions/runs/7980269779/job/21789529800#step:4:3
It seems more appropriate to use PowerShell instead.

See `todo!("windows")` for all stubbed places currently.

Release Notes:

- N/A
2024-02-21 00:35:29 +02:00
Piotr Osiewicz
2ec910f772
Runnables: Add oneshot runnables (#8061)
/cc @SomeoneToIgnore 
Fixes #7460 and partially addresses #7108 
Release Notes:

- N/A
2024-02-20 23:13:09 +01:00
N
8a73bc4c7d
Vim: enable sending multiple keystrokes from custom keybinding (#7965)
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>
2024-02-20 15:01:45 -07:00
gmorenz
8f5d7db875
First pass at making a linux keymap (#8082)
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
2024-02-20 13:51:54 -08:00
Gabriel Dinner-David
389d26d974
Linux(Wayland): translate enter and pageup/down from keysym (#8089)
enter and pagedown/pageup weren't working now they do
Release Notes:
- N/A
2024-02-20 13:48:14 -08:00
Conrad Irwin
3d9503a454
Fix cx.windows() to return borrowed windows (#8086)
Fixes #8068

Release Notes:

- Fixed an error message when joining a project twice
([#8068](https://github.com/zed-industries/zed/issues/8068)).
2024-02-20 13:42:11 -07:00
Dzmitry Malyshau
b028231aea
linux/x11: disable Vulkan validation in Debug (#8044)
Turns out this validation requirement is confusing new users.

Release Notes:
- N/A
2024-02-20 11:14:13 -08:00
Andrew Lygin
f7d2cb1818
Project search bar layout improvements (#7963)
The PR matches project search layout with the recent changes in the
buffer project layout.

https://github.com/zed-industries/zed/assets/2101250/91b905ea-aed8-4740-9e60-67f3052885e2


Release Notes:

- Improve project search bar layout, match it with the buffer search bar ([7722](https://github.com/zed-industries/zed/issues/7722))
2024-02-20 21:07:01 +02:00
Robin Pfäffle
78dcd72790
Fix display of links in lists (markdown_preview) (#8073)
![markdown_preview](https://github.com/zed-industries/zed/assets/67913738/d8e4800f-d549-42e7-90b4-001d98aa39d2)

Release Notes:

- Fixed display of long links in lists not fully visible in markdown
preview.
2024-02-20 11:30:40 -07:00
Dzmitry Malyshau
d51a0b60be
linux/x11: send XCB requests asynchronously (#8045)
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.
2024-02-20 10:20:49 -08:00
Darren Schroeder
91b97387b6
bump tree-sitter-nu to latest (#8059)
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
2024-02-20 12:05:09 -05:00
Julia
0a40a21c74 Timeout while waiting for server to shutdown and kill it 2024-02-20 11:47:13 -05:00
Conrad Irwin
b14d576349
Follower simplification (#8026)
Release Notes:

- Improved reliability of following
2024-02-20 09:41:37 -07:00
Philipp Schaffrath
db0eaca2e5
Rename scrollbar_thumb to be consistent with other style properties (#8004)
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>
2024-02-20 11:26:09 -05:00
Thorsten Ball
80db468720
go: better logging if go install gopls fails (#8060)
Release Notes:

- Improved logging if installing `gopls` fails
2024-02-20 15:56:52 +01:00
Kirill Bulatov
0d2ad67b27
Add settings to configure terminal scroll limit (#8063)
Fixes https://github.com/zed-industries/zed/issues/7550
Also set maximum allowed to runnables' terminals.


Release Notes:

- Added settings to configure terminal scroll limit
([7550](https://github.com/zed-industries/zed/issues/7550))
2024-02-20 16:14:59 +02:00
Hourann
6c714c13b3
Fix markdown preview heading overflows no wrap (#8052)
![Kapture 2024-02-20 at 18 27
15](https://github.com/zed-industries/zed/assets/8416130/87d4dcea-e2f0-44ba-88a4-06829dbb0e89)

Release Notes:

- Improved markdown preview wrapping ([#8047](https://github.com/zed-industries/zed/issues/8047)).
2024-02-20 15:18:42 +02:00
Kirill Bulatov
c54d6aff6c Properly ignore missing/empty runnables config 2024-02-20 15:02:35 +02:00
Kirill Bulatov
48a6fb9e84
Fix runnables-related hickups (#8058)
* never error on absent/empty runnables file
* always activate terminal tab on runnable (re)schedule

Release Notes:

- N/A
2024-02-20 14:54:19 +02:00
Thorsten Ball
fc101c1fb3
Log when failed to deserialize response from language server (#8046)
This should probably help us debug when language servers don't start up
properly.

Release Notes:

- N/A
2024-02-20 10:16:00 +01:00
bbb651
4616d66e1d
Download right language server binary for OS (#8040)
Release Notes:

- Download right language server binary for OS
2024-02-20 09:53:03 +02:00
Bennet Bo Fenner
3ef8a9910d
chat: auto detect links (#8028)
@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>
2024-02-19 21:49:47 -07:00
Ben Hamment
1e44bac418
Add Ruby method visibility in outline view (#7954)
Release Notes:

- Improved ([#7849
](https://github.com/zed-industries/zed/issues/7849)).

<img width="897" alt="image"
src="https://github.com/zed-industries/zed/assets/7274458/a2b0db84-1971-45c0-a5a2-68de651e342b">
2024-02-19 19:26:04 -07:00
Remco Smits
aad7761038
Add an indicator to the channel chat to see all the messages that you missed (#7781)
This pull requests add the following features:
- Show indicator before first unseen message
- Scroll to last unseen message

<img width="241" alt="Screenshot 2024-02-14 at 18 10 35"
src="https://github.com/zed-industries/zed/assets/62463826/ca396daf-7102-4eac-ae50-7d0b5ba9b6d5">


https://github.com/zed-industries/zed/assets/62463826/3a5c4afb-aea7-4e7b-98f6-515c027ef83b

### Questions: 
1. Should we hide the indicator after a couple of seconds? Now the
indicator will hide when you close/reopen the channel chat, because when
the last unseen channel message ID is not smaller than the last message
we will not show it.

Release Notes:
- Added unseen messages indicator for the channel chat.
2024-02-19 19:20:02 -07:00
bbb651
0422d43798
Linux: Add support for MouseButton::Navigate in GPUI (wayland and x11) (#7996)
Release Notes:

- N/A

Based on wgpu implementation (which I wrote).

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-19 18:09:53 -08:00
Dzmitry Malyshau
b00b65b330
linux/x11: implement window focus (#8002)
Release Notes:
- N/A
2024-02-19 17:54:54 -08:00
Janrupf
fddb778e5f
Enable server side decorations on wayland (#8037)
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.
2024-02-19 17:53:31 -08:00
白山風露
77974a4367
Stubbing unix-dependent values on Windows (#8036)
Release Notes:

- N/A
2024-02-19 17:41:35 -08:00
白山風露
0037f0b2fd
Avoid dependencies build errors on Windows (#7827)
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
2024-02-19 16:44:24 -08:00
Abdullah Alsigar
f4bafd5899
Dart support (#7220)
This is my first contribution, feedback is welcome.

Release Notes:

- Added Dart language support
([#5343](https://github.com/zed-industries/zed/issues/5343)).
2024-02-19 11:10:08 -08:00
Piotr Osiewicz
b3d3a00a14 chore: Add missing LICENSE-GPL files 2024-02-19 18:40:41 +01:00
Thorsten Ball
0a5df7d597
Fix jk not working in Vim bindings (#8023)
Fixes #8006.

Release Notes:

- Fixed two-character bindings in Vim insert mode (e.g. `j k` or `j j`)
not working.
([#8006](https://github.com/zed-industries/zed/issues/8006))

Co-authored-by: Conrad <conrad@zed.dev>
2024-02-19 10:21:07 -07:00
Conrad Irwin
4d1585b917
Don't drop key bindings (#8019)
Fixes: #7748



Release Notes:

- Fixed a bug where keystrokes could be lost after focus changes
([#7748](https://github.com/zed-industries/zed/issues/7748)).

Co-authored-by: Antonio <as-cii@zed.dev>
2024-02-19 10:20:51 -07:00
Kirill Bulatov
99559f3975 Add another runnables_ui/Cargo.toml field to satisfy license checks 2024-02-19 19:14:00 +02:00
Kirill Bulatov
5783497c21 Add missing license field to runnables_ui 2024-02-19 19:04:40 +02:00
Kirill Bulatov
e27c2fc946
Fix seed-db script by passing it the correct admin file path (#8022)
Release Notes:

- N/A
2024-02-19 18:53:17 +02:00
Piotr Osiewicz
f17d0b5729
Add static Runnables (#8009)
Part of #7108

This PR includes just the static runnables part. We went with **not**
having a dedicated panel for runnables.
This is just a 1st PR out of N, as we want to start exploring the
dynamic runnables front. Still, all that work is going to happen once
this gets merged.

Release Notes:

- Added initial, static Runnables support to Zed. Such runnables are defined in
`runnables.json` file (accessible via `zed: open runnables` action) and
they can be spawned with `runnables: spawn` action.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Pitor <pitor@zed.dev>
Co-authored-by: Beniamin <beniamin@zagan.be>
2024-02-19 18:41:43 +02:00
Antonio Scandurra
ca251babcd
Drop Box<dyn PlatformWindow> when the OS closes the native window (#8016)
Closes #7973 

This fixes a leak in GPUI when the user didn't override
`on_should_close_window`.

Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-02-19 15:38:50 +01:00
Bennet Bo Fenner
c33efe8cd0
recent projects: cleanup ui (#7528)
As the ui for the file finder was recently changed in #7364, I think it
makes sense to also update the ui of the recent projects overlay.

Before:

![image](https://github.com/zed-industries/zed/assets/53836821/8a0f5bef-9b37-40f3-a974-9dfd7833cc71)

After:

![image](https://github.com/zed-industries/zed/assets/53836821/7e9f934a-1ac3-4716-b7b6-67a7435f3bde)


Release Notes:

- Improved UI of recent project overlay
2024-02-19 14:37:52 +02:00
Tadeo Kondrak
2b56c43f2d
Wayland: Keyboard input improvements (#7989)
Release Notes:

- N/A

---

Right now the Wayland backend is using `xkb::State::key_get_utf8` as the
`key`, when it should be used as the `ime_key`. It also manages
pressing/releasing modifiers manually when this should be managed by the
display server.

This allows modifier combinations to work in more cases, making it an
alternative to https://github.com/zed-industries/zed/pull/7975, which
interprets what is now only used as the `ime_key` value as a `key`
value.
2024-02-18 21:25:42 -08:00
Roman
bd137b01ad
Wayland fractional scaling (#7961)
This PR adds support for fractional scaling on Wayland.

Release Notes:

- N/A
2024-02-18 21:22:03 -08:00
Dzmitry Malyshau
4e1e26b696
blade: Fix initialization of atlas textures used for path rasterization (#8000)
Generally the BladeAtlas logic has been deferring all the texture
initializations and updates till `begin_frame`. This doesn't work for
path rasterization, since a texture needs to be allocated after
`begin_frame` and used immediately.

Fixed validation error:
> UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout(ERROR / SPEC):
msgNum: 1303270965 - Validation Error: [
UNASSIGNED-CoreValidation-DrawState-InvalidImageLayout ] Object 0:
handle = 0x60ce301b9010, name = main, type =
VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0x51820000000007b,
name = atlas, type = VK_OBJECT_TYPE_IMAGE; | MessageID = 0x4dae5635 |
vkQueueSubmit(): pSubmits[0].pCommandBuffers[0] command buffer
VkCommandBuffer 0x60ce301b9010[main] expects VkImage
0x51820000000007b[atlas] (subresource: aspectMask 0x1 array layer 0, mip
level 0) to be in layout VK_IMAGE_LAYOUT_GENERAL--instead, current
layout is VK_IMAGE_LAYOUT_UNDEFINED.
    Objects: 2
        [0] 0x60ce301b9010, type: 6, name: main
        [1] 0x51820000000007b, type: 10, name: atlas

Release Notes:
- N/A
2024-02-18 21:18:59 -08:00
d1y
12b12ba17a
Add syntax highlighting and LSP for Dockerfiles(#6905) (#7977)
Release Notes:

- Added Dockerfile syntax highlighting and LSP support

---------

Co-authored-by: Bryce Palmer <bpalmer@redhat.com>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2024-02-18 20:44:54 +02:00
d1y
8acd4d122e
Fix git_commit grammar name typo (#7982)
Release Notes:

- Fixed git_commit highlights not working
2024-02-18 20:40:56 +02:00
Thorsten Ball
251218954d
Add editor::OpenUrl action and bind to gx in Vim mode (#7972)
This adds one feature I've been missing a lot in Vim mode: `gx` to open
the URL under the cursor.

Technically, in Vim, `gx` opens more "paths", not just URLs, but I think
this is a good start.

Release Notes:

- Added `gx` to Vim mode to open the URL under the cursor.

Demo:


https://github.com/zed-industries/zed/assets/1185253/6a19490d-b61d-40b7-93e8-4819599f6977
2024-02-18 18:52:50 +01:00
Marshall Bowers
b91d6da6b6
Remove Beancount as a built-in language (#7934)
This PR removes Beancount as a built-in language, as it is now available
as an [extension](https://github.com/zed-extensions/beancount).

Release Notes:

- Removed built-in support for Beancount, as it is now provided by an
[extension](https://github.com/zed-extensions/beancount).
2024-02-18 09:58:12 -05:00
Aleksei Trifonov
a041e07c99
Hide Inline Assist button if assistant.button is disabled (#7932)
This PR adds check for `assistant.button` setting in quick bar, to hide
it when the setting is set to false. It seems that the setting can be a
separate one, I would be happy to add it if needed.

Release Notes:

- Improved `assistant.button` setting so that `Inline Assist` button in
editor quick bar is also hidden
([#4500](https://github.com/zed-industries/zed/issues/4500)).
2024-02-18 08:14:08 +02:00
Andrew Lygin
6d9b8cc595
Clear search results on invalid query input (#7958)
Fixes a bug in the buffer search bar: Clears results of a previous
successfull search when the user enters invalid search request.

Steps to reproduce the bug:
1. Switch to Regex search mode.
2. Enter a valid search query that produces several matches.
3. Add a symbol to the search query that makes it an invalid regexp.
4. Switch to the editor and walk through the code back and forth.

Expected result: All the match highlightings after step 2 are cleared,
search bar indicates absence of the last search matches.

Actual: The results from the last valid search are highlighted, search
bar indicates presence of matches.

Potentially, the same effect may occur when searching in the simple text
mode, or when clearing the search query in some circumstances, so I made
the fix for all those cases, though I wasn't able to reproduce them
manually.

The bug:


https://github.com/zed-industries/zed/assets/2101250/1c50b98c-ae8e-4a9c-8ff5-1e5c63027ec3

After the fix:


https://github.com/zed-industries/zed/assets/2101250/e3eedf8c-2e3e-41ee-81cc-c2c9d919fba3

Release Notes:
- Clear search results on invalid query input
2024-02-18 08:01:06 +02:00
Conrad Irwin
4c781b6455
vim netrw (#7962)
- Tidy up vim netrw bindings (c.f.
https://github.com/zed-industries/zed/issues/4270,
https://github.com/zed-industries/zed/pull/7757)
- Add vim commands for panels

Release Notes:

- vim: add commands to toggle panels `:E[xplore]`, `:C[ollab]`,
`:Ch[at]`, `:N[otification]`, `:A[I]`, `:te[rm]` (or `:T[erm]`).
2024-02-17 13:36:08 -07:00
vultix
8aa5319210
Add documentation to many core editor types (#7919)
Hopefully this makes it a bit easier for new contributors to dive into
the codebase :)

Release Notes:

- Improved documentation for many core editor types

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2024-02-17 09:03:05 -07:00
evrsen
98ffdca32e
Add locale-based time formatting in the chat panel (#7945)
This commit addresses the issue of time formats displayed in the chat
panel. Previously, the time was always displayed in a 12-hour format,
regardless of the user's locale. The `format_timestamp` function has
been updated to check the system locale and format the time accordingly.


Release Notes:
- Fixed time formatting in the chat panel to be locale based.
2024-02-17 08:44:28 -07:00
claytonrcarter
cd4d2f7900
Add Prettier support for Vue, Markdown and PHP (#7904)
Current prettier support w/i Zed leaves out a few languages that are
officially supported by prettier. In particular, Vue and Markdown are
supported by the core prettier project, and PHP is supported via an
official plugin. I didn't see any open issues for this, but I have been
wondering for months why `"formatter": "prettier"` wasn't working on my
PHP files. Now that Zed is open source, I was able to find out why, and
fix it. 😄

I have been using this with PHP files daily for a week+ now, and I have
also used it successfully with Vue and Markdown files, though not as
extensively. I looked around and did not see any tests for specific
prettier language integrations, but if I missed them please let me know
and I'll add some tests.

**Notes**
- I did not add support for Ruby (which has an official prettier plugin)
because it seems to require some external dependencies (notably, Rudy
and some Gems). When those are present on the system and `$PATH`,
prettier will will work just fine on Ruby files if the plugin is set up
similar to how the PHP plugin is set up (I tried it), and I can add that
in here, if desired. The PHP plugin is pure JS (as I recall) and doesn't
have this issue.
- I did *not* add support for languages that have "community" plugins,
though I do note that Zed already ships with prettier support for svelte
enabled, which – if I understand correctly – is powered by a community
plugin. If desired, I could look at adding support/configuration to
enable prettier support for things like elm, erb, glsl, bash, toml.
Bash, in particular, *I* would find useful. 😄

Release Notes:

- Added prettier support for Vue, Markdown and PHP
2024-02-17 11:35:31 +02:00
Robin Pfäffle
43a845cbbf
Add default settings to display Svelte inlay hints (#7943)
Fixes: #7913.

Release Notes:

- Added default settings for Svelte language server to display inlay
hints ([#7913](https://github.com/zed-industries/zed/issues/7913)).
2024-02-17 11:33:05 +02:00
Marshall Bowers
3cbc18895a
Upgrade toml to v0.8 (#7931)
This PR upgrades our `toml` dependency to v0.8.

I noticed that our current version of `toml` wasn't able to parse
certain kinds of documents involving enums, whereas the newer version
can.

Release Notes:

- N/A
2024-02-16 17:43:40 -05:00
Roman
f82b2741cd
Wayland input handling (#7857)
Adds initial keyboard and mouse input for Wayland (thanks to @gabydd and
@kvark for reference).


Release Notes:

- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-16 13:49:34 -08:00
Dzmitry Malyshau
9ad1862f2f
Enable Blade on MacOS via "macos-blade" feature (#7669)
Depends on https://github.com/zed-industries/font-kit/pull/2 and
https://github.com/kvark/blade/pull/77

This change enables Blade to be also used on MacOS. It will also make it
easier to use it on Windows.

What works: most of the things. Zed loads as fast and appears equally
responsive to the current renderer.
<img width="306" alt="Screenshot 2024-02-11 at 12 09 15 AM"
src="https://github.com/zed-industries/zed/assets/107301/66d82f45-5ea2-4e2b-86c6-5b3ed333c827">

Things missing:
- [x] video streaming. ~~Requires a bit of plumbing on both Blade and
Zed sides, but all fairly straightforward.~~
  -  verified with a local setup
- [x] resize. ~~Not sure where exactly to hook up the reaction on the
window size change. Once we know where, the fix is one line.~~
- [ ] fine-tune CA Layer
- this isn't a blocker for merging the PR, but it would be a blocker if
we wanted to switch to the new path by default
- [ ] rebase on latest, get the dependency merged (need review/merge of
https://github.com/zed-industries/font-kit/pull/2!)

Update: I implemented resize support as well as "surface" rendering on
the Blade path (which will be useful on Linux/Windows later on). I
haven't tested the latter though - not sure how to get something
streaming. Would appreciate some help! I don't think this should be a
blocker to this PR, anyway.

The only little piece that's missing for the Blade on MacOS path to be
full-featured is fine-tuning the CALayer configuration. Zed does a lot
of careful logic in configuring the layer, such as switching the
"present with transaction" on/off intermittently, which Blade path
doesn't have yet.

Release Notes:
- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-02-16 13:39:40 -08:00
Mikayla Maki
1c361ac579
Remove comment (#7922)
Per https://github.com/zed-industries/zed/pull/7814, this is more
trouble than it's worth. As these functions are never exposed to the
user of GPUI, we can just manually audit and enforce the relevant rules.

Release Notes:

- N/A
2024-02-16 10:39:50 -08:00
Rom Grk
bea36918f4
Linux: file dialogs (#7852)
This PR implements linux file dialogs and open/reveal actions.

| Open folder | Reveal path |
| --- | --- |
| ![Screenshot from 2024-02-15
16-50-49](https://github.com/zed-industries/zed/assets/1423607/b4260574-d841-4ded-821d-521f507916d1)
| ![Screenshot from 2024-02-15
16-51-36](https://github.com/zed-industries/zed/assets/1423607/1f32f451-7def-423a-9d69-de2876285b60)
|

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-16 10:34:54 -08:00
Conrad Irwin
43e8fdbe82
Fix a missing follower update on re-activate (#7918)
This could cause following to get into a bad state temporarily

Release Notes:

- Fixed a bug around following if the follow started while the workspace
was inactive.
2024-02-16 11:33:49 -07:00
Antonio Scandurra
5df1318e75
Don't use stale layout when view cache is invalidated in GPUI (#7914)
When a view is invalidated, we want to participate in Taffy layout with
an accurate style rather than the dummy style we use when a view is
cached. Previously, we only detected invalidation during paint. This
adds logic to layout as well to avoid using the dummy style when dirty.

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-02-16 19:06:11 +01:00
Joseph T. Lyons
577b244b03
Add button link to extension repository (#7880)
Fixes: https://github.com/zed-industries/zed/issues/7873

<img width="1165" alt="image"
src="https://github.com/zed-industries/zed/assets/19867440/2338519c-bd48-4716-9f88-ed155b0dad67">

Release Notes:

- Added a button to link to an extension's repository
2024-02-16 11:49:05 -05:00
Max Brunsfeld
2e0d18ee76
Don't support cloning the extensions view (#7875)
Fixes https://github.com/zed-industries/zed/issues/7840

We could support this later, but for now, I don't think we need to.

Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>
2024-02-16 11:48:47 -05:00
Marshall Bowers
c5a23faf7c
Fall back to One themes if the selected theme doesn't exist (#7911)
This PR makes it so the One themes—One Dark and One Light—are used as a
fallback when trying to reload a theme that no longer exists in the
registry.

This makes it so when an extension providing the current theme is
removed, the active theme will change to either One Dark or One Light
(based on the system appearance) instead of retaining a cached version
of the theme.

Release Notes:

- Changed the behavior when uninstalling a theme to default to One Dark
or One Light (based on system appearance) rather than keeping a cached
version of the old theme.
2024-02-16 11:28:34 -05:00
Subash Chandra Sapkota
07c7778cff
Add cancel button on GitHub Copilot actions (#7850)
Release Notes:

- Added cancel button on Copilot actions
([#6878](https://github.com/zed-industries/zed/issues/6878)).

Here is the screenshot of the UI change:

<img width="545" alt="Screenshot 2024-02-15 at 13 00 53"
src="https://github.com/zed-industries/zed/assets/29421465/7a4e1641-1822-47ad-819e-f3d83bc3cc74">
2024-02-16 10:45:55 -05:00
Antonio Scandurra
aa6926e57a
Revert "Upgrade to Taffy 0.4" (#7896)
Reverts zed-industries/zed#7868

@nicoburns: this seems to break text input in the chat panel, so
reverting this for now.

<img width="365" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/fc47eee9-6049-49c2-be2c-fb91f7d35caf">

It would be great to upgrade to Taffy 0.4 though, so we should figure
out why that particular input breaks.

Release notes:

- N/A
2024-02-16 14:30:31 +01:00
Thorsten Ball
ae577c9d5c
Highlight escape sequences in TypeScript/JavaScript (#7892)
Ran into this while hacking on TypeScript/React/TSX...

Release Notes:


- N/A

![screenshot-2024-02-16-07 03
56@2x](https://github.com/zed-industries/zed/assets/1185253/e6725a1e-7653-4316-abd0-280ea8818d66)
2024-02-16 09:12:39 +01:00
Marshall Bowers
4310b0b8de
Replace full with size_full (#7888)
This PR removes the `full` style method and replaces it with
`size_full`, as the two do the same thing.

This is the generated code for `size_full`:

```rs
#[doc = "Sets the width and height of the element.\n\n100%"]
fn size_full(mut self) -> Self {
    let style = self.style();
    style.size.width = Some((gpui::relative(1.)).into());
    style.size.height = Some((gpui::relative(1.)).into());
    self
}
```

Release Notes:

- N/A
2024-02-15 22:26:49 -05:00
Marshall Bowers
ab6b9196e1
Fix Cargo.toml formatting (#7886)
This PR disables the formatting for `.toml` files within the Zed repo,
as the formatter provided by the TOML language server messes things up.

Release Notes:

- N/A
2024-02-15 21:54:43 -05:00
Marshall Bowers
ef551cedef
Add CheckboxWithLabel component (#7881)
This PR builds on top of #7878 by adding a general-purpose
`CheckboxWithLabel` component to use for checkboxes that have attached
labels.

This component encompasses the functionality of allowing to click on the
label to toggle the value of the checkbox.

There was only one other occurrence of a checkbox with a label—the
"Public" checkbox in the channel management modal—and this has been
updated to use `CheckboxWithLabel`.

Resolves #7794.

Release Notes:

- Added support for clicking the label of the "Public" checkbox in the
channel management modal to toggle the value
([#7794](https://github.com/zed-industries/zed/issues/7794)).
2024-02-15 21:00:30 -05:00
Marshall Bowers
9ef83a2557
Make the labels of the checkboxes on the welcome screen clickable (#7878)
This PR makes the labels of the checkboxes on the welcome screen
clickable.

Release Notes:

- Added support for clicking the labels of the checkboxes on the welcome
screen to toggle the value
([#7794](https://github.com/zed-industries/zed/issues/7794)).
2024-02-15 20:37:31 -05:00
Vishal Bhavsar
96dcc385dd
vim: Implement Go To Previous Word End (#7505)
Activated by keystrokes g-e.



Release Notes:

- vim: Added `ge` and `gE` for go to Previous Word End.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-02-15 16:15:31 -07:00
Marshall Bowers
e6766e102e
Return descriptions for extensions (#7869)
This PR updates the extensions API to return descriptions for
extensions.

Release Notes:

- N/A
2024-02-15 17:43:47 -05:00
Nico Burns
694e18417e
Upgrade to Taffy 0.4 (#7868)
Upgraded Taffy to v0.4.0 from crates.io (previously using prerelease
version from git).

Code changes required were minor as gpui was already using a recent
version of Taffy.

Release Notes:

- N/A
2024-02-15 14:30:39 -08:00
Joey Smith
94426c4393
Better logic for copying themed player colors into registry (#7867)
Release Notes:

- Fixed a potential panic when themes did not contain enough player
colors ([#7733](https://github.com/zed-industries/zed/issues/7733)).

Thanks to @maxdeviant for the code review and improvements!
2024-02-15 17:22:23 -05:00
Marshall Bowers
bf1bcd027c
Secondarily sort by extension name instead of ID (#7866)
This PR makes it so extensions are secondarily sorted by their name
(instead of by ID) after we sort them by their download count.

Release Notes:

- N/A
2024-02-15 16:51:41 -05:00
Marshall Bowers
23132b5ab1
Display extension download counts (#7864)
This PR adds the download count for extensions to the extensions view.

Release Notes:

- Added download counts for extensions to the extensions view.
2024-02-15 16:41:54 -05:00
Conrad Irwin
a8d5864524
Fix panic when loading hover state. (#7861)
Release Notes:

- Fixed a panic when hovering over an identifier in the editor
2024-02-15 14:20:10 -07:00
Conrad Irwin
ea322e1d1c
Add "code_actions_on_format" (#7860)
This lets Go programmers configure `"code_actions_on_format": {
  "source.organizeImports": true,
}` so that they don't have to manage their imports manually

I landed on `code_actions_on_format` instead of `code_actions_on_save`
(the
VSCode version of this) because I want to run these when I explicitly
format
(and not if `format_on_save` is disabled).

Co-Authored-By: Thorsten <thorsten@zed.dev>

Release Notes:

- Added `"code_actions_on_format"` to control additional formatting
steps on format/save
([#5232](https://github.com/zed-industries/zed/issues/5232)).
- Added a `"code_actions_on_format"` of `"source.organizeImports"` for
Go ([#4886](https://github.com/zed-industries/zed/issues/4886)).

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-02-15 14:19:57 -07:00
Max Brunsfeld
e1ae0d46da
Add an extensions API to the collaboration server (#7807)
This PR adds a REST API to the collab server for searching and
downloading extensions. Previously, we had implemented this API in
zed.dev directly, but this implementation is better, because we use the
collab database to store the download counts for extensions.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>
2024-02-15 12:53:57 -08:00
Kirill Bulatov
bdc2558eac
Add default language server settings to display inlay hints for Go and TypeScript (#7854)
Hints are still disabled by default in Zed, but when those get enabled,
the language server settings allow to display those instantly without
further server configuration, which might be not obvious. Also add the
documentation enties for those settings and their defaults in Zed.

Closes https://github.com/zed-industries/zed/issues/7821

Release Notes:

- Added default settings for TypeScript and Go LSP servers to enable
inlay hints when those are turned on in Zed
([7821](https://github.com/zed-industries/zed/issues/7821))
2024-02-15 22:01:49 +02:00
Dzmitry Malyshau
a41fb29e01
Linux/x11 input handling (#7811)
Implements the basics of keyboard and mouse handling.
Some keys will need special treatment, like Backspace/Delete. In this
PR, all keys are treated as append-only. Leaving this for a follow-up.

I used @gabydd 's branch as a reference (thank you!) as well as
https://github.com/xkbcommon/libxkbcommon/blob/master/doc/quick-guide.md
For future work, I'll also use
https://github.com/xkbcommon/libxkbcommon/blob/master/tools/interactive-x11.c

All commits are separately compileable and reviewable.

Release Notes:
- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-15 11:58:47 -08:00
Andrew Lygin
aa319ccfd0
Fix buffer search invalid regexp indicator (#7795)
This PR fixes the issue with invalid regexp highlighting (red border)
when switching to the simple text searching mode (#7658).

Implementation details:

- `update_matches()` always relied on the caller to reset the
`query_contains_error` flag, which wasn't always the case. Now, it
resets the flag itself.

Release Notes:

- Fix issue with switching between invalid regexp and simple text buffer
search (#7658).

How it works now:


https://github.com/zed-industries/zed/assets/2101250/ac868a5d-5e2f-49a0-90fc-00e62a1d5ee8
2024-02-15 13:33:26 -05:00
Michal Příhoda
f01763a1fa
Allow both integer and string request IDs in LSP (#7662)
Zed's LSP support expects request messages to have integer ID, Metals
LSP uses string. According to specification, both is acceptable:

interface RequestMessage extends Message {

	/**
	 * The request id.
	 */
	id: integer | string;

...
This pull requests modifies the types and serialization/deserialization
so that string IDs are accepted.

Release Notes:

- Make Zed LSP request ids compliant to the LSP specification
2024-02-15 20:26:23 +02:00
Thorsten Ball
2dffc5f6e1
Fix case-only renaming of files in project panel (#7835)
This is a follow-up to #7768 but now also fixes #5211.

Explanation is relatively simple: case-only renames previously failed
because while Zed would think that `foobar` and `FOOBAR` are different,
the filesystem would give us an file-already-exists error when renaming.

So what we're doing here is to check whether we're on a case-insensitive
filesystem and if so, we overwrite the old file.

Release Notes:

- Fixed case-only renaming of files in project panel.
([#5211](https://github.com/zed-industries/zed/issues/5211)).

Proof:



https://github.com/zed-industries/zed/assets/1185253/57d5063f-09d9-47b1-a2df-3d7edefca97d
2024-02-15 19:07:10 +01:00
Thorsten Ball
ed791c4fc1
Improve ruby highlighting (#7829)
Release Notes:

- Improved syntax-highlighting of identifiers in Ruby.

Before:

![screenshot-2024-02-15-14 40
19@2x](https://github.com/zed-industries/zed/assets/1185253/29fca0eb-7c0c-4aee-9f31-a8a3c6680cb9)

After:

![screenshot-2024-02-15-14 40
56@2x](https://github.com/zed-industries/zed/assets/1185253/2ce0e0c9-8689-4ff8-9f40-2ea5f6ccc2f6)
2024-02-15 15:12:41 +01:00
Kirill Bulatov
7c6b34cb73
Close modals and menus before dispathing actions (#7830)
Fixes https://github.com/zed-industries/zed/issues/7799 by forcing the
modal to close before dispatching the action.
While not needed specifically for this case, changed the context menus
to do the same, to be uniform — context menu actions seem to work
properly after this change too.

Release Notes:

- Fixed markdown preview action not working
([7799](https://github.com/zed-industries/zed/issues/7799))
2024-02-15 15:57:32 +02:00
Thorsten Ball
3921259b6c
Extend Ruby word characters to include valid identifier chars (#7824)
In Ruby `_$=@!:?` can all be part of an identifier. If we don't have
them in this list, autocomplete doesn't work as expected.

See: https://gist.github.com/misfo/1072693

This fixes one part of #7819 but not the whole ticket.

Release Notes:

- Fixed completions in Ruby not working for identifiers that start or
end with special characters (e.g.: `@`)
2024-02-15 14:25:18 +01:00
Roman
41372a96ed
Linux: Fix x11 crash (#7805)
Release Notes:

- N/A
2024-02-14 16:03:03 -08:00
Roman
f62baeda64
gpui: Add Wayland support (#7664)
This PR adds Wayland support to gpui using
[wayland-rs](https://github.com/Smithay/wayland-rs). It is based on
[#7598](https://github.com/zed-industries/zed/pull/7598).

It detects Wayland support at runtime by checking the existence of the
`WAYLAND_DISPLAY` environment variable. If it does not exist or is
empty, the X11 backend will be used. To use the X11 backend in a Wayland
session (for development purposes), you just need to unset
WAYLAND_DISPLAY (`WAYLAND_DISPLAY= cargo run ...`).

At the moment it only creates the window and renders the initial content
provided by `BladeRenderer`, so it can run "Hello world" example.


![image](https://github.com/zed-industries/zed/assets/40907255/1655bc64-4d36-4178-9851-bfe42f03f716)

Todo:
- [x] Add basic Wayland support.
- [x] Add window resizing.
- [x] Add window closing.
- [x] Add window updating.
- [ ] Implement input handling, fractional scaling, and support other
Wayland protocols.
- [ ] Implement all unimplemented todo!(linux).
- [ ] Add window decorations or use custom decorations (like on MacOS).
- [ ] Address other missing functionality.

Release Notes:
- N/A

---------

Co-authored-by: gabydd <gabydinnerdavid@gmail.com>
Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-14 14:50:11 -08:00
Conrad Irwin
8e52cf1495
Add netrw bindings for vim (#7757)
This is now possible after #7647

Release Notes:

- Added vim bindings for project panel
([#4270](https://github.com/zed-industries/zed/issues/4270)).
2024-02-14 14:38:07 -07:00
Conrad Irwin
65a1938e52
panics (#7793)
Release Notes:

- Fix a panic in rename
([#7509](https://github.com/zed-industries/zed/issues/7509)).

---------

Co-authored-by: Max <max@zed.dev>
2024-02-14 14:36:40 -07:00
Conrad Irwin
855acb948c
drop columns (#7742)
Blocked on: #7741

Release Notes:

- N/A
2024-02-14 14:30:48 -07:00
Leon
54f82eb166
Add double quote wrap in activate_python_virtual_environment (#7787)
Added double quote wrap in activate_python_virtual_environment to handle
spaces in path.
Would fail to find venv activate script when spaces exist.


Release Notes:

- Fixed venv_detection activation not finding directory if space is in
the path

![image](https://github.com/zed-industries/zed/assets/52263845/9bf95b92-c6d4-4e2c-9158-d91a41c10216)


- With changes

![image](https://github.com/zed-industries/zed/assets/52263845/93602ae7-d991-494b-89c3-5afcce556888)
2024-02-14 12:42:06 -08:00
Dzmitry Malyshau
8f7a26f397
X11: Continuous Presentation (#7762)
Alternative to #7758, which doesn't involve adding a new trait method
`request_draw`.
Somehow, my whole screen goes blinking black with this when moving the
window, so not ready for landing.

Release Notes:
- N/A

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-02-14 12:24:12 -08:00
Joseph T. Lyons
16849f48e6 v0.124.x dev 2024-02-14 13:10:07 -05:00
Marshall Bowers
b14fbd4ddc
Fix extension list scrolling and add loading and empty states (#7782)
This PR fixes the scrolling of the extension list, as well as adds
various empty and loading states.

Release Notes:

- N/A
2024-02-14 12:47:58 -05:00
Thorsten Ball
b47aff4c14
go: enable completions with placeholders by default (#7780)
This fixes #7523 by enabling completions with placeholders by default.

This setting controls whether gopls sends back snippets with
placeholders. According to the documentation
(https://github.com/golang/tools/blob/master/gopls/doc/settings.md#useplaceholders-bool)
this only controls whether "placeholders for function parameters or
struct fields" are sent in completion responses.

In practice, though, this seems to also control whether any snippets
with *any* placeholders are being sent back.

Example: for the given Go code

    err := myFunction()
    i^

With the cursor being at `^`, this setting controls whether `gopls`
sends back statement snippets such as `if err != nil { return ... }`
with the `...` being dynamically matched to the return value of the
function.

So I think this setting controls far more than just function params and
struct fields. And since we *do* support placeholders in snippets, I
think this provides a better default experience.

Release Notes:

- Improved default Go experience by enabling snippets-with-placeholders
when initializing `gopls`.
([#7523](https://github.com/zed-industries/zed/issues/7523)).
2024-02-14 18:29:42 +01:00