Commit Graph

2124 Commits

Author SHA1 Message Date
Mikayla Maki
80c14c9198
Pull app / OS info out of GPUI, add Linux information, make fallible window initialization (#12869)
TODO:
- [x] Finish GPUI changes on other operating systems 

This is a largely internal change to how we report data to our
diagnostics and telemetry. This PR also includes an update to our blade
backend which allows us to report errors in a more useful way when
failing to initialize blade.


Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-06-11 11:43:12 -07:00
Conrad Irwin
a06189bbed
Fix most vim tests on linux (#12873)
Fixes most vim tests on linux (and a few editor ones) by loading Zed
Mono
instead of relying on the system fallback stack.

Release Notes:

- N/A
2024-06-11 08:27:55 -06:00
Antonio Scandurra
98659eabf1
Overhaul inline assistant (#12846)
This pull request introduces a new diff mechanism that helps users
understand exactly which lines were changed by the LLM.

Release Notes:

- N/A
2024-06-11 12:39:45 +02:00
Conrad Irwin
4e98c23463
Reconnect button for remote projects (#12669)
Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2024-06-10 18:09:47 -06:00
Marshall Bowers
8078e58494
Remove unused color crate (#12860)
This PR removes the `color` crate, as it was not used anywhere.

We had added this experimentally, but right now its existence is just a
source of confusion.

Release Notes:

- N/A
2024-06-10 15:35:44 -04:00
Antonio Scandurra
77e88c1ded
Extract a proto crate out of rpc (#12852)
Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-06-10 12:49:53 -06:00
Marshall Bowers
57c40299a5
Show extension download counts with thousands separators (#12857)
This PR adjusts the extension download counts to be displayed using
thousands separators.

Release Notes:

- Adjusted extension download counts to display with thousands
separators (e.g., `1,000,000`).
2024-06-10 14:19:17 -04:00
Max Brunsfeld
e174f16d50
Refactor: Make it possible to share a remote worktree (#12775)
This PR is an internal refactor in preparation for remote editing. It
restructures the public interface of `Worktree`, reducing the number of
call sites that assume that a worktree is local or remote.

* The Project no longer calls `worktree.as_local_mut().unwrap()` in code
paths related to basic file operations
* Fewer code paths in the app rely on the worktree's `LocalSnapshot`
* Worktree-related RPC message handling is more fully encapsulated by
the `Worktree` type.

to do:
* [x] file manipulation operations
* [x] sending worktree updates when sharing

for later
* opening buffers
* updating open buffers upon worktree changes

Release Notes:

- N/A
2024-06-07 12:53:01 -07:00
Max Brunsfeld
48581167b7
Remove dependencies from the Worktree crate and make it more focused (#12747)
The `worktree` crate mainly provides an in-memory model of a directory
and its git repositories. But because it was originally extracted from
the Project crate, it also contained lingering bits of code that were
outside of that area:
* it had a little bit of logic related to buffers (though most buffer
management lives in `project`)
* it had a *little* bit of logic for storing diagnostics (though the
vast majority of LSP and diagnostic logic lives in `project`)
* it had a little bit of logic for sending RPC message (though the
*receiving* logic for those RPC messages lived in `project`)

In this PR, I've moved those concerns entirely to the project crate
(where they were already dealt with for the most part), so that the
worktree crate can be more focused on its main job, and have fewer
dependencies.

Worktree no longer depends on `client` or `lsp`. It still depends on
`language`, but only because of `impl language::File for
worktree::File`.

Release Notes:

- N/A
2024-06-06 11:16:58 -07:00
Joseph T Lyons
a59dd7d06d v0.140.x dev 2024-06-05 12:23:48 -04:00
Conrad Irwin
868284876d
Bump alacritty to fix some file descriptor yuck (#12687)
https://github.com/alacritty/alacritty/pull/7996

Release Notes:

- Fixed a crash caused by bad file descriptor lifetime handling.
2024-06-05 09:12:05 -06:00
Marshall Bowers
74cb92f9cc
vue: Bump to v0.0.3 (#12656)
This PR bumps the Vue extension to v0.0.3.

Changes:

- #11482

Release Notes:

- N/A
2024-06-04 18:06:40 -04:00
Marshall Bowers
2d9479667f
Make HTML to Markdown conversion more pluggable (#12653)
This PR overhauls the HTML to Markdown conversion functionality in order
to make it more pluggable. This will ultimately allow for supporting a
variety of different HTML input structures (both natively and via
extensions).

As part of this, the `rustdoc_to_markdown` crate has been renamed to
`html_to_markdown`.

The `MarkdownWriter` now accepts a list of trait objects that can be
used to drive the conversion of the HTML into Markdown. Right now we
have some generic handler implementations for going from plain HTML
elements to their Markdown equivalents, as well as some rustdoc-specific
ones.

Release Notes:

- N/A
2024-06-04 16:14:26 -04:00
Antonio Scandurra
c5b22eee2d
Polish prompt library UX (#12647)
This could still use some improvement UI-wise but the user experience
should be a lot better.

- [x] Show in "Window" application menu
- [x] Load prompt as it's selected in the picker
- [x] Refocus picker on `esc`
- [x] When creating a new prompt, if a new prompt already exists and is
unedited, activate it instead
- [x] Add `/default` command
- [x] Evaluate /commands on prompt insertion
- [x] Autocomplete /commands (but don't evaluate) during prompt editing
- [x] Show token count using the settings model, right-aligned in the
editor
- [x] Picker 
- [x] Sorted alpha
- [x] 2 sublists
    - Default
        - Empty state: Star a prompt to add it to your default prompt
        - Otherwise show prompts with star on hover
    - All
        - Move prompts with star on hover

Release Notes:

- N/A
2024-06-04 18:36:54 +02:00
Piotr Osiewicz
910f668f4d
php/elixir: Bump extensions versions to 0.0.6 and 0.0.5 (#12636)
Includes:
- https://github.com/zed-industries/zed/pull/12526
- https://github.com/zed-industries/zed/pull/11879
- https://github.com/zed-industries/zed/pull/12467

Release Notes:

- N/A
2024-06-04 13:24:31 +02:00
Kirill Bulatov
47122a3115
Fix excluded file creation (#12620)
Fixes https://github.com/zed-industries/zed/issues/10890

* removes `unwrap()` that caused panics for text elements with no text,
remaining after edit state is cleared but project entries are not
updated, having the fake, "new entry"
* improves discoverability of the FS errors during file/directory
creation: now those are shown as workspace notifications
* stops printing anyhow backtraces in workspace notifications, printing
the more readable chain of contexts instead
* better indicates when new entries are created as excluded ones


Release Notes:

- Improve excluded entry creation workflow in the project panel
([10890](https://github.com/zed-industries/zed/issues/10890))
2024-06-04 10:31:43 +03:00
Nathan Sobo
5f98b9617a
Start on a database-backed prompt library (#12468)
Using the file system as a database seems like it's easy, but it's
actually a real pain. I'd like to use LMDB to store the prompts locally
so we have more control. We can always add an export option, but I want
the source of truth to be somewhere other than the file system.

So far, I have a PromptStore which is global to the application and can
be initialized on startup. Then there's a `PromptLibrary` which is
intended to be the root of a new kind of Zed window. I haven't actually
seen pixels yet, but I've sketched out the basics needed to create a new
prompt, save, etc.

Still lots to figure out but the foundations of being backed by a DB and
rendering in an independent window are in place.

/cc @iamnbutler @as-cii 

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2024-06-03 15:58:43 +02:00
Antonio Scandurra
6ff01b17ca
Improve model selection in the assistant (#12472)
https://github.com/zed-industries/zed/assets/482957/3b017850-b7b6-457a-9b2f-324d5533442e


Release Notes:

- Improved the UX for selecting a model in the assistant panel. You can
now switch model using just the keyboard by pressing `alt-m`. Also, when
switching models via the UI, settings will now be updated automatically.
2024-05-30 12:36:07 +02:00
Marshall Bowers
bdf627ce07
rustdoc_to_markdown: Fix code blocks (#12460)
This PR fixes an issue in `rustdoc_to_markdown` with code blocks being
trimmed incorrectly.

We were erroneously popping from the current element stack even if we
didn't push an element onto the stack.

Added test coverage for this case as well, so we don't regress.

Release Notes:

- N/A
2024-05-29 19:23:06 -04:00
Nathan Sobo
b8d9713b4f
Make prompt library icon in context panel staff-only for now (#12457)
This is still pretty raw, so I'd like to hold off on shipping it to all
users.

Release Notes:

- Hide the prompt library for non-staff until it is in a more complete
state.
2024-05-29 16:53:45 -06:00
Marshall Bowers
abec028e58
rustdoc_to_markdown: Clean up heading spacing (#12456)
This PR cleans up the spacing around the Markdown headings in the output
so that they are consistent.

Release Notes:

- N/A
2024-05-29 18:39:51 -04:00
Marshall Bowers
08881828ce
assistant: Add /rustdoc slash command (#12453)
This PR adds a `/rustdoc` slash command for retrieving and inserting
rustdoc docs into the Assistant.

Right now the command accepts the crate name as an argument and will
return the top-level docs from `docs.rs`.

Release Notes:

- N/A
2024-05-29 18:14:29 -04:00
Joshua Ferguson
6294a3b80b
Add xdg trash support (#12391)
- Added support for xdg trash when deleting files on linux
- moved ashpd depency to toplevel to use it in both fs and gpui

If I need to add test, or change anything, please let me know. I tested
locally by creating and deleting a file and confirming it showed up in
my trashcan, but that probably a less than ideal method of confirming
correct behavior

Also, I could remove the delete directory function for linux, and change
the one configured for macos to compile for both macos and linux (they
are the same, the version of the function they are calling is
different).

Release Notes:

- N/A
2024-05-29 14:15:29 -07:00
Marshall Bowers
5bcb9ed017
Add rustdoc_to_markdown crate (#12445)
This PR adds a new crate for converting rustdoc output to Markdown.

We're leveraging Servo's `html5ever` to parse the Markdown content, and
then walking the DOM nodes to convert it to a Markdown string.

The Markdown output will be continued to be refined, but it's in a place
where it should be reasonable.

Release Notes:

- N/A
2024-05-29 16:05:16 -04:00
Dzmitry Malyshau
44c50da94f
blade: Use BufferBelt from blade-utils (#12411)
Release Notes:

- N/A

Follow-up to #12340
Carries https://github.com/kvark/blade/pull/122 and
https://github.com/kvark/blade/pull/119
2024-05-29 09:50:45 -07:00
Joseph T. Lyons
c34d36161d v0.139.x dev 2024-05-29 12:15:12 -04:00
moshyfawn
6a48e3b8c6
ruby: Bump to v0.0.6 (#12395)
Release Notes:

- N/A

Related: #12392
2024-05-28 16:14:38 -04:00
Dzmitry Malyshau
08e3840379
Update blade to pick up the descriptor initialization changes (#12340)
Release Notes:

- N/A

Picks up https://github.com/kvark/blade/pull/118
Fixes #10351

Seeing that Zed loaded with Blade repository is consuming 260Mb of RAM.
We can tune this to be lower, but ultimately it doesn't matter: this
memory isn't wasted, it's just pools for memory and descriptors, which
may be used by bigger and more complex views of Zed.
2024-05-28 11:41:46 -07:00
Marshall Bowers
01e86881f0
Add placeholder for extension slash commands (#12387)
This PR adds a slightly better placeholder for extension slash commands
than the current "TODO" text.

Right now we display the command name and an arbitrary icon.

<img width="644" alt="Screenshot 2024-05-28 at 12 15 07 PM"
src="https://github.com/zed-industries/zed/assets/1486634/11761797-5ccc-4209-8b00-70b714f10a78">

Release Notes:

- N/A
2024-05-28 12:16:31 -04:00
Antonio Scandurra
b466a8b828
Remove the assistant2 crate (#12380)
Release Notes:

- N/A
2024-05-28 16:26:35 +02:00
Antonio Scandurra
59662fbeb6
Introduce /search command to assistant (#12372)
This pull request introduces semantic search to the assistant using a
slash command:


https://github.com/zed-industries/zed/assets/482957/62f39eae-d7d5-46bf-a356-dd081ff88312

Moreover, this also adds a status to pending slash commands, so that we
can show when a query is running or whether it failed:

<img width="1588" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/e8d85960-6275-4552-a068-85efb74cfde1">

I think this could be better design-wise, but seems like a pretty good
start.

Release Notes:

- N/A
2024-05-28 16:06:09 +02:00
Antonio Scandurra
7e3ab9acc9
Rework context insertion UX (#12360)
- Confirming a completion now runs the command immediately
- Hitting `enter` on a line with a command now runs it
- The output of commands gets folded away and replaced with a custom
placeholder
- Eliminated ambient context

<img width="1588" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/b1927a45-52d6-4634-acc9-2ee539c1d89a">

Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2024-05-27 17:44:54 -06:00
Piotr Osiewicz
20f37f0647
chore: Change git deps to crates.io dependencies where possible (#12362)
Release Notes:

- N/A
2024-05-27 23:32:51 +02:00
Maksim Bondarenkov
b36d62887e
Update winapi-util crate (#12239)
starting with v0.1.7, winapi-util switched to windows-sys crate. this
small update will reduce dependence from winapi crate

Release Notes:

- N/A
2024-05-26 16:49:18 -07:00
Jakob Hellermann
8e07fd2214
Update time crate to fix compilation error (#12189)
run `cargo update --package time` due to
https://github.com/time-rs/time/issues/681

Release Notes:

- N/A
2024-05-26 16:44:15 -07:00
Piotr Osiewicz
71451b59cd
php/ruby: bump version to 0.0.5 (#12330)
Includes: https://github.com/zed-industries/zed/pull/12237

Release Notes:

- N/A
2024-05-27 00:07:33 +02:00
Max Brunsfeld
f7a86967fd
Avoid holding worktree lock for a long time while updating large repos' git status (#12266)
Fixes https://github.com/zed-industries/zed/issues/9575
Fixes https://github.com/zed-industries/zed/issues/4294

### Problem

When a large git repository's `.git` folder changes (due to a `git
commit`, `git reset` etc), Zed needs to recompute the git status for
every file in that git repository. Part of computing the git status is
the *unstaged* part - the comparison between the content of the file and
the version in the git index. In a large git repository like `chromium`
or `linux`, this is inherently pretty slow.

Previously, we performed this git status all at once, and held a lock on
our `BackgroundScanner`'s state for the entire time. On my laptop, in
the `linux` repo, this would often take around 13 seconds.

When opening a file, Zed always refreshes the metadata for that file in
its in-memory snapshot of worktree. This is normally very fast, but if
another task is holding a lock on the `BackgroundScanner`, it blocks.

###  Solution

I've restructured how Zed handles Git statuses, so that when a git
repository is updated, we recompute files' git statuses in fixed-sized
batches. In between these batches, the `BackgroundScanner` is free to
perform other work, so that file operations coming from the main thread
will still be responsive.

Release Notes:

- Fixed a bug that caused long delays in opening files right after
performing a commit in very large git repositories.
2024-05-24 17:41:35 -07:00
Marshall Bowers
82f5f36422
Allow defining slash commands in extensions (#12255)
This PR adds initial support for defining slash commands for the
Assistant from extensions.

Slash commands are defined in an extension's `extension.toml`:

```toml
[slash_commands.gleam-project]
description = "Returns information about the current Gleam project."
requires_argument = false
```

and then executed via the `run_slash_command` method on the `Extension`
trait:

```rs
impl Extension for GleamExtension {
    // ...

    fn run_slash_command(
        &self,
        command: SlashCommand,
        _argument: Option<String>,
        worktree: &zed::Worktree,
    ) -> Result<Option<String>, String> {
        match command.name.as_str() {
            "gleam-project" => Ok(Some("Yayyy".to_string())),
            command => Err(format!("unknown slash command: \"{command}\"")),
        }
    }
}
```

Release Notes:

- N/A
2024-05-24 15:44:32 -04:00
Kirill Bulatov
055a13a9b6
Allow clients to run Zed tasks on remote projects (#12199)
Release Notes:

- Enabled Zed tasks on remote projects with ssh connection string
specified

---------

Co-authored-by: Conrad Irwin <conrad@zed.dev>
2024-05-24 22:26:57 +03:00
Marshall Bowers
8040e43520
Extract SlashCommand trait from assistant (#12252)
This PR extracts the `SlashCommand` trait (along with the
`SlashCommandRegistry`) from the `assistant` crate.

This will allow us to register slash commands from extensions without
having to make `extension` depend on `assistant`.

Release Notes:

- N/A
2024-05-24 13:03:41 -04:00
Piotr Osiewicz
0eff1eae76
task: Add ZED_DIRNAME and ZED_RELATIVE_FILE task variables (#12245)
Release Notes:

- Added ZED_RELATIVE_FILE (path to current file relative to worktree
root) and ZED_DIRNAME (path to the directory containing current file)
task variables.
2024-05-24 16:04:24 +02:00
Conrad Irwin
af8641ce5b
reconnect ssh (#12147)
Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-05-22 21:25:38 -06:00
Marshall Bowers
457fbd742f
zig: Pin ZLS to v0.11.0 (#12173)
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
2024-05-22 20:47:49 -04:00
Marshall Bowers
85ff80f3c0
Restrict v0.0.7 of the zed_extension_api to dev builds, for now (#12170)
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
2024-05-22 19:45:34 -04:00
Marshall Bowers
80bd40cfa3
zed_extension_api: Fork new version (#12160)
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>
2024-05-22 19:07:52 -04:00
Nate Butler
0a848f29e8
Prompt library updates (#11988)
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>
2024-05-22 18:04:47 -04:00
Max Brunsfeld
a73a3ef243
Add slash commands for adding context into the assistant (#12102)
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>
2024-05-22 14:06:28 -07:00
Remco Smits
8af9fa6320
php: Bump to v0.0.4 (#12140)
This PR bumps the PHP extension to v0.0.4.

Changes:

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

Release Notes:

- N/A
2024-05-22 14:11:48 -04:00
Joseph T. Lyons
ba9449692e v0.138.x dev 2024-05-22 11:26:58 -04:00
Conrad Irwin
e5b9e2044e
Allow ssh connection for setting up zed (#12063)
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>
2024-05-21 22:39:16 -06:00