Commit graph

20415 commits

Author SHA1 Message Date
João Marcos
11552cc0bd
Git: reload index before reading it (#27386)
This is one of the causes for race conditions, but isn't a specific bug fix by itself.

Release Notes:

- N/A

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2025-03-24 19:03:57 +00:00
Bennet Bo Fenner
699369995b
assistant2: Rework @mentions (#26983)
https://github.com/user-attachments/assets/167f753f-2775-4d31-bfef-55565e61e4bc

Release Notes:

- N/A
2025-03-24 19:32:52 +01:00
Piotr Osiewicz
e661a0afd6
python: Enable subroot detection for pylsp and pyright (#27364)
This is not going to fully fix the multi-root story, as we still need to
weave venvs through. Hence, no release note just yet.

Release Notes:

- N/A
2025-03-24 18:56:18 +01:00
张小白
57ffd6d78d
Update windows-rs (#27379)
Release Notes:

- N/A
2025-03-24 16:29:18 +00:00
Anthony Eid
350c1e41d2
Serialize breakpoints when changing the state of a breakpoint (#27373)
This fixes a rare bug where a breakpoint isn't saved in the database
when a user toggles a breakpoint and immediately exits out of zed.

Release Notes:

- N/A

Co-authored-by: Piotr Osiewicz <peterosiewicz@gmail.com>
2025-03-24 12:25:17 -04:00
tidely
a23e293ca2
Upgrade xkbcommon to v0.8.0 (#27376)
Switch back to xkbcommon releases after
https://github.com/rust-x-bindings/xkbcommon-rs/pull/54 got merged in
0.8.0

Release Notes:

- N/A
2025-03-24 18:13:46 +02:00
Ben Kunkle
f2be201495
jsx_tag_auto_close: Fix <Foo.Bar> component auto-close (#27374)
- **support alternate tag name node names to fix autoclosing of
`<Foo.Bar>` style tags in TSX**
- **remove checks against close tag name while checking if tag is
closed**
- **move jsx tag auto close tests into jsx_tag_auto_close.rs**

Closes #27335

Release Notes:

- Fixed an issue with JSX tag auto-close where components containing a
`.` access like `<Foo.Bar>` would be auto-closed as `</>` instead of
`</Foo.Bar>`
2025-03-24 15:43:06 +00:00
Richard Feldman
43712285bf
Add move_path tool (#27366)
<img width="629" alt="Screenshot 2025-03-24 at 10 06 39 AM"
src="https://github.com/user-attachments/assets/b099fcc0-b2f4-44ee-8c8f-416808363689"
/>

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-03-24 14:45:19 +00:00
Acaibrid
f38ee81e83
Treat bun.lock as JSONC (#27359)
Closes #27355 
This PR treat `bun.lock` file as `.jsonc`
note: 
[bun.lock](https://bun.sh/blog/bun-lock-text-lockfile) is a lockfile of
bun.js

Release Notes:

- Updated `bun.lock` files to be recognized as JSONC.
2025-03-24 09:46:23 -04:00
Alvaro Parker
ddf8d07f02
Update cosmic text to 0.13.2 (#27362)
Related #14222

Release Notes:

- This PR updates `cosmic-text` dependency on `gpui` crate from `0.11.2`
to 0.13.2`. This decreases RAM usage zed depending on the amount of
monospace fonts installed on the system. On Arch Linux with `nerd-fonts`
package installed (which provides around 2000 monospaced fonts), it
decreases ram usage from ~800mb to around ~300mb.

- Updated `cosmic-text` to `0.13.2` on `gpui` crate
2025-03-24 13:37:41 +00:00
Danilo Leal
7db9077835
assistant2: Polish the thinking card (#27363)
Mostly just adjusting spacing and making it consistent with how we
display other tool calls.

<img
src="https://github.com/user-attachments/assets/85892006-9029-4cb8-b805-bebe4232e458"
width="600px" />

Release Notes:

- N/A
2025-03-24 10:08:49 -03:00
Nils Koch
4e33aaa55c
markdown_preview: Fix preview not rendering bullet points beginning with HTML (#27018)
Closes #26631

Release Notes:

- Fixed markdown preview not rendering bullet points beginning with HTML

Before:
<img width="822" alt="before"
src="https://github.com/user-attachments/assets/102a7eac-fcc2-457b-9587-4a021800841d"
/>


After:
<img width="822" alt="after"
src="https://github.com/user-attachments/assets/8544b318-0efa-46c3-bd9b-c6c21444fab7"
/>

Note: I thought it would make sense to return `true` in `is_text_like`
for `Event::InlineMath` and `Event::DisplayMath` as well, but it looks
like rendering inline math is not supported at all at the moment:


4402e033a4/crates/markdown/src/parser.rs (L108)
2025-03-24 13:57:06 +01:00
Thorben Kröger
d253d46fdf
Make python's file, line output clickable in terminal (#26903)
Closes #16004.


![image](https://github.com/user-attachments/assets/73cfe9da-5575-4616-9ed0-99fcb3ab61f5)

Python formats file and line number references in the form `File
"file.py", line 8"`
I'm not a CPython expert, but from a quick look, they appear to come
from:
-
80e00ecc39/Python/traceback.c (L613)
-
80e00ecc39/Python/traceback.c (L927)
I am not aware of the possiblity to also encode the column information.

Release Notes:

- File, line references from Python, like 'File "file.py", line 8' are
now clickable in the terminal

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2025-03-24 12:36:14 +00: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
chbk
f4d1e7901c
Improve Regex syntax highlighting (#25332)
Release Notes:

  - Improved Regex syntax highlighting

| Zed 0.174.6 | With this PR |
| --- | --- |
|
![Image](https://github.com/user-attachments/assets/2a0bb1d9-cbba-490c-b2be-08c94bc79517)
|
![Image](https://github.com/user-attachments/assets/b19f3871-ee83-4165-a026-207bdbbcad44)
|

- `(?P=`, `<`: `punctuation.bracket`
- `group_name`: `property` -> `label`
- `^`, `$`: `string.escape` -> `operator`
- `\b`, `\B`, `\k`: `string.escape` -> `keyword.operator`
- added `regex` scope to target regex tokens specifically

```js
regex = /^(?<group>[!\.\?])\b[a-z]+word\k<group>$/g
```

---------

Co-authored-by: João Marcos <marcospb19@hotmail.com>
2025-03-22 16:11:19 -03:00
Smit Barmase
044eb7b990
extensions_ui : Scroll to top on filter change (#27305)
Closes #27100


https://github.com/user-attachments/assets/0fc1409d-01c1-4caa-a2ed-762c8951930f

Release Notes:

- N/A
2025-03-22 18:38:01 +05:30
Smit Barmase
d96a50b029
extensions_ui: Add scrollbar (#27303)
This PR adds scrollbar to extensions page. 

For now haven't added setting to hide or configure this scrollbar, can
be handled later.

<img width="1258" alt="image"
src="https://github.com/user-attachments/assets/0d260051-5e4a-4e3f-9738-b5c5a988419e"
/>


Release Notes:

- Added scrollbar to extensions page.
2025-03-22 17:56:36 +05:30
Smit Barmase
b5e5959339
terminal: Make alternate_scroll on by default (#27302)
Most terminal emulators, like macOS Terminal, Alacritty, and Ghostty,
have alternate scroll turned on by default. I think it makes sense for
the Zed terminal to do the same and make it more of an opt-out feature.

Release Notes:

- N/A
2025-03-22 17:56:19 +05:30
João Marcos
9918b6cade
Scroll to follow expanding part of editor::SelectLargerSyntaxNode (#27295)
When the selection grows both ways, the new code prioritizes the top
part instead of bottom one, this is usually more helpful considering
that most programming language grammars tend to define tokens right
before large delimited blocks, and rarely after (because humans and
parsers read from top to bottom).

Also, revert selection when convenient, so you have more control over
what you're selecting, looking at the selection `head` is commonly more
convenient than at the `tail`.

Release Notes:

- Improve scrolling of `editor::SelectLargerSyntaxNode` for better
visibility.
2025-03-22 09:06:13 +00:00
AidanV
fa677bdc38
vim: Single quote mark (#27231)
Closes #22398

Release Notes:

- vim: Adds `'` and `"` marks (last location jumped from in the current
buffer, and location when last exiting a buffer)

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-03-22 05:45:57 +00:00
AidanV
d82b547596
vim: View Marks (#26885)
Closes #26884

Release Notes:

- vim: Added `:marks` which brings up list of current marks
- confirming on selected mark in the view jumps to that mark

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-03-22 04:46:04 +00:00
Richard Feldman
4c86cda909
Prompt before running some tools (#27284)
Also includes some fixes for how the Lua tool was being generated.

<img width="644" alt="Screenshot 2025-03-21 at 6 26 18 PM"
src="https://github.com/user-attachments/assets/51bd1685-5b3f-4ed3-b11e-6fa8017847d4"
/>


Release Notes:

- N/A

---------

Co-authored-by: Ben <ben@zed.dev>
Co-authored-by: Agus Zubiaga <agus@zed.dev>
Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Ben Kunkle <ben.kunkle@gmail.com>
2025-03-22 00:05:34 -04:00
Conrad Irwin
90649fbc89
Automatically expand context for inline assistant to nearest block (#27282)
Release Notes:

- Inline assistant will now expand empty selections to the block under
the cursor.

Co-authored-by: andrew j <andjones100@gmail.com>
2025-03-21 21:24:27 -06:00
Ben Kunkle
c783fd072f
zed: Add --system-specs arg (#27285)
Adds the `--system-specs` flag to the Zed binary, so that users who wish
to report issues can retrieve their system specs, even if Zed is failing
to launch

Still TODO:
- [x] Test and do best effort GPU info detection on Linux
- [ ] Modify GitHub issue templates to tell users that the flag is
available if they are unable to launch Zed

Release Notes:

- Added the `--system-specs` flag to the Zed binary (not the cli!), to
retrieve the system specs we ask for in GitHub issues without needing to
open Zed
2025-03-22 02:56:25 +00:00
Martin Fischer
85a761cb2b
markdown_preview: Fix rendering image not at all or too often (#25592)
Before MarkdownParagraphChunk::Image was pushed for every Text event if
we're currently inside an image. This was wrong since pulldown-cmark
parses `![](foo)` as:

Start(Image { link_type: Inline, dest_url: "foo", title: "", id: "" })
    End(Image)

If there is no alt text, no Text event is emitted. Which caused images
without any alt text not to be rendered at all.

For alt texts containing inline formatting this was even more obviously
broken since e.g. `![foo *bar* baz](foo)` gets parsed as:

Start(Image { link_type: Inline, dest_url: "foo", title: "", id: "" })
      Text(Borrowed("foo "))
      Start(Emphasis)
        Text(Borrowed("bar"))
      End(Emphasis)
      Text(Borrowed(" baz"))
    End(Image)

which for this example caused the image to appear 3 times in the
preview.

This commit fixes these two bugs which have existed since the
introduction of the image previews in
96854c68ea.

Release Notes:

- Fixed images in the markdown preview appearing not at all or too
often.
2025-03-21 22:17:42 +01:00
Anthony Eid
739f45eb23
Clear breakpoints action (#27254)
This PR adds an action that clears all breakpoints and notifies any
active DAPs.

todo
- [x] Implement clear functionality
- [x] Write an integration test for this

Release Notes:

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

---------

Co-authored-by: Piotr Osiewicz <peterosiewicz@gmail.com>
2025-03-21 20:18:08 +00:00
Ben Kunkle
16ad7424d6
zlog: Init (#27273)
Scaffolding for a revised way of logging in Zed. Very WIP, but the idea
is to allow maintainers to tell users to paste
```json
{
    "log": {
        "project.format": "trace"
    }
}
```
into their settings so that even trace logs are emitted for the log
statements emitted from a logger under the `project.format` scope.

The plan is to eventually implement the `Log` trait from the `log` crate
instead of just wrapping the `log` crate, which will simplify the
implementation greatly, and remove our need for both the `env_logger`
and `simplelog` crates.
Additionally, work will be done to transition to using the scoped
logging APIs throughout the app, focusing on bug hotspots to start
(currently, scoped logging is only used in the format codepath).

Release Notes:

- N/A
2025-03-21 20:08:03 +00:00
Danilo Leal
b32c792b68
assistant2: Polish spacing and alignment (#27264)
Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <1789+nathansobo@users.noreply.github.com>
2025-03-21 16:17:32 -03:00
Sunli
1db621dc50
Refactor TextLayout to use Rc<RefCell> instead of Arc<Mutex> for improved performance (#27177)
Since `TextLayout` is not shared by multiple threads, changing it to
`Rc<RefCell<T>>` should improve performance.

I also found several codes with the same problem. If you think this
change is beneficial, I will continue to improve it in the subsequent
PR. 🙂

Release Notes:

- N/A
2025-03-21 15:06:22 -04:00
Nate Butler
6143da95fc
editor: Fix regression in git label colors due to status color changes (#27272)
This PR fixes the new awkward-looking git status labels due to the
change in version control colors. We want to enable styling version
control colors distinctly from other statuses, but these colors aren't
great for labels as they are meant to be quite high contrast.

We may need to split version control colors into a primary color and a
text color if we want to improve theming this overall.

| Before | After |
|--------|-------|
| ![CleanShot 2025-03-21 at 14 12
22@2x](https://github.com/user-attachments/assets/fadb93b1-06b6-44cc-bf16-7e1279166ed0)
| ![CleanShot 2025-03-21 at 14 12
49@2x](https://github.com/user-attachments/assets/262ffc23-60b9-4cee-8a2b-9e864130912f)
|

Release Notes:

- Fixes a regression in git status colors in the project panel
2025-03-21 18:49:52 +00:00
João Marcos
7ced1b7a90
Fix strikethrough and underline in Linux (#27267)
Follow up to #26827 and #24721, which introduced a bug in Linux.

|before|now|
|---|---|

|![image](https://github.com/user-attachments/assets/6471502d-bf92-4808-ad42-9e0c66569d4f)|!![image](https://github.com/user-attachments/assets/ae45510a-8bc9-4f89-90a0-7496842fecb6)|


Release Notes:

- N/A

Co-authored-by: Jason Lee <huacnlee@gmail.com>
2025-03-21 17:17:25 +00:00
Antonio Scandurra
0e9e2d70cd
Delete unused checkpoints (#27260)
Release Notes:

- N/A
2025-03-21 16:39:01 +00:00
Bennet Bo Fenner
a52e2f9553
Show claude-3-7-sonnet-thinking model for all users (#27256)
Release Notes:

- N/A
2025-03-21 17:23:36 +01:00
Conrad Irwin
a551a6139c
Bump up default timeout (#27250)
Release Notes:

- Extended timeout used when connecting to remote instances
2025-03-21 10:04:39 -06:00
Danilo Leal
c394a3a890
Adjust multibuffer header fold button size (#27253)
This PR adjust the size of the fold button on the multibuffer header.
Had to make the `height` method public on the Button Like to pull that
off without other major changes.

| Before | After |
|--------|--------|
| ![CleanShot 2025-03-21 at 12  11
40@2x](https://github.com/user-attachments/assets/003b2965-b1cc-43ad-8528-2bd11cf0f9cc)
| ![CleanShot 2025-03-21 at 12  11
28@2x](https://github.com/user-attachments/assets/d4927b72-3f41-4c4b-9813-49e676170419)
|

Release Notes:

- N/A
2025-03-21 12:49:54 -03:00
Marshall Bowers
0de5c2ed53
assistant2: Order agent profiles in the order they are defined in settings (#27255)
This PR updates the ordering of the agent profiles in the tool selector
to respect the order they are defined in in the settings instead of
sorting them alphabetically.

This gives the user more control, and allows them to order the profiles
as they desire.

Release Notes:

- N/A
2025-03-21 11:38:02 -04:00
Kirill Bulatov
6397872c49
Persist editor folds between restarts (#27252)
Part of https://github.com/zed-industries/zed/issues/11626


https://github.com/user-attachments/assets/276cca5f-dd87-4496-b1b8-40b211f65aa7

Folds restoration between editor reopens will follow later

Release Notes:

- Started to persist editor folds between restarts
2025-03-21 15:28:11 +00:00
Anthony Eid
93bd32b425
Fix toggling breakpoints not working when text anchor isn't at start (#27249)
This fixes a bug where breakpoint's were unable to be toggled if the
text::Anchor representing the breakpoint position was not at the
beginning of a line.

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-03-21 11:21:05 -04:00
Marshall Bowers
f119550838
assistant2: Define built-in agent profiles in the default settings (#27251)
This PR moves the definitions of the built-in agent profiles into the
default `settings.json`.

It also changes the behavior of how this setting is treated when merging
settings such that the set of profiles will be merged. This is so users
don't clobber the built-in profiles when adding profiles of their own.

Release Notes:

- N/A
2025-03-21 15:11:45 +00:00
Marshall Bowers
4e93e38b0a
assistant2: Sort tools in the tool selector by ID (#27247)
This PR makes it so the tools in the tool selector are sorted by ID so
that they have a deterministic order.

Release Notes:

- N/A
2025-03-21 14:41:27 +00:00
Piotr Osiewicz
05aa8880a4
project: Track manifest locations per unique manifest locator (#27194)
This pull request paves way for exposing manifest tracking to
extensions.
- Project tree was renamed to manifest tree to better reflect it's
intent (and avoid confusion).
- Language server adapters now provide a name of their *manifest
locator*. If multiple language servers refer to the same locator, the
locating code will run just once for a given path.

Release Notes:

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

---------

Co-authored-by: Anthony <anthony@zed.dev>
2025-03-21 15:22:36 +01:00
Marshall Bowers
6bced3a834
assistant2: Ensure scripting tool gets disabled when switching profiles (#27244)
This PR fixes an issue where the scripting tool wasn't being disabled
when switching to a profile that did not have it enabled.

Release Notes:

- N/A
2025-03-21 14:22:00 +00:00
Antonio Scandurra
e14ebcf267
Show "Restore Checkpoint" only when there were changes (#27243)
Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <hi@aguz.me>
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2025-03-21 15:10:43 +01:00
Piotr Osiewicz
579868110b
lsp: Fix workspace folders being cleared when new set is the same as the old one (#27242)
Release Notes:

- N/A
2025-03-21 13:47:06 +00:00
Bennet Bo Fenner
a709d4c7c6
assistant: Add support for claude-3-7-sonnet-thinking (#27085)
Closes #25671

Release Notes:

- Added support for `claude-3-7-sonnet-thinking` in the assistant panel

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Agus Zubiaga <hi@aguz.me>
2025-03-21 12:29:07 +00:00
Kirill Bulatov
2ffce4f516
Add non-blob columns to SQLite (#27236) 2025-03-21 12:04:59 +02:00
Smit Barmase
33fc1f4af2
languages: Fix JS/TS imports not showing correct suggestions after using period (#27235)
Closes #21728

This PR improves autocomplete for imports for all kinds of javascript
and typescript files.

Adds `.` as `completion_query_characters` which will make it act like
word for auto completion context. This allows capturing compete
`format.` as query.

Before:
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/849fb342-db73-48e7-a9d8-93f0e5a14b58"
/>

After:
<img width="500" alt="image"
src="https://github.com/user-attachments/assets/e3ac3272-3217-4bcd-857f-4a83afc5980e"
/>

Release Notes:

- Improved autocomplete suggestions for JavaScript and TypeScript
imports.
2025-03-21 15:13:31 +05:30
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
Danilo Leal
8f86cd758a
assistant2: Add design refinements (#27160)
Release Notes:

- N/A

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Agus Zubiaga <hi@aguz.me>
2025-03-21 03:19:41 -03:00