Commit graph

81 commits

Author SHA1 Message Date
Piotr Osiewicz
9826b7b5c1
debugger: Add extensions support (#30625)
Closes #ISSUE

Release Notes:

- N/A

---------

Co-authored-by: Anthony <anthony@zed.dev>
2025-05-13 22:42:51 +00:00
Marshall Bowers
18e911002f
zed_extension_api: Fork new version of extension API (#30611)
This PR forks a new version of the `zed_extension_api` in preparation
for new changes.

Release Notes:

- N/A
2025-05-13 08:35:15 +00:00
Marshall Bowers
58ed81b698
extension_host: Include more details about error messages (#30543)
This PR makes it so the error messages surfaced to extensions will
contain more information.

Supersedes https://github.com/zed-industries/zed/pull/28491.

Release Notes:

- N/A
2025-05-12 09:21:37 +00:00
Piotr Osiewicz
b091581e4b
debugger/extensions: Revert changes to extension store related to language config (#30225)
Revert #29945 

Release Notes:

- N/A

---------

Co-authored-by: Conrad <conrad@zed.dev>
2025-05-08 14:01:39 +02:00
Piotr Osiewicz
09d3ff9dbe
debugger: Rework language association with the debuggers (#29945)
- Languages now define their preferred debuggers in `config.toml`.
- `LanguageRegistry` now exposes language config even for languages that
are not yet loaded. This necessitated extension registry changes (we now
deserialize config.toml of all language entries when loading new
extension index), but it should be backwards compatible with the old
format. /cc @maxdeviant

Release Notes:

- N/A

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Remco Smits <djsmits12@gmail.com>
Co-authored-by: Anthony <anthony@zed.dev>
2025-05-06 20:16:41 +02:00
Bennet Bo Fenner
9cb5ffac25
context_store: Refactor state management (#29910)
Because we instantiated `ContextServerManager` both in `agent` and
`assistant-context-editor`, and these two entities track the running MCP
servers separately, we were effectively running every MCP server twice.

This PR moves the `ContextServerManager` into the project crate (now
called `ContextServerStore`). The store can be accessed via a project
instance. This ensures that we only instantiate one `ContextServerStore`
per project.

Also, this PR adds a bunch of tests to ensure that the
`ContextServerStore` behaves correctly (Previously there were none).

Closes #28714
Closes #29530

Release Notes:

- N/A
2025-05-05 21:36:12 +02:00
Bennet Bo Fenner
9147f89257
zed_extension_api: Release v0.5.0 (#29802)
This PR releases v0.5.0 of the Zed extension API.

Support for this version of the extension API will land in Zed v0.186.x.

Release Notes:

- N/A
2025-05-02 15:58:54 +00:00
Bennet Bo Fenner
24eb039752
context servers: Show configuration modal when extension is installed (#29309)
WIP

Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-authored-by: Cole Miller <m@cole-miller.net>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Oleksiy Syvokon <oleksiy.syvokon@gmail.com>
2025-05-01 20:02:14 +02:00
Marshall Bowers
2cc5a0de26
zed_extension_api: Fork new version of extension API (#29579)
This PR forks a new version of the `zed_extension_api` in preparation
for new changes.

Release Notes:

- N/A
2025-04-29 01:24:13 +00:00
tidely
f060918b57
zed: Remove unnecessary clones (#29513)
`App::http_client` and `Client::http_client` both return an owned `Arc`
which it clones internally. This means we can remove unnecessary clones
when calling these methods.

Release Notes:

- N/A
2025-04-27 19:23:37 -07:00
Julia Ryan
f11c749353
VSCode Settings import (#29018)
Things this doesn't currently handle:

- [x] ~testing~
- ~we really need an snapshot test that takes a vscode settings file
with all options that we support, and verifies the zed settings file you
get from importing it, both from an empty starting file or one with lots
of conflicts. that way we can open said vscode settings file in vscode
to ensure that those options all still exist in the future.~
- Discussed this, we don't think this will meaningfully protect us from
future failures, and we will just do this as a manual validation step
before merging this PR. Any imports that have meaningfully complex
translation steps should still be tested.
- [x] confirmation (right now it just clobbers your settings file
silently)
- it'd be really cool if we could show a diff multibuffer of your
current settings with the result of the vscode import and let you pick
"hunks" to keep, but that's probably too much effort for this feature,
especially given that we expect most of the people using it to have an
empty/barebones zed config when they run the import.
- [x] ~UI in the "welcome" page~
- we're planning on redoing our welcome/walkthrough experience anyways,
but in the meantime it'd be nice to conditionally show a button there if
we see a user level vscode config
- we'll add it to the UI when we land the new walkthrough experience,
for now it'll be accessible through the action
- [ ] project-specific settings
- handling translation of `.vscode/settings.json` or `.code-workspace`
settings to `.zed/settings.json` will come in a future PR, along with UI
to prompt the user for those actions when opening a project with local
vscode settings for the first time
- [ ] extension settings
- we probably want to do a best-effort pass of popular extensions like
vim and git lens
- it's also possible to look for installed/enabled extensions with `code
--list-extensions`, but we'd have to maintain some sort of mapping of
those to our settings and/or extensions
- [ ] LSP settings
- these are tricky without access to the json schemas for various
language server extensions. we could probably manage to do translations
for a couple popular languages and avoid solving it in the general case.
- [ ] platform specific settings (`[macos].blah`)
  - this is blocked on #16392 which I'm hoping to address soon
- [ ] language specific settings (`[rust].foo`)
  - totally doable, just haven't gotten to it yet
 
~We may want to put this behind some kind of flag and/or not land it
until some of the above issues are addressed, given that we expect
people to only run this importer once there's an incentive to get it
right the first time. Maybe we land it alongside a keymap importer so
you don't have to go through separate imports for those?~

We are gonna land this as-is, all these unchecked items at the bottom
will be addressed in followup PRs, so maybe don't run the importer for
now if you have a large and complex VsCode settings file you'd like to
import.

Release Notes:

- Added a VSCode settings importer, available via a
`zed::ImportVsCodeSettings` action

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-04-23 20:54:09 +00:00
Marshall Bowers
a2a502f026
zed_extension_api: Release v0.4.0 (#29237)
This PR releases v0.4.0 of the Zed extension API.

Support for this version of the extension API will land in Zed v0.184.x.

Release Notes:

- N/A
2025-04-22 21:07:52 +00:00
Julia Ryan
01ec6e0f77
Add workspace-hack (#27277)
This adds a "workspace-hack" crate, see
[mozilla's](https://hg.mozilla.org/mozilla-central/file/3a265fdc9f33e5946f0ca0a04af73acd7e6d1a39/build/workspace-hack/Cargo.toml#l7)
for a concise explanation of why this is useful. For us in practice this
means that if I were to run all the tests (`cargo nextest r
--workspace`) and then `cargo r`, all the deps from the previous cargo
command will be reused. Before this PR it would rebuild many deps due to
resolving different sets of features for them. For me this frequently
caused long rebuilds when things "should" already be cached.

To avoid manually maintaining our workspace-hack crate, we will use
[cargo hakari](https://docs.rs/cargo-hakari) to update the build files
when there's a necessary change. I've added a step to CI that checks
whether the workspace-hack crate is up to date, and instructs you to
re-run `script/update-workspace-hack` when it fails.

Finally, to make sure that people can still depend on crates in our
workspace without pulling in all the workspace deps, we use a `[patch]`
section following [hakari's
instructions](https://docs.rs/cargo-hakari/0.9.36/cargo_hakari/patch_directive/index.html)

One possible followup task would be making guppy use our
`rust-toolchain.toml` instead of having to duplicate that list in its
config, I opened an issue for that upstream: guppy-rs/guppy#481.

TODO:
- [x] Fix the extension test failure
- [x] Ensure the dev dependencies aren't being unified by Hakari into
the main dependencies
- [x] Ensure that the remote-server binary continues to not depend on
LibSSL

Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2025-04-02 13:26:34 -07:00
Piotr Osiewicz
dc64ec9cc8
chore: Bump Rust edition to 2024 (#27800)
Follow-up to https://github.com/zed-industries/zed/pull/27791

Release Notes:

- N/A
2025-03-31 20:55:27 +02:00
Piotr Osiewicz
0729d24d77
chore: Prepare for Rust edition bump to 2024 (without autofix) (#27791)
Successor to #27779 - in this PR I've applied changes manually, without
futzing with if let lifetimes at all.

Release Notes:

- N/A
2025-03-31 20:10:36 +02:00
Marshall Bowers
b5dc09c0ca
Remove unneeded anonymous lifetimes from gpui::Context (#27686)
This PR removes a number of unneeded anonymous lifetimes from usages of
`gpui::Context`.

Release Notes:

- N/A
2025-03-28 19:26:30 +00:00
张小白
9f72e05c40
windows: Fix extension uninstall (#18467)
Closes #18153


When calling `uninstall_extension`, the `work_dir` associated with this
`extension` doesn't have its corresponding `FileHandle` properly closed,
preventing the deletion of the `work_dir`. As seen in the image below,
after installing the `toml` extension, `zed.exe` holds two `Handle`s for
the folder `C:\Users\36477\AppData\Local\Zed\extensions\work\toml`.

![Screenshot 2024-09-27
171149](https://github.com/user-attachments/assets/f75f3f6f-9a62-43b5-9450-73ee1ed8e7f9)


Therefore, after deleting `extension_dir` and then calling
`this.update(...)`, `zed.exe` releases these two `Handles`, and only
then can the folder
`C:\Users\36477\AppData\Local\Zed\extensions\work\toml` be deleted. See
the corresponding file handles are closed after calling
`this.update(...)`:

![Screenshot 2024-09-28
132823](https://github.com/user-attachments/assets/476e0494-850a-4af5-b351-899e60ae98f7)

However, if there is a running server of the extension, the error will
persist. At this point, I haven’t found a direct way to terminate all
running servers of the extension. Since this feature might affect the
`LspStore` structure, I paused my work here.


See when `toml` extension is running, we can not delete
`C:\Users\36477\AppData\Local\Zed\extensions\work\toml` since
`C:\Users\36477\AppData\Local\Zed\extensions\work\toml\taplo.exe` is
still running:

![Screenshot 2024-09-28
134709](https://github.com/user-attachments/assets/6801d6e2-2a44-4103-8570-467c507e6e20)



cc @ConradIrwin You're the expert in this area—what are your thoughts?



Release Notes:

- N/A
2025-03-28 13:52:48 +08:00
Antonio Scandurra
7354ef91e1
Make GitRepository::status async and remove cx parameter (#27514)
This lays the groundwork for using `status` as part of the new agent
panel.

Release Notes:

- N/A
2025-03-27 09:05:54 +00:00
Marshall Bowers
e67ad1a1b6
extension_host: Rename Extension variants so that the version number components are clearer (#27507)
This PR renames the variants of the `Extension` enum with delimiters
between the version number components so that it's clearer which version
of the extension API they refer to.

Release Notes:

- N/A
2025-03-26 15:54:14 +00:00
Smit Barmase
8f1023360d
extension: Add support for additional_workspace_configuration and additional_initialization_options (#27407)
Closes #22410

With this PR extensions can provide additional workspace configuration
for other LSP Adapters. This allows extensions like Astro, Svelte, Vue,
etc to provide plugins for vtsls typescript server, fixing issues like:
https://github.com/zed-industries/zed/issues/4577,
https://github.com/zed-industries/zed/issues/21697,
https://github.com/zed-industries/zed/issues/26901#issuecomment-2737485096

Todo:

- [x] Test case when extension is installed, does vtsls workspace config
refreshes?

Before:
<img width="450" alt="image"
src="https://github.com/user-attachments/assets/f242167c-5264-44ab-b5a7-8c90eb75c6a1"
/>

After:
<img width="450" alt="image"
src="https://github.com/user-attachments/assets/6a5f1afe-a0e1-4f64-8a95-919b0bf97614"
/>

Release Notes:

- N/A
2025-03-25 18:23:59 +05:30
Marshall Bowers
920eda07a5
zed_extension_api: Fork new version of extension API (#27390)
This PR forks a new version of the `zed_extension_api` in preparation
for new changes.

Release Notes:

- N/A
2025-03-24 17:06:05 -04:00
Junseong Park
07727f939e
Update docs for some settings (#27293)
- update tooltips of `auto_install_extensions` , `active_pane_modifiers`
- update docs of `auto_install_extensions`, `active_pane_modifiers`,
`buffer_line_height`

Release Notes:

- N/A

---------

Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
2025-03-24 13:05:06 +02:00
João Marcos
9f0b09007b
Rename LSP function and simplify tests (#27313)
While working on a fix I found opportunities to improve readability, but
it's a big rename diff, so I'm landing separately.

Release Notes:

- N/A
2025-03-22 19:23:11 +00:00
David Barsky
7ade7d8e45
lsp-config: Allow setting a server's environment variables (#27213)
Closes https://github.com/zed-industries/zed/issues/14334, allowing
users to set environment variables for a language server binary like:

```json
"lsp": {
  "rust-analyzer": {
    "binary": {
      "path": "/Users/dbarsky/.cargo/bin/rust-analyzer",
      "env": {
        "RA_PROFILE": "*>100"
      }
    },
  }
}
```

The newly introduced environment variables are merged with the shell
environment. Perhaps more controversially, I've _also_ removed the
trimming/`stderr:`-prefixing of language server logs. This because
rust-analyzer has some nice, tree-shaped profiling built-in, and it
prevents us from printing profiles like this:

<details>
<img width="1147" alt="Screenshot 2025-03-20 at 12 09 14 PM"
src="https://github.com/user-attachments/assets/b7066651-6394-492b-b745-906c66d3c7b2"
/>
</details>

Release Notes:

- Added the ability to set a language server's environment variables.
- Removed the `stderr`-prefix of a language server's stderr logs.
2025-03-21 09:15:41 +02:00
Marshall Bowers
c60a7034c8
context_server: Interpret context server command paths relative to the extension's work dir (#27201)
This PR fixes an issues where the commands returned from context server
extensions were being used as-is instead of interpreting them relative
to the extension's work dir.

Release Notes:

- Fixed an issue with context server paths not being interpreted
relative to the extension's work dir.

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Thomas Mickley-Doyle <tmickleydoyle@gmail.com>
2025-03-20 16:36:40 +00:00
Mikayla Maki
1aefa5178b
Move "async move" a few characters to the left in cx.spawn() (#26758)
This is the core change:
https://github.com/zed-industries/zed/pull/26758/files#diff-044302c0d57147af17e68a0009fee3e8dcdfb4f32c27a915e70cfa80e987f765R1052

TODO:
- [x] Use AsyncFn instead of Fn() -> Future in GPUI spawn methods
- [x] Implement it in the whole app
- [x] Implement it in the debugger 
- [x] Glance at the RPC crate, and see if those box future methods can
be switched over. Answer: It can't directly, as you can't make an
AsyncFn* into a trait object. There's ways around that, but they're all
more complex than just keeping the code as is.
- [ ] Fix platform specific code

Release Notes:

- N/A
2025-03-19 02:09:02 +00:00
Remco Smits
41a60ffecf
Debugger implementation (#13433)
###  DISCLAIMER

> As of 6th March 2025, debugger is still in development. We plan to
merge it behind a staff-only feature flag for staff use only, followed
by non-public release and then finally a public one (akin to how Git
panel release was handled). This is done to ensure the best experience
when it gets released.

### END OF DISCLAIMER 

**The current state of the debugger implementation:**


https://github.com/user-attachments/assets/c4deff07-80dd-4dc6-ad2e-0c252a478fe9


https://github.com/user-attachments/assets/e1ed2345-b750-4bb6-9c97-50961b76904f

----

All the todo's are in the following channel, so it's easier to work on
this together:
https://zed.dev/channel/zed-debugger-11370

If you are on Linux, you can use the following command to join the
channel:
```cli
zed https://zed.dev/channel/zed-debugger-11370 
```

## Current Features

- Collab
  - Breakpoints
    - Sync when you (re)join a project
    - Sync when you add/remove a breakpoint
  - Sync active debug line
  - Stack frames
    - Click on stack frame
      - View variables that belong to the stack frame
      - Visit the source file
    - Restart stack frame (if adapter supports this)
  - Variables
  - Loaded sources
  - Modules
  - Controls
    - Continue
    - Step back
      - Stepping granularity (configurable)
    - Step into
      - Stepping granularity (configurable)
    - Step over
      - Stepping granularity (configurable)
    - Step out
      - Stepping granularity (configurable)
  - Debug console
- Breakpoints
  - Log breakpoints
  - line breakpoints
  - Persistent between zed sessions (configurable)
  - Multi buffer support
  - Toggle disable/enable all breakpoints
- Stack frames
  - Click on stack frame
    - View variables that belong to the stack frame
    - Visit the source file
    - Show collapsed stack frames
  - Restart stack frame (if adapter supports this)
- Loaded sources
  - View all used loaded sources if supported by adapter.
- Modules
  - View all used modules (if adapter supports this)
- Variables
  - Copy value
  - Copy name
  - Copy memory reference
  - Set value (if adapter supports this)
  - keyboard navigation
- Debug Console
  - See logs
  - View output that was sent from debug adapter
    - Output grouping
  - Evaluate code
    - Updates the variable list
    - Auto completion
- If not supported by adapter, we will show auto-completion for existing
variables
- Debug Terminal
- Run custom commands and change env values right inside your Zed
terminal
- Attach to process (if adapter supports this)
  - Process picker
- Controls
  - Continue
  - Step back
    - Stepping granularity (configurable)
  - Step into
    - Stepping granularity (configurable)
  - Step over
    - Stepping granularity (configurable)
  - Step out
    - Stepping granularity (configurable)
  - Disconnect
  - Restart
  - Stop
- Warning when a debug session exited without hitting any breakpoint
- Debug view to see Adapter/RPC log messages
- Testing
  - Fake debug adapter
    - Fake requests & events

---

Release Notes:

- N/A

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Anthony <anthony@zed.dev>
Co-authored-by: Piotr Osiewicz <peterosiewicz@gmail.com>
Co-authored-by: Piotr <piotr@zed.dev>
2025-03-18 12:55:25 -04:00
Kirill Bulatov
566c5f91a7
Refine word completions (#26779)
Follow-up of https://github.com/zed-industries/zed/pull/26410

* Extract word completions into their own, `editor::ShowWordCompletions`
action so those could be triggered independently of completions
* Assign `ctrl-shift-space` binding to this new action
* Still keep words returned along the completions as in the original PR,
but:
* Tone down regular completions' fallback logic, skip words when the
language server responds with empty list of completions, but keep on
adding words if nothing or an error were returned instead
    * Adjust the defaults to wait for LSP completions infinitely
* Skip "words" with digits such as `0_usize` or `2.f32` from completion
items, unless a completion query has digits in it

Release Notes:

- N/A
2025-03-14 15:18:55 +00:00
Ben Kunkle
25f407baab
settings: Auto-update JSON schemas for settings when extensions are un/installed (#26633)
Because of #26562, it is now possible to subscribe to extension update
events within the LSP store, where we can then update the Schemas sent
to the JSON LSP resulting in dynamic updates to the auto-complete
suggestions and diagnostics in settings. Notably, this means newly
installed languages and (icon) themes will auto-complete correctly as
soon as the extension is installed.

Closes #15436

Release Notes:

- Fixed an issue where autocomplete suggestions and diagnostics for
languages and (icon) themes in settings would not update when the
extension with which they were added was installed or uninstalled
2025-03-13 16:50:07 +00:00
Marshall Bowers
acf9b22466
extension: Add ExtensionEvents for listening to extension-related events (#26562)
This PR adds a new `ExtensionEvents` event bus that can be used to
listen for extension-related events throughout the app.

Today you need to have a handle to the `ExtensionStore` (which entails
depending on `extension_host`) in order to listen for extension events.

With this change subscribers only need to depend on `extension`, which
has a leaner dependency graph.

Release Notes:

- N/A
2025-03-12 17:01:52 +00:00
Marshall Bowers
9902cd54ce
extension_host: Remove restriction of extension API v0.3.0 to development builds (#26498)
Forgot to do this in #26495.

Release Notes:

- N/A
2025-03-11 23:22:31 +00:00
Marshall Bowers
96510b72b8
zed_extension_api: Release v0.3.0 (#26495)
This PR releases v0.3.0 of the Zed extension API.

Support for this version of the extension API will land in Zed v0.178.x.

Release Notes:

- N/A
2025-03-11 22:54:44 +00:00
Conrad Irwin
63091459d8
Allow too many arguments (#26375)
This is nearly half of our #allows, and seems like something we happily
break whenever we need

Release Notes:

- N/A
2025-03-10 13:38:30 -06:00
Marshall Bowers
6fd9708eee
extension: Add capabilities for the process API (#26224)
This PR adds support for capabilities for the extension process API.

In order to use the process API, an extension must declare which
commands it wants to use, with arguments:

```toml
[[capabilities]]
kind = "process:exec"
command = "echo"
args = ["hello!"]
```

A `*` can be used to denote a single wildcard in the argument list:

```toml
[[capabilities]]
kind = "process:exec"
command = "echo"
args = ["*"]
```

And `**` can be used to denote a wildcard for the remaining arguments:

```toml
[[capabilities]]
kind = "process:exec"
command = "ls"
args = ["-a", "**"]
```

Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-03-06 11:55:00 -05:00
Piotr Osiewicz
e4e758db3a
Rust 1.85 (#25272)
Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2025-02-28 18:33:35 +01:00
Marshall Bowers
4d106a4b0b
zed_extension_api: Add simple process API (#25399)
This PR adds a simple API for working with processes to the extension
API.

The API is designed to mirror Rust's
[`std::process::Command`](https://doc.rust-lang.org/std/process/struct.Command.html).

Release Notes:

- N/A
2025-02-22 18:05:36 +00:00
Marshall Bowers
ec56755f9e
Eagerly load the active theme and icon theme (#25368)
This PR adds eager loading of the active theme and icon theme set in the
user settings.

Previously for themes and icon themes that were provided by extensions,
we would have to wait until extensions were loaded before we could apply
the themes.

In some cases this could lead to a visible delay during which time the
user would see the default themes, and then switch to their desired
themes once extensions had loaded.

To avoid this, we now take a fast path of loading the active themes
directly from the filesystem so that we can load them as soon as
possible.

Closes #10173 and #25305.

Release Notes:

- Added eager loading of the active theme and icon theme. This should
address some reports of seeing the default themes briefly on startup.
2025-02-21 23:57:55 +00:00
Marshall Bowers
a9e753fc07
extension_host: Remove duplicate linker registration (#25361)
This PR fixes a panic that would occur when loading an extension using
v0.2.0 of the extension API after #25357 landed:

```
Thread "<unnamed>" panicked with "called `Result::unwrap()` on an `Err` value: map entry `zed:extension/github` defined twice" at crates/extension_host/src/wasm_host/wit.rs:38:31
10a6cd00e7/src/crates/extension_host/src/wasm_host/wit.rs (L38) (may not be uploaded, line may be incorrect if files modified)
   0: backtrace::backtrace::libunwind::trace
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.74/src/backtrace/libunwind.rs:116:5
      backtrace::backtrace::trace_unsynchronized
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.74/src/backtrace/mod.rs:66:5
   1: backtrace::backtrace::trace
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.74/src/backtrace/mod.rs:53:14
   2: backtrace::capture::Backtrace::create
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.74/src/capture.rs:292:9
   3: backtrace::capture::Backtrace::new
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.74/src/capture.rs:257:22
   4: zed::reliability::init_panic_hook::{{closure}}
             at /Users/maxdeviant/projects/zed/crates/zed/src/reliability.rs:56:29
   5: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/alloc/src/boxed.rs:2084:9
      std::panicking::rust_panic_with_hook
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:808:13
   6: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:674:13
   7: std::sys::backtrace::__rust_end_short_backtrace
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/backtrace.rs:168:18
   8: rust_begin_unwind
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:665:5
   9: core::panicking::panic_fmt
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:74:14
  10: core::result::unwrap_failed
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/result.rs:1679:5
  11: core::result::Result<T,E>::unwrap
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/result.rs:1102:23
      extension_host::wasm_host::wit::new_linker
             at /Users/maxdeviant/projects/zed/crates/extension_host/src/wasm_host/wit.rs:38:5
  12: extension_host::wasm_host::wit::since_v0_2_0::linker::{{closure}}
             at /Users/maxdeviant/projects/zed/crates/extension_host/src/wasm_host/wit/since_v0_2_0.rs:43:9
  13: std::sync::once_lock::OnceLock<T>::get_or_init::{{closure}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sync/once_lock.rs:276:50
  14: std::sync::once_lock::OnceLock<T>::initialize::{{closure}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sync/once_lock.rs:483:19
  15: std::sync::once::Once::call_once_force::{{closure}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sync/once.rs:217:40
  16: std::sys::sync::once::queue::Once::call
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/sync/once/queue.rs:183:21
  17: std::sync::once::Once::call_once_force
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sync/once.rs:217:9
  18: std::sync::once_lock::OnceLock<T>::initialize
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sync/once_lock.rs:482:9
  19: std::sync::once_lock::OnceLock<T>::get_or_try_init
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sync/once_lock.rs:364:9
  20: std::sync::once_lock::OnceLock<T>::get_or_init
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sync/once_lock.rs:276:15
  21: extension_host::wasm_host::wit::since_v0_2_0::linker
             at /Users/maxdeviant/projects/zed/crates/extension_host/src/wasm_host/wit/since_v0_2_0.rs:42:5
  22: extension_host::wasm_host::wit::Extension::instantiate_async::{{closure}}
             at /Users/maxdeviant/projects/zed/crates/extension_host/src/wasm_host/wit.rs:122:17
  23: extension_host::wasm_host::WasmHost::load_extension::{{closure}}
             at /Users/maxdeviant/projects/zed/crates/extension_host/src/wasm_host.rs:385:14
  24: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/future/future.rs:123:9
  25: async_task::raw::RawTask<F,T,S,M>::run
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-task-4.7.1/src/raw.rs:557:17
  26: async_task::runnable::Runnable<M>::run
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-task-4.7.1/src/runnable.rs:781:18
  27: gpui::platform::mac::dispatcher::trampoline
             at /Users/maxdeviant/projects/zed/crates/gpui/src/platform/mac/dispatcher.rs:106:5
  28: <unknown>
  29: <unknown>
  30: <unknown>
  31: _pthread_mach_thread_np
```

We don't need the added `add_to_linker` calls anymore.

Release Notes:

- N/A
2025-02-21 21:20:19 +00:00
Marshall Bowers
f6f6980463
zed_extension_api: Fork new version of extension API (#25357)
This PR forks a new version of the `zed_extension_api` in preparation
for new changes.

Release Notes:

- N/A
2025-02-21 20:00:46 +00:00
Cole Miller
c0c48d30db
Revert "file_finder: Remove common segments of long paths in search results (#25049)" (#25163)
This reverts commit 9ef0501853 due to a
panic.

```
{
  "thread": "main",
  "payload": "9 is not a valid char boundary in path \"crates/…/LiveKitBridge/\"",
  "location_data": {
    "file": "crates/file_finder/src/file_finder.rs",
    "line": 646
  }
}
```

Release Notes:

- N/A
2025-02-19 15:32:29 +00:00
Michael Sloan
b1872e3afd
cx.background_executor().spawn(...) -> cx.background_spawn(...) (#25103)
Done automatically with

> ast-grep -p '$A.background_executor().spawn($B)' -r
'$A.background_spawn($B)' --update-all --globs "\!crates/gpui"

Followed by:

* `cargo fmt`
* Unexpected need to remove some trailing whitespace.
* Manually adding imports of `gpui::{AppContext as _}` which provides
`background_spawn`
* Added `AppContext as _` to existing use of `AppContext`

Release Notes:

- N/A
2025-02-18 20:30:33 +00:00
Marshall Bowers
c10ac31866
theme: Don't log errors for missing themes until extensions have loaded (#25098)
This PR makes it so we don't log errors for missing themes or icon
themes until after the extensions have been loaded.

Currently, if you are using a theme that is defined in an extension it
is common to see one or more "theme not found" errors in the logs. This
is the result of us having to initialize the theme before the extensions
have actually finished loading.

This means that a theme that _may_ exist once extensions load is
considered non-existent before they have loaded.

To that end, we now wait until the extensions have loaded before we
start logging errors if we can't find the theme or icon theme.

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

Release Notes:

- Reduced the number of "theme not found" and "icon theme not found"
errors in the logs for themes provided by extensions.
2025-02-18 17:47:25 +00:00
Cole Miller
9ef0501853
file_finder: Remove common segments of long paths in search results (#25049)
This PR makes progress on #7711 by identifying any common prefix of the
paths in the file finder's search results, and replacing the "interior"
of that prefix---every path segment but the first and last---with `...`,
when a heuristic indicates that the longest path would otherwise
overflow the modal.

The elision is not applied to any segment that contains a match for the
search query.

There may be more work to do on #7711 in the case of long result paths
that do not share a significant common prefix.

Release Notes:

- Improved display of long paths in the file finder modal

Co-authored-by: Max <max@zed.dev>
2025-02-18 10:09:15 -05:00
Max Brunsfeld
813d870a03
Bump Tree-sitter for bug fixes affecting YAML parser loaded via WASM (#25054)
Closes https://github.com/zed-industries/zed/issues/24742
Closes #24632

This PR bumps Tree-sitter to bring in bug fixes:
* https://github.com/tree-sitter/tree-sitter/pull/4218
* https://github.com/tree-sitter/tree-sitter/pull/4213
* https://github.com/tree-sitter/tree-sitter/pull/4210

I've also bumped Wasmtime and wit-bindgen, since the new Tree-sitter
uses a newer wasmtime.

Release Notes:

- Fixed a parsing bug that caused memory leaks and crashes when using
the Ansible extension

---------

Co-authored-by: Anthony <anthony@zed.dev>
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2025-02-17 21:29:27 -08:00
Piotr Osiewicz
a618830aea
project: Fine-grained language server management (#24038)
Closes #ISSUE
https://github.com/zed-industries/zed/pull/23804
Release Notes:

- Improved detection of project roots for use by language servers.

Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: smit <0xtimsb@gmail.com>
Co-authored-by: Henrikh Kantuni <henrikh.kantuni@gmail.com>
Co-authored-by: Caleb! <48127194+kaf-lamed-beyt@users.noreply.github.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Agus Zubiaga <agus@zed.dev>
Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
2025-02-14 15:41:49 +01:00
Liam Murphy
72e1947025
Update tree-sitter to 0.24 (#24492)
I didn't update it to 0.25 because its Wasm support seems to be
partially broken due to
https://github.com/tree-sitter/tree-sitter/pull/3938: it didn't
introduce a check that the Wasm module's ABI is new enough to include
supertype info while parsing it, and so in the case where it isn't it
ends up interpreting random bytes as the number of supertypes, causing
out-of-bounds memory accesses.

Closes #24489

Release Notes:

- Fixed a rare crash during syntax highlighting
2025-02-10 10:52:27 -08:00
Finn Evers
144487bf1a
theme: Implement icon theme reloading (#24449)
Closes #24353 

This PR implements icon theme reload to ensure file icons are properly
updated whenever an icon theme extension is upgraded or uninstalled.

Currently, on both upgrade and uninstall of an icon theme extension the
file icons from the previously installed version will stay visibile and
will not be updated as shown in the linked issue. With this change, file
icons will properly be updated on extension upgrade or reinstall.

The code is primarily a copy for reloading the current color theme
adapted to work for icon themes. Happy for any feedback!


Release Notes:

- Fixed file icons not being properly updated upon icon theme upgrade or
uninstall.
2025-02-07 11:30:53 -05:00
Marshall Bowers
4e5b11a0a7
extensions_ui: Add general structure for filtering extensions by what they provide (#24325)
This PR adds the general structure for filtering the extensions list by
what the extensions provide.

Currently flagged for Zed staff until we get some design direction on
how best to present the filter.

Release Notes:

- N/A
2025-02-06 00:09:37 +00:00
张小白
74c4dbd237
windows: Fix tests on Windows (#22616)
Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla.c.maki@gmail.com>
2025-02-05 14:30:09 +00:00
Marshall Bowers
f29b33ec85
extensions_ui: Show the filtered icon theme selector when installing an icon theme (#23992)
This PR makes it so when you install an extension with icon themes it
will deploy the icon theme selector filtered down to the newly-installed
icon themes.

This is similar to what we do when installing an extension with themes.

Because we can only have one picker open at a time, when installing an
extension that has _both_ themes and icon themes, the theme selector
will take precedence.

Release Notes:

- N/A
2025-01-31 01:32:13 +00:00