Commit graph

580 commits

Author SHA1 Message Date
Marshall Bowers
e60123bbdc
Allow icon themes to provide their own file associations (#24926)
This PR adds the ability for icon themes to provide their own file
associations.

The old `file_types.json` that was previously used to make these
associations has been removed in favor of storing them on the default
theme.

Icon themes have two new fields on them:

- `file_stems`: A mapping of file stems to icon keys.
- `file_suffixes`: A mapping of file suffixes to icon keys.

These mappings produce icon keys which can then be used in `file_icons`
to associate them to a particular icon:

```json
{
  "file_stems": {
    "Makefile": "make"
  },
  "file_suffixes": {
    "idr": "idris"
  },
  "file_icons": {
    "idris": { "path": "./icons/idris.svg" },
    "make": { "path": "./icons/make.svg" }
  }
}
```

When loading an icon theme, the `file_stems` and `file_icons` fields
will be merged with the ones from the base icon theme, with the values
from the icon theme being loaded overriding ones in the base theme.

Release Notes:

- Added the ability for icon themes to provide their own file
associations.
2025-02-15 00:35:13 +00:00
Joseph T. Lyons
fc7bf7bcb9
Bump Zed to v0.175 (#24785)
Release Notes:

-N/A
2025-02-12 23:14:45 -05:00
Piotr Osiewicz
64ae5093af
chore: Remove settings dependency on migrator (#24642)
Closes #ISSUE

Release Notes:

- N/A
2025-02-11 13:34:33 +01:00
Nate Butler
8f1ff189cc
component: Add component and component_preview crates to power UI components (#24456)
This PR formalizes design components with the Component and
ComponentPreview traits.

You can open the preview UI with `workspace: open component preview`.

Component previews no longer need to return `Self` allowing for more
complex previews, and previews of components like `ui::Tooltip` that
supplement other components rather than are rendered by default.

`cargo-machete` incorrectly identifies `linkme` as an unused dep on
crates that have components deriving `IntoComponent`, so you may need to
add this to that crate's `Cargo.toml`:

```toml
# cargo-machete doesn't understand that linkme is used in the component macro
[package.metadata.cargo-machete]
ignored = ["linkme"]
```

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-09 13:25:03 -05:00
Mikayla Maki
ca4e8043d4
Add branch to git panel (#24485)
This PR adds the branch selector to the git panel and fixes a few bugs
in the repository selector.

Release Notes:

- N/A

---------

Co-authored-by: ConradIrwin <conrad.irwin@gmail.com>
Co-authored-by: Conrad <conrad@zed.dev>
2025-02-08 03:27:58 +00:00
Peter Tripp
ee422dea6e
Bump Zed to v0.174 (#24221) 2025-02-04 14:38:37 -05:00
Agus Zubiaga
93f8ccaaee
zeta: Revised data-collection onboarding experience (#24031)
Release Notes:

- N/A

---------

Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: João Marcos <marcospb19@hotmail.com>
2025-02-04 04:06:09 -03:00
Agus Zubiaga
e23e03592b
zeta: Onboarding and title bar banner (#23797)
Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: João Marcos <joao@zed.dev>
2025-01-30 16:55:32 -03:00
Mikayla Maki
bd21334013
Add a crate for spawning tokio tasks in Zed (#23857)
Part of https://github.com/zed-industries/zed/pull/21092

As we're already depending on and using `tokio` to run `reqwest`, I've
added a crate to make running tokio futures more convenient. This should
unblock the Bedrock Cloud Model provider PR.

Note that since the `gpui_tokio` code is nearly trivial glue and I
expect that it will be useful for the nascent GPUI ecosystem, I've
elected to license it under Apache 2, like GPUI itself, instead of our
normal GPL license for Zed code.

Release Notes:

- N/A
2025-01-29 20:53:16 +00:00
Joseph T. Lyons
8442e2b9d8
Bump Zed to v0.173 (#23843)
Release Notes:

-N/A
2025-01-29 11:55:51 -05:00
Peter Tripp
5930b552b9
Bump Zed to v0.172 (#23474) 2025-01-22 11:57:24 -05:00
Marshall Bowers
1e1997c97b
Wire up AssistantPanelDelegate based on assistant2 feature flag (#23444)
This PR adjusts how the `AssistantPanelDelegate` global is set to be
based on the state of the feature flag.

This should prevent `assistant` and `assistant2` from potentially
clobbering each other.

Release Notes:

- N/A
2025-01-22 04:57:51 +00:00
Agus Zubiaga
919803a4f4
Require accepting ToS when enabling zeta (#23255)
Note: Design hasn't been reviewed yet, but the logic is done

When the user switches the inline completion provider to `zed`, we'll
show a modal prompting them to accept terms if they haven't done so:


https://github.com/user-attachments/assets/3fc6d368-c00a-4dcb-9484-fbbbb5eb859e

If they dismiss the modal, they'll be able to get to it again from the
inline completion button:


https://github.com/user-attachments/assets/cf842778-5538-4e06-9ed8-21579981cc47

This also stops zeta sending requests that will fail immediately when
ToS are not accepted.

Release Notes:

- N/A

---------

Co-authored-by: Richard <richard@zed.dev>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Joao <joao@zed.dev>
2025-01-20 11:48:49 -03:00
Piotr Osiewicz
c9534e8025
chore: Use workspace fields for edition and publish (#23291)
This prepares us for an upcoming bump to Rust 2024 edition.

Release Notes:

- N/A
2025-01-17 17:39:22 +01:00
Marshall Bowers
4d22f7e529
assistant: Remove some re-exports (#23262)
This PR removes some re-exports from the `assistant` to make it clearer
what its constituent modules depend on.

Release Notes:

- N/A
2025-01-16 22:49:14 +00:00
Marshall Bowers
e215ca1d99
Dedupe AssistantSettings (#23190)
This PR dedupes the `AssistantSettings` so we can use the same settings
for both Assistant1 and Assistant2.

We originally forked them so we could change the Assistant2 settings
freely, but given our rollout strategy for the new Assistant, I don't
think that makes sense.

This also fixes the issue where the JSON language server would show a
"Matches multiple schemas when only one must validate" warning in
`settings.json`.

Closes #23171.

Release Notes:

- Fixed the "Matches multiple schemas when only one must validate"
warning for the `assistant` setting.
2025-01-15 18:52:54 +00:00
Peter Tripp
135e58f1e2
Bump Zed to v0.171 (#23188) 2025-01-15 12:54:47 -05:00
Peter Tripp
83889bb235
Bump Zed to v0.170 (#22838) 2025-01-08 11:02:44 -05:00
Piotr Osiewicz
f53a17b044
chore: Add missing test-support features to terminal_view and image_viewer (#22782)
Release Notes:

- N/A
2025-01-07 17:19:22 +00:00
Peter Tripp
0d423a7b37
Bump Zed to v0.169 (#22547)
Release Notes:

-N/A
2025-01-01 12:31:37 -05:00
Cole Miller
8ccc7b81c8
Restore crates/zed dependency on libc (#22354)
This somehow got lost during or after merge of #22202.

Release Notes:

- N/A
2024-12-22 15:53:16 +00:00
tims
204af9cac5
linux: Fix "Failed to start language server" errors when starting Zed from .desktop file (#22335)
Closes #21406

Context:

A few weeks ago on Linux, we resolved an
[issue](https://github.com/zed-industries/zed/issues/20070) where users
could not open more than one file from the file explorer. This was fixed
by replacing `zed-editor` (zed binary in the code) with `zed` (cli
binary in the code) in the `.desktop` file. The reason for this change
was that using the cli to open files is more convenient - it determines
weather to spawn a new Zed instance or use an existing one, if we use
main binary instead it would throw error `Zed is already running`.

You can read the complete PR here: [linux: Fix file not opening from
file explorer](https://github.com/zed-industries/zed/pull/21137).

While this fix resolved the original issue, it introduced a new one.

Problem:

When the cli binary is used, it assumes it is always being invoked from
a terminal and relies on `std::env::vars()` to retrieve the environment
variables needed to spawn Zed. These env vars are then passed to the
worktree, and eventually, languages use the `PATH` from this env to find
binaries. This leads to the "Failed to start language server" error when
the `.desktop` entry is used on Linux.

Solution:

When the `zed-editor` binary is used, it uses some clever Unix-specific
logic to retrieve the default shell (`load_shell_from_passwd`) and then
fetch the env vars from that shell (`load_login_shell_environment`).
This same logic should be used in the cli binary when it is invoked via
a `.desktop` entry rather than from a terminal.

Approach:

I moved these two functions mentioned above to a utils file and reused
them in cli binary to fetch env vars only on Linux when it is not run
from a terminal. This provides missing paths, and fix the issue.

It is also possible to handle this in the `zed-editor` binary by
modifying the logic in `handle_cli_connection`, where `CliRequest::Open`
is processed. There we can discard incoming env, and use our logic. But
discarding incoming envs felt weird, and I thought it's better to handle
this at source.

Release Notes:

- Fixed `Failed to start language server` errors when starting from
dekstop entry on Linux
2024-12-22 10:05:52 +00:00
Peter Tripp
b79117c882
Bump Zed to v0.168.x (#22198) 2024-12-18 12:03:40 -05:00
Conrad Irwin
94bfb93d35
More telemetry events (#22171)
- **Convert more events to telemetry::event**
- **And call events**

Closes #ISSUE

Release Notes:

- N/A
2024-12-17 22:16:59 -07:00
Nate Butler
59afc27f03
Add placeholder git panel (#21894)
Adds a simple git placeholder panel for us to iterate from. Also
includes a number of assets from the git prototyping branch that we will
use.

Note: This panel is staff flagged for now.

Release Notes:

- N/A
2024-12-11 22:13:52 -05:00
Joseph T. Lyons
e8c72d91c3 v0.167.x dev 2024-12-11 11:00:35 -05:00
Antonio Scandurra
77b8296fbb
Introduce staff-only inline completion provider (#21739)
Release Notes:

- N/A

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Co-authored-by: Bennet <bennet@zed.dev>
Co-authored-by: Thorsten <thorsten@zed.dev>
2024-12-09 14:26:36 +01:00
Mikayla Maki
de939e718a
Simplify livekit config so that cargo check Just Works (#21661)
Supersedes https://github.com/zed-industries/zed/pull/21653

This enables us to use `cargo test -p workspace` on macOS and Linux.

Note that the line diffs in `shared_screen.rs` are spurious, I just
re-ordered the `macos` and `cross-platform` modules to match the order
in the call crate.

Release Notes:

- N/A
2024-12-06 13:50:59 -08:00
tims
bffdc55d63
linux: Make prompt detail selectable (#21405)
Closes #21305

As Linux doesn’t have native prompts, Zed uses a custom GPU-based
prompt, like the "About Zed" prompt. Currently, the detail in the prompt
isn’t selectable.

This PR fixes that by using the editor's multi-line selectable
functionality to make the detail selectable (and thus copyable). It
achieves this by disabling editing and setting the cursor to
transparent. The editor also does all the heavy lifting, like
double-clicking to select a word or triple-clicking to select a line,
like what user expects from selectable.

Before/After:

<img
src="https://github.com/user-attachments/assets/2012a6cc-a1ed-4efe-8bfb-440a9259f07a"
alt="before" width="360px" />

<img
src="https://github.com/user-attachments/assets/31922ef5-cb2d-4e90-a1a1-00843e767432"
alt="after" width="360px" />

When detail is `None` or empty string:

<img
src="https://github.com/user-attachments/assets/2be5c921-bda1-4db3-85cd-b4b0e2df86d2"
alt="none" width="360px" />

Release Notes:

- N/A
2024-12-06 09:26:47 -08:00
Michael Sloan
6a4cd53fd8
Use LiveKit's Rust SDK on Linux while continue using Swift SDK on Mac (#21550)
Similar to #20826 but keeps the Swift implementation. There were quite a
few changes in the `call` crate, and so that code now has two variants.

Closes #13714

Release Notes:

- Added preliminary Linux support for voice chat and viewing
screenshares.

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-12-05 15:06:17 -08:00
Peter Tripp
cf781dff71
v0.166.x dev 2024-12-04 12:01:28 -05:00
Peter Tripp
c021ee60d6
v0.165.x dev 2024-11-27 09:48:40 -05:00
Marshall Bowers
3901d46101
Factor tool definitions out of assistant (#21189)
This PR factors the tool definitions out of the `assistant` crate so
that they can be shared between `assistant` and `assistant2`.

`ToolWorkingSet` now lives in `assistant_tool`. The tool definitions
themselves live in `assistant_tools`, with the exception of the
`ContextServerTool`, which has been moved to the `context_server` crate.

As part of this refactoring I needed to extract the
`ContextServerSettings` to a separate `context_server_settings` crate so
that the `extension_host`—which is referenced by the `remote_server`—can
name the `ContextServerSettings` type without pulling in some undesired
dependencies.

Release Notes:

- N/A
2024-11-25 18:26:34 -05:00
Marshall Bowers
9adc3b4e82
Break ground on assistant2 (#21109)
This PR breaks ground on a new `assistant2` crate.

In order to see this new version of the assistant, both of the following
must be true:
1. The `assistant2` feature flag is enabled for your user
   - It is **not** currently enabled for all staff.
2. You are running a development build of Zed

The intent here is to enable the folks working on `assistant2` to
incrementally land work onto `main` without breaking use of the current
Assistant for anyone.

<img width="1136" alt="Screenshot 2024-11-23 at 10 46 08 AM"
src="https://github.com/user-attachments/assets/5723a13f-5be1-4486-9460-ead7329ba78e">

Release Notes:

- N/A
2024-11-23 11:24:52 -05:00
Marshall Bowers
1cfcdfa7ac
Overhaul extension registration (#21083)
This PR overhauls extension registration in order to make it more
modular.

The `extension` crate now contains an `ExtensionHostProxy` that can be
used to register various proxies that the extension host can use to
interact with the rest of the system.

There are now a number of different proxy traits representing the
various pieces of functionality that can be provided by an extension.
The respective crates that provide this functionality can implement
their corresponding proxy trait in order to register a proxy that the
extension host will use to register the bits of functionality provided
by the extension.

Release Notes:

- N/A
2024-11-22 19:02:32 -05:00
Marshall Bowers
e0245b3f30
Merge quick_action_bar into zed (#21026)
This PR merges the `quick_action_bar` crate into the `zed` crate.

We weren't really gaining anything by having it be a separate crate, and
it was introducing an additional step in the dependency graph that was
getting in the way.

It's only ~850 LOC, so the impact on the compilation speed of the `zed`
crate itself is negligible.

Release Notes:

- N/A
2024-11-21 18:33:11 -05:00
Marshall Bowers
b102a40e04
Extract VimModeSetting to its own crate (#21019)
This PR extracts the `VimModeSetting` out of the `vim` crate and into
its own `vim_mode_setting` crate.

A number of crates were depending on the entirety of the `vim` crate
just to reference `VimModeSetting`, which was not ideal.

Release Notes:

- N/A
2024-11-21 16:24:38 -05:00
Marshall Bowers
790fdcf737
collab_ui: Remove dependency on vcs_menu (#21016)
This PR removes the `vcs_menu` dependency from `collab_ui`.

We were only depending on this to call `vcs_menu::init`, which isn't
necessary to do here.

Release Notes:

- N/A
2024-11-21 15:48:35 -05:00
Marshall Bowers
f62ccf9c8a
Extract auto_update_ui crate (#21008)
This PR extracts an `auto_update_ui` crate out of the `auto_update`
crate.

This allows `auto_update` to not depend on heavier crates like `editor`,
which in turn allows other downstream crates to start building sooner.

Release Notes:

- N/A
2024-11-21 14:11:57 -05:00
Marshall Bowers
cbba44900d
Add language_models crate to house language model providers (#20945)
This PR adds a new `language_models` crate to house the various language
model providers.

By extracting the provider definitions out of `language_model`, we're
able to remove `language_model`'s dependency on `editor`, which improves
incremental compilation when changing `editor`.

Release Notes:

- N/A
2024-11-20 18:49:34 -05:00
Joseph T. Lyons
b63394f4bd v0.164.x dev 2024-11-20 10:45:44 -05:00
Joseph T. Lyons
f96b29ca54 v0.163.x dev 2024-11-13 11:47:52 -05:00
Caleb Heydon
a47759fd03
Add initial FreeBSD support (#20480)
This PR adds initial support for FreeBSD
(https://github.com/zed-industries/zed/issues/15309). While there is
still work left to be done, it seems to be usable. As discussed by
@syobocat (https://github.com/zed-industries/zed/discussions/10247), the
changes were just adding ```target_os = "freebsd"``` to wherever it
checks if the OS is Linux.


![image](https://github.com/user-attachments/assets/80ea5b29-047f-4cbd-8263-42e5fa6c94b7)

Needs to be build with ```RUSTFLAGS="-C link-dead-code"```

Known Issues:
- There's an issue in ```crates/project/src/environment.rs``` where a
command fails because ```/bin/sh``` on FreeBSD doesn't support the
```-l``` option.

![image](https://github.com/user-attachments/assets/c3c38633-160f-4f47-8840-e3da67f6ebc8)
- The file/folder choosers provided by the ```ashpd``` crate don't work
on FreeBSD (at least with KDE). This isn't that bad since a fallback
dialog is used.

![image](https://github.com/user-attachments/assets/29373006-1eb9-4ed0-bd52-2d0047fab418)
 - Moving to trash won't work.
- Numerous tests fail (when running on FreeBSD). While I haven't looked
into this much, it appears that the corresponding features seem to work
fine.

Release Notes:

- Added initial support for FreeBSD
2024-11-11 18:39:05 +01:00
Marshall Bowers
f92e6e9a95
Add support for context server extensions (#20250)
This PR adds support for context servers provided by extensions.

To provide a context server from an extension, you need to list the
context servers in your `extension.toml`:

```toml
[context_servers.my-context-server]
```

And then implement the `context_server_command` method to return the
command that will be used to start the context server:

```rs
use zed_extension_api::{self as zed, Command, ContextServerId, Result};

struct ExampleContextServerExtension;

impl zed::Extension for ExampleContextServerExtension {
    fn new() -> Self {
        ExampleContextServerExtension
    }

    fn context_server_command(&mut self, _context_server_id: &ContextServerId) -> Result<Command> {
        Ok(Command {
            command: "node".to_string(),
            args: vec!["/path/to/example-context-server/index.js".to_string()],
            env: Vec::new(),
        })
    }
}

zed::register_extension!(ExampleContextServerExtension);
```

Release Notes:

- N/A
2024-11-08 16:39:21 -05:00
Conrad Irwin
608addf641
Extension refactor (#20305)
This contains the main changes to the extensions crate from #20049. The
primary goal here is removing dependencies that we can't include on the
remote.


Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
2024-11-06 10:06:25 -07:00
Peter Tripp
1aac35cc1c
v0.162.x dev 2024-11-06 11:09:13 -05:00
Marshall Bowers
ea44c510a3
Rename extension crate to extension_host (#20081)
This PR renames the `extension` crate to `extension_host`.

This is to free up the name so that we can create a smaller-scoped
`extension` crate.

Release Notes:

- N/A
2024-11-01 12:53:02 -04:00
Peter Tripp
662a4440cc
v0.161.x dev 2024-10-30 11:06:39 -04:00
Mikayla Maki
b3f0ba1430
Implement panic reporting saving and uploads (#19932)
TODO: 
- [x] check that the app version is well formatted for zed.dev

Release Notes:

- N/A

---------

Co-authored-by: Trace <violet.white.batt@gmail.com>
2024-10-29 23:54:00 -07:00
Piotr Osiewicz
cdddb4d360
Add language toolchains (#19576)
This PR adds support for selecting toolchains for a given language (e.g.
Rust toolchains or Python virtual environments) with support for SSH
projects provided out of the box. For Python we piggy-back off of
[PET](https://github.com/microsoft/python-environment-tools), a library
maintained by Microsoft.
Closes #16421
Closes #7646

Release Notes:

- Added toolchain selector to the status bar (with initial support for
Python virtual environments)
2024-10-28 15:34:03 +01:00