Commit log

b0d89d6 Fix jetbrains keymap alt-enter to do `search::SelectAllMatches` (#11951)

Click to expand commit body
The default keymap uses alt-enter for `SelectAllMatches` for `context:
BufferSearchBar`.

Jetbrains keymap uses alt-enter for `ToggleCodeActions` for `context:
Editor`.

When focusing on search bar, currently alt-enter does not perform
`SelectAllMatches`, whereas `ToggleCodeActions` is triggered instead,
because search bar's text input element has `context: Editor
mode=single_line`.

This PR restricts `ToggleCodeActions` to `Editor (full mode)` context to
allow `SelectAllMatches` to be triggered for alt-enter when the search
bar is active.

Release Notes:

- Fixed alt-enter with JetBrains keymap ignoring `search::SelectAllMatches` in certain contexts ([11840](https://github.com/zed-industries/zed/issues/11840))

Congyu created

d116f3c Use checked `str` slices in `Rgba::TryFrom<str>` (#12097)

Click to expand commit body
Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>

bbb651 and Kirill Bulatov created

70e8737 Allow information popovers while showing autocomplete suggestions (#12157)

Click to expand commit body
Allows information popovers to display while autocomplete suggestions
are also being displayed.

Before: 


https://github.com/zed-industries/zed/assets/50590465/a61f0b4e-1521-42de-84fd-c5a3586b74ab

After:


https://github.com/zed-industries/zed/assets/50590465/ad2daae7-aebc-4c71-ad4c-f9d2deb6d0d0

Release Notes:
- Allow hover and completion popovers to appear at the same time ([12152](https://github.com/zed-industries/zed/issues/12152))

Ephram created

b9697fb Enable manual worktree organization (#11504)

Click to expand commit body
Release Notes:

- Preserve order of worktrees in project
([#10883](https://github.com/zed-industries/zed/issues/10883)).
- Enable drag-and-drop reordering for project worktrees

Note: worktree order is not synced during collaboration but guests can
reorder their own project panels.

![Reordering
worktrees](https://github.com/zed-industries/zed/assets/1347854/1c63d83c-5d4e-4b55-b840-bfbf32521b2a)

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>

Elliot Thomas and Kirill Bulatov created

1e5389a rust: Add runnable icon for `#[cfg(test)] mod tests` (#12017)

Click to expand commit body
This allows you to run all the tests inside the `mod tests` block. 
Fixes #11967.

<img width="366" alt="Screenshot 2024-05-18 at 16 07 32"
src="https://github.com/zed-industries/zed/assets/62463826/01fc378c-1546-421d-8250-fe0227c1e5a0">

<img width="874" alt="Screenshot 2024-05-18 at 16 37 21"
src="https://github.com/zed-industries/zed/assets/62463826/4a880b91-df84-4917-a16e-5d5fe20e22ac">

Release Notes:

- Added runnable icon for Rust `#[cfg(test)] mod tests` blocks
([#11967](https://github.com/zed-industries/zed/issues/11967)).

Remco Smits created

2177ee8 Highlight files ending in `mdwn` as Markdown (#12224)

Click to expand commit body
Highlight files ending in `mdwn` as Markdown.

(Ikiwiki uses `mdwn` as the file extension for Markdown.)

This pull request was inspired by this one:

- #1209/

Release Notes:

- Added ".mdwn" as a Markdown file extension.

Philip Durbin created

3ec9469 Make reconnects smoother for dev servers (#12223)

Click to expand commit body
Release Notes:

- N/A

Co-authored-by: Nathan <nathan@zed.dev>

Conrad Irwin and Nathan created

656edc4 Vim smorgasbord (#12222)

Click to expand commit body
Release Notes:

- vim: Added `]d/[d` for go to prev/next diagnostic
- vim: Added `]c/[c` to go to prev/next git change (`:diff` and
`:revert` show the diff and revert it)
- vim: Added `g cmd-d` for go to implementation

Conrad Irwin created

ec4703a Add missing access control check (#12213)

Click to expand commit body
Release Notes:

- N/A

Conrad Irwin created

3b14115 X11: Implement missing XKB Compose (#12150)

Click to expand commit body
Release Notes:

- N/A

We have implemented XKB Compose for Wayland, but we forgot to implement
it for X11.
Fixed #12089

Fernando Tagawa created

57d570c Introduce custom fold placeholders (#12214)

Click to expand commit body
This pull request replaces the static `⋯` character we used to insert
when folding a range with a custom render function that return an
`AnyElement`. We plan to use this in the assistant, but for now this
should be behavior-preserving.

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>

Antonio Scandurra , Nathan , and Conrad created

e0cfba4 gleam: Detect tests using `describe` API for Startest (#12221)

Click to expand commit body
This PR updates the Gleam runnables to detect tests using the `describe`
API in Startest.

This isn't entirely functional yet, as it is still just uses the test
function name to run the tests (which Startest doesn't yet support).

Release Notes:

- N/A

Marshall Bowers created

e15b902 Fix double lease panic in Quote Selection command (#12217)

Click to expand commit body
Release Notes:

- Fixed a panic that occurred when using the `assistant: quote
selection` command while signed out.

Max Brunsfeld created

9c35187 Fix line with invisibles positioning (#12211)

Click to expand commit body
Release Notes:

- fixed positioning of whitespace dots on multibyte text
([#10332](https://github.com/zed-industries/zed/issues/10332)).

Conrad Irwin created

951fbc5 Fix `rustfmt` issues in `dev_servers.rs` (#12205)

Click to expand commit body
This PR fixes some issues preventing `rustfmt` from running properly in
`dev_servers.rs`.

The culprit was some long strings being inlined.

Release Notes:

- N/A

Marshall Bowers created

e903742 indent guides: Cache active indent range (#12204)

Click to expand commit body
Caching the active indent range allows us to not re-compute the indent
range when it is not necessary

Release Notes:

- N/A

Bennet Bo Fenner created

58a3ba0 indent guides: Toggle action (#12203)

Click to expand commit body
Added a new action `editor: Toggle indent guides`, to show/hide indent
guides

Release Notes:

- N/A

Bennet Bo Fenner created

feea607 Indent guides (#11503)

Click to expand commit body
Builds on top of existing work from #2249, but here's a showcase:


https://github.com/zed-industries/zed/assets/53836821/4b346965-6654-496c-b379-75425d9b493f

TODO:
- [x] handle line wrapping
- [x] implement handling in multibuffer (crashes currently)
- [x] add configuration option
- [x] new theme properties? What colors to use?
- [x] Possibly support indents with different colors or background
colors
- [x] investigate edge cases (e.g. indent guides and folds continue on
empty lines even if the next indent is different)
- [x] add more tests (also test `find_active_indent_index`)
- [x] docs (will do in a follow up PR)
- [x] benchmark performance impact

Release Notes:

- Added indent guides
([#5373](https://github.com/zed-industries/zed/issues/5373))

---------

Co-authored-by: Nate Butler <1714999+iamnbutler@users.noreply.github.com>
Co-authored-by: Remco <djsmits12@gmail.com>

Bennet Bo Fenner , Nate Butler , and Remco created

3eb0418 Make a macro for less boilerplate when moving variables (#12182)

Click to expand commit body
Also: 
- Simplify open listener implementation
- Add set_global API to global traits

Release Notes:

- N/A

Mikayla Maki created

8b57d6d remote config fixes (#12178)

Click to expand commit body
Release Notes:

- N/A

Conrad Irwin created

af8641c reconnect ssh (#12147)

Click to expand commit body
Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennet@zed.dev>

Conrad Irwin and Bennet created

ea166f0 Add a send button to the assistant (#12171)

Click to expand commit body
![CleanShot 2024-05-22 at 18 20
45@2x](https://github.com/zed-industries/zed/assets/1789/dac9fcde-9fcb-4c40-b5da-ebdc847b3962)

Include the keybinding to help people discover how to submit from the
keyboard.

I'm also shifting from the word "Conversation" to "Context".

Release Notes:

- Added a send button to the assistant panel.

Nathan Sobo created

457fbd7 zig: Pin ZLS to v0.11.0 (#12173)

Click to expand commit body
This PR updates the Zig extension to pin ZLS to v0.11.0, as the more
recent releases of ZLS don't have `.tar.gz` assets available.

Note that this depends on the next version of the `zed_extension_api`,
which has yet to be released.

Release Notes:

- N/A

Marshall Bowers created

054c36c zed_extension_api: Add `github_release_by_tag_name` (#12172)

Click to expand commit body
This PR adds a new `github_release_by_tag_name` method to the
`zed_extension_api` to allow for retrieving a GitHub release by its tag
name.

Release Notes:

- N/A

Marshall Bowers created

85ff80f Restrict v0.0.7 of the `zed_extension_api` to dev builds, for now (#12170)

Click to expand commit body
This PR restricts usage of v0.0.7 of the `zed_extension_api` to dev
builds, for now.

As we're still making changes to it, we don't want to ship a version of
Zed to Preview/Stable that claims to support a yet-unreleased version of
the extension API.

Release Notes:

- N/A

Marshall Bowers created

80bd40c zed_extension_api: Fork new version (#12160)

Click to expand commit body
This PR forks a new version of the `zed_extension_api` in preparation
for some upcoming changes that require breaking changes to the WIT.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>

Marshall Bowers and Max created

2564d5d docs: Remove references to `language_overrides` (#12169)

Click to expand commit body
This PR replaces references to `language_overrides` in the docs with
just `languages`.

`language_overrides` is an alias for `languages`, and we want to move
towards just using `languages`.

Release Notes:

- N/A

Marshall Bowers created

770a702 Write a randomized test and fix bugs in the logic for omitting slash commands from completion requests (#12164)

Click to expand commit body
Release Notes:

- N/A

Max Brunsfeld created

0a848f2 Prompt library updates (#11988)

Click to expand commit body
Restructure prompts & the prompt library.

- Prompts are now written in markdown
- The prompt manager has a picker and editable prompts
- Saving isn't wired up yet
- This also removes the "Insert active prompt" button as this concept doesn't exist anymore, and will be replaced with slash commands.

I didn't staff flag this, but if you do play around with it expect it to still be pretty rough.

Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <1789+nathansobo@users.noreply.github.com>
Co-authored-by: Antonio Scandurra <me@as-cii.com>

Nate Butler , Nathan Sobo , and Antonio Scandurra created

a73a3ef Add slash commands for adding context into the assistant (#12102)

Click to expand commit body
Tasks

* [x] remove old flaps and output when editing a slash command
* [x] the completing a command name that takes args, insert a space to
prepare for typing an arg
* [x] always trigger completions when  typing in a slash command
* [x] don't show line numbers
* [x] implement `prompt` command
* [x] `current-file` command
* [x] state gets corrupted on `duplicate line up` on a slash command
* [x] exclude slash command source from completion request

Next steps:
* show output token count in flap trailer
* add `/project` command that matches project ambient context
* delete ambient context

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Antonio Scandurra <me@as-cii.com>

Max Brunsfeld , Marshall , and Antonio Scandurra created

d6e59bf Fix proxy setting documentation (#12151)

Click to expand commit body
Release Notes:

- N/A

Joseph T. Lyons created

c2f650f Fix some edge-cases in vim visual delete (#12131)

Click to expand commit body
Release Notes:

- vim: Fixed `shift-d` in visual and visual block mode.

Conrad Irwin created

c084b6a remoting fixes (#12137)

Click to expand commit body
Release Notes:

- N/A

Conrad Irwin created

8af9fa6 php: Bump to v0.0.4 (#12140)

Click to expand commit body
This PR bumps the PHP extension to v0.0.4.

Changes:

- https://github.com/zed-industries/zed/pull/11514

Release Notes:

- N/A

Remco Smits created

58796a8 tasks: Expose captured variables to ContextProvider (#12134)

Click to expand commit body
This PR changes the interface of ContextProvider, allowing it to inspect
*all* variables set so far during the process of building
`TaskVariables`. This makes it possible to capture e.g. an identifier in
tree-sitter query, process it and then export it as a task variable.

Notably, the list of variables includes captures prefixed with leading
underscore; they are removed after all calls to `build_context`, but it
makes it possible to capture something and then conditionally preserve
it (and perhaps modify it).

Release Notes:

- N/A

Piotr Osiewicz created

ba94496 v0.138.x dev

Joseph T. Lyons created

aa539fc lsp: Fix wrong WorkspaceFolder when opening only file (#12129)

Click to expand commit body
This fixes #11361 and #8764 by making sure we pass a directory as
`WorkspaceFolder` to the language server.

We already compute the `working_dir` correctly when
`self.root_path.is_file()`, but we didn't use it.

Release Notes:

- Fixed language servers (such as `gopls`) not starting up correctly
when opening a single file in Zed.
([#11361](https://github.com/zed-industries/zed/issues/11361) and
[#8764](https://github.com/zed-industries/zed/issues/8764)).

Thorsten Ball created

49dffab macOS: Allow creating directories in file-open panel (#12121)

Click to expand commit body
I don't know whether there are any hard UI guidelines that dictate
whether this should be allowed or not, but I think it's very handy and
missed it.

I also think it makes sense to have this in a directory-centric editor
in which opening a directory creates a new window.

Release Notes:

- Added ability to create directory in open-file dialog on macOS.

![screenshot-2024-05-22-15 05
03@2x](https://github.com/zed-industries/zed/assets/1185253/939a2a88-16b2-4a91-a344-f73c5615d831)

Thorsten Ball created

1771ede tasks: Fix $ZED_SELECTED_TEXT ignoring line_mode (#12120)

Click to expand commit body
When you press `V` to go into visual-line mode in Vim,
`selections.line_mode` is true and the selection contains _lines_.

But `$ZED_SELECTED_TEXT` always contained just the cursor location or
any non-line-mode selection that was previously made.

Release Notes:

- Fixed `$ZED_SELECTED_TEXT` variable in Tasks ignoring whether
visual-line-mode in Vim was used.

Thorsten Ball created

bfdd9d8 php: Add runnable tests (#11514)

Click to expand commit body
### This pull request adds the following:
- Missing mapping for the `yield` keyword.
- Outline scheme for `describe`, `it` and `test`
function_call_expressions (to support Pest runnable)
- Pest runnable support
- PHPUnit runnable support
- Task for running selected PHP code.


## Queries explanations

#### Query 1 (PHPUnit: Run specific method test):
1. Class is not abstract (because you cannot run tests from an abstract
class)
2. Class has `Test` suffix
3. Method has public modifier(or no modifiers, default is public)
4. Method has `test` prefix

#### Query 2 (PHPUnit: Run specific method test with `@test`
annotation):
1. Class is not abstract (because you cannot run tests from an abstract
class)
2. Class has `Test` suffix
3. Method has public modifier(or no modifiers, default is public)
4. Method has `@test` annotation

#### Query 3 (PHPUnit: Run specific method test with `#[Test]`
attribute):
1. Class is not abstract (because you cannot run tests from an abstract
class)
2. Class has `Test` suffix
3. Method has public modifier(or no modifiers, default is public)
4. Method has `#[Test]` attribute

#### Query 4 (PHPUnit: Run all tests inside the class):
1. Class is not abstract (because you cannot run tests from an abstract
class)
2. Class has `Test` suffix

#### Query 5 (Pest: Run function test)
1. Function expression has one of the following names: `describe`, `it`
or `test`
2. Function expression first argument is a string

### **PHPUnit: Example for valid test class**
<img width="549" alt="Screenshot 2024-05-08 at 10 41 34"
src="https://github.com/zed-industries/zed/assets/62463826/e84269de-4f53-410b-b93b-713f9448dc79">


### **PHPUnit: Example for invalid test class**
All the methods should be ignored because you cannot run tests on an
abstract class.
<img width="608" alt="Screenshot 2024-05-07 at 22 28 57"
src="https://github.com/zed-industries/zed/assets/62463826/8c6b3921-5266-4d88-ada5-5cd827bcf242">

### **Pest: Example**

https://github.com/zed-industries/zed/assets/62463826/bce133eb-0a6f-4ca2-9739-12d9169bb9d6

You should now see all your **Pest** tests inside the buffer symbols
modal.
![Screenshot 2024-05-08 at 22 51
25](https://github.com/zed-industries/zed/assets/62463826/9c818b74-383c-45e5-9b41-8dec92759a14)

Release Notes:

- Added test runnable detection for PHP (PHPUnit & Pest).
- Added task for running selected PHP code.
- Added `describe`, `test` and `it` functions to buffer symbols, to
support Pest runnable.
- Added `yield` keyword to PHP keyword mapping.

Remco Smits created

c4e8744 Tidy up the code (#12116)

Click to expand commit body
Small follow-ups for https://github.com/zed-industries/zed/pull/12063
and https://github.com/zed-industries/zed/pull/12103

Release Notes:

- N/A

Kirill Bulatov created

c440f3a tasks: Fix runnables retrieval to not bail when a single tag can't be matched (#12113)

Click to expand commit body
This can happen with queries without `@run` indicator.

Release Notes:

- N/A

Piotr Osiewicz created

e68ef94 Separate actions for accepting the inline suggestions and completions (#12094)

Click to expand commit body
Release Notes:
- Added `editor::AcceptInlineCompletion` action (bound to Tab by
default) for accepting inline completions. ([6788](https://github.com/zed-industries/zed/issues/6788))

---------

Signed-off-by: Raphael Lüthy <raphael.luethy@fhnw.ch>
Co-authored-by: Conrad Irvin <conrad@zed.dev>

Raphael Lüthy and Conrad Irvin created

7c9c80d go: Highlight constant identifiers (#12111)

Click to expand commit body
Release Notes:

- N/A

Thorsten Ball created

a33aedf gomod and gowork add gopls server (#12109)

Click to expand commit body
<img width="684" alt="image"
src="https://github.com/zed-industries/zed/assets/45585937/c22e00d2-e197-44b3-864f-db20eaf47ff7">

Release Notes:

- Added `gopls` support when opening `go.mod` or `go.work` files.

Co-authored-by: Thorsten Ball <thorsten@zed.dev>

d1y and Thorsten Ball created

8168ec2 go: Add runnables (#12110)

Click to expand commit body
This adds support for runnables to Go.

It adds the following tasks:

- `go test $ZED_GO_PACKAGE -run $ZED_SYMBOL`
- `go test $ZED_GO_PACKAGE`
- `go test ./...`
- `go run $ZED_GO_PACKAGE` if it has a `main` function

Release Notes:

- Added built-in Go runnables and tasks that allow users to run Go test
functions, test packages, or run `main` functions.

Demo:



https://github.com/zed-industries/zed/assets/1185253/a6271d80-faf4-466a-bf63-efbec8fe6c35




https://github.com/zed-industries/zed/assets/1185253/92f2b616-7501-463d-b613-1ec1084ae0cd

Thorsten Ball created

e5b9e20 Allow ssh connection for setting up zed (#12063)

Click to expand commit body
Co-Authored-By: Mikayla <mikayla@zed.dev>



Release Notes:

- Magic `ssh` login feature for remote development

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>

Conrad Irwin , Mikayla , and Nate Butler created

3382e79 Improve file finder match results (#12103)

Kirill Bulatov created

c290d92 Allow formatting of unsaved buffers with prettier (#12095)

Click to expand commit body
This fixes #4529 by allowing unsaved buffers to be formatted with
prettier.

Steps to do that:

1. Create a new buffer
2. Set language for the buffer (e.g.: `language selector: toggle` and
JSON)
3. In settings, set prettier parser for language (can't be inferred,
since we don't have filename) and allow formatting with prettier:

   ```json
   {
     "languages": {
       "JSON": {
         "prettier": {
           "allowed": true,
           "parser": "json"
         }
       }
     }
   }
   ```

4. Use `editor: format`

Release Notes:

- Added ability to format unsaved buffers with Prettier. Requirement is
to set a Prettier parser in the user settings. Example for JSON: `{
"languages": { "JSON": { "prettier": { "allowed": true, "parser": "json"
} } } }` ([#4529](https://github.com/zed-industries/zed/issues/4529)).

Demo:


https://github.com/zed-industries/zed/assets/1185253/d24e490b-2e2c-4a5d-95a8-fc8675523780

Thorsten Ball created

b451af4 Fix `npm install` error with some languages (#12087)

Click to expand commit body
If you have already installed `node` using `brew install node`, you are
fine. If you did not install `node` on you local machine, it fails.

The `node_binary` path is actually not included in environment variable.
When run `npm install`, some extensions like `eslint`, may run some
commands like `sh -c node .....`. Since `node_binary` path is not
included in `PATH` variable, `sh -c node ...` will fail complaining that
"command not found". If you have installed `node` before, `node` is
already included in `PATH`, so you are fine. If not, it fails.

Closes #11890

Release Notes:

- Fixed Zed's internal Node runtime not being put in `$PATH` correctly
when running language servers and other commands with `node`.
([#11890](https://github.com/zed-industries/zed/issues/11890))

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>

张小白 and Thorsten Ball created