Commit graph

25342 commits

Author SHA1 Message Date
Michael Sloan
ea40c1d9b3
Add scripts and configuration for building snap package (#25064)
Release Notes:

- N/A

---------

Co-authored-by: Soumyadeep Ghosh <soumyadeepghosh2004@zohomail.in>
2025-02-19 10:28:23 -07:00
Danilo Leal
2d1a028de5
Refine the multibuffer hint design (#25167)
Just a little touch-up here.

![Screenshot 2025-02-19 at 12 45
06 PM](https://github.com/user-attachments/assets/bab2ab5d-2c4c-4a78-812c-888b216f993e)

Release Notes:

- N/A
2025-02-19 13:55:11 -03:00
Cole Miller
c34b14ae7d
Revert "Rework hunk controls (#24814)" (#25174)
This reverts commit a6a8d79d86.

Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-02-19 16:48:35 +00:00
Marshall Bowers
d17c6b392e
Add allow_rewrap setting to control editor::Rewrap behavior for a given language (#25173)
This PR adds a new `allow_rewrap` setting to control how
`editor::Rewrap` behaves for a given language.

This is a language setting, so it can either be configured globally or
within the context of an individual language.

For example:

```json
{
  "allow_rewrap": "in_selections",
  "languages": {
    "Typst": {
      "allow_rewrap": "anywhere"
    }
  }
}
```

There are three different values:

- `in_comment`: Only perform rewrapping within comments.
- `in_selections`: Only perform rewrapping within the current
selection(s).
- `anywhere`: Allow rewrapping anywhere.

The global default is `in_comment`, as it is the most conservative
option and allows rewrapping comments without risking breaking other
syntax.

The `Markdown` and `Plain Text` languages default to `anywhere`, which
mirrors the previous behavior for those language that was hard-coded
into the rewrap implementation.

This setting does not have any effect in Vim mode, as Vim mode already
allowed rewrapping anywhere.

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

Release Notes:

- Added an `allow_rewrap` setting to control the `editor::Rewrap`
behavior for a given language.
2025-02-19 16:37:39 +00:00
Antonio Scandurra
1ce8a51712
Ignore custom buffer line height for context menus (#25172)
Closes #24504 

Release Notes:

- Fixed a visual bug that could make context menus unusable when setting
a custom `buffer_line_height`.
2025-02-19 16:33:33 +00:00
Peter Tripp
6a9b1f0dc4
docs: Remove GitHub link from model improvement (#25171)
Release Notes:

- N/A
2025-02-19 16:22:13 +00:00
Peter Tripp
d1af7b1322
Update Assistant context limits (#25087)
- Update GitHub Copilot Chat context limits
- Add decimal separators for consistency
2025-02-19 11:06:20 -05:00
Peter Tripp
f28080a85c
docs: OpenAI settings example fix (#25112) 2025-02-19 11:05:52 -05:00
PJ Tatlow
b6fd06d63c
project_panel: Make scroll to bottom to use the last visible entry (#25160)
Closes #25159

Release Notes:

- Fixed project panel implementation of the `menu::SelectLast` action
2025-02-19 16:00:23 +00:00
Conrad Irwin
ddec72ecbe
Better key-rendering for linux/windows (#25139)
Release Notes:

- linux: Render keystrokes more consistently

Before (note the added extra vertical padding, the + instead of the -,
and the misalignment between the text and the icons)

<img width="354" alt="Screenshot 2025-02-18 at 23 17 57"
src="https://github.com/user-attachments/assets/924cf08f-8204-4503-8052-abaa7686e644"
/>

After (note the lack of those things):

<img width="322" alt="Screenshot 2025-02-18 at 23 15 48"
src="https://github.com/user-attachments/assets/5b20a6f2-757b-44d2-a888-f495523b688d"
/>


I still think we might want to go "vim-mode" always, because the capital
letters are pretty noisy, but that does mean the letters don't match
what's on the keyboard (though they *do* match the keyboard config
files)

<img width="312" alt="Screenshot 2025-02-18 at 23 16 59"
src="https://github.com/user-attachments/assets/cf6f150c-20bc-4492-adb9-fb5c5bdce351"
/>
2025-02-19 08:55:51 -07:00
Conrad Irwin
119bd896b0
Remove language::markdown (#25136)
The language::markdown crate had been superceded by markdown::Mardown.

After #25117, the only two remaining use-cases were rendering git commit
messages (which are arguably not really markdown) and the signature help
(which is definitely not markdown).

Updated the former to use the new markdown component, and the latter to
do syntax highlighting manually.

Release Notes:

- Allow selecting the commit message in git commits
2025-02-19 08:55:36 -07:00
smit
686978d7c5
editor: Minimum scroll thumb size (#25162)
Closes #22610

This PR fixes the invisible scroll thumb or very tiny scroll thumb when
viewing long or wide files.

The difference between `track_bounds` (imagine scrollbar total height)
and `thumb_size` is the remaining area, which maps to the total height
of the page for scrolling to work as expected. This is already accounted
for. That means we can adjust the thumb size as needed, and the
remaining height/width will be mapped correctly.

So, we can simply use define a minimum size for the thumb and handle
cases where the track bounds are smaller than the defined minimum size.
In such cases, the scrollbar will take up the full height/width of the
track bounds. This is handled mainly to avoid panics in extreme edge
cases. Practically, at such small heights/widths, users are unlikely to
attempt scrolling.

Before:


https://github.com/user-attachments/assets/cf2edf03-8b9a-4678-b3c6-9dcbd01e5db8

After:


https://github.com/user-attachments/assets/e9496a44-3e7d-4be7-b892-2762cccd9959

Release Notes:

- Fixed issue where scroll thumb was invisible or too small when viewing
long or wide files.
2025-02-19 21:14:54 +05:30
Danilo Leal
486e106205
license detection: Include the UPL license (#25152)
For projects such as https://github.com/roc-lang/roc that uses this
license.

Release Notes:

- N/A
2025-02-19 12:37:22 -03:00
Nate Butler
086f002f44
git_ui: Git panel polish (#25164)
- Hides header when no active repo/no repo
- Entire commit editor now has i-beam cursor on hover
- Adds an icon to the project diff tab

Release Notes:

- N/A
2025-02-19 15:33:41 +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
Danilo Leal
f8770fee10
edit prediction: Refine subtle mode flag styles (#25157)
There's still a tiny, 1px shadow being cast in the flag pole that I
didn't figure out yet how to fix it.


https://github.com/user-attachments/assets/714da320-5995-4bd2-a0dc-6c027b4d91eb

Release Notes:

- N/A
2025-02-19 12:14:37 -03:00
Danilo Leal
044be72038
popover_menu: Add docs to the trigger_with_tooltip method (#25158)
Felt like this was relevant particularly as we're living with both
`trigger` and `trigger_with_tooltip`. At some point, I believe there
should be only one (`trigger_with_tooltip`) and that should be then
renamed to just `trigger` back again! We're supporting both for now just
for ease of migration/avoiding big changes.

Release Notes:

- N/A
2025-02-19 12:14:28 -03:00
Marshall Bowers
8b98b5c82f
project: Fix doc comments for NodeBinarySettings (#25154)
This PR fixes the doc comments on the `NodeBinarySettings` struct.

Release Notes:

- N/A
2025-02-19 13:51:20 +00:00
Joseph T. Lyons
d034687475
Bump Zed to v0.176 (#25153)
Release Notes:

- N/A
2025-02-19 13:42:43 +00:00
Marshall Bowers
d4b2e88ab8
language: Fix incorrectly-formatted doc comment (#25151)
This PR fixes an incorrectly-formatted doc comment in the
`BufferSnapshot` impl.

Release Notes:

- N/A
2025-02-19 13:09:16 +00:00
smit
fb19db00ca
editor: Do not highlight selected text + Clear highlight preemptively when new selection is detected (#25149)
When selecting text, it highlights all matching occurences along with
selected text itself. This causes highlight overlap, which looks bit
odd. This PR fixes it.

Bonus:

Context: We have an edge case (which we already cover) where we don’t
want to clear `SelectedTextHighlight` every time the selection changes.
This happens when you are dragging the selection across some word, if
you clear it directly on selection change, due to debounce wait, the
highlight take some time to appear, which causes flickering for the
user. We solve this by not clearing it directly but only clearing it
when a new selection is found. This avoids the flicker.

However, we also need to clear the selection even before the debounce
wait if we detect early on that the selection is different from previous
ones. Otherwise, the user will have to wait until the debounce time to
see it cleared on the screen.

The code for this is a little repetitive because we check the buffer
state both before and after the debounce. But this is necessary.

---
Before:

Notice overlapping corners and selected text is bit darker in this case.

![image](https://github.com/user-attachments/assets/ec371079-b513-4216-9f6e-73d1aff99250)

After:

![image](https://github.com/user-attachments/assets/0fb9cd58-5d4b-49e8-91cb-78999c3a54a8)

Release Notes:

- N/A
2025-02-19 17:43:36 +05:30
Kirill Bulatov
094430e5a2
Properly normalize completion labels with multi-byte characters (#25150)
Closes https://github.com/zed-industries/zed/issues/25142

Release Notes:

- Fixed panics on completion with multi-byte characters input
2025-02-19 12:11:10 +00:00
USAMI Kenta
d4414efd6f
Fix link to the PHP extension (#25144)
Fix broken links to [PHP
extensions](https://github.com/zed-extensions/php) from [the
documentation](https://zed.dev/docs/languages/php).

Release Notes:

- N/A
2025-02-19 11:10:10 +00:00
Kirill Bulatov
2274e88299
Highlight regex in the project search input (#25147)
Follow-up of https://github.com/zed-industries/zed/pull/25005

Project search also has regex search option, highlight it the same way
too.

Release Notes:

- N/A
2025-02-19 11:04:44 +00:00
smit
48417866cc
terminal: Handle shift+click selection (#25143)
Closes #16951

Handle the case where you click on the terminal while pressing Shift. 

Instead of setting a new selection head, we simply update the selection
to that point. This allows you to repeatedly extend the selection to new
points by pressing Shift while preserving the original selection head.

Preview:

Selection works in direct terminal, but doesn't on Vim like program,
which is expected.


https://github.com/user-attachments/assets/e46987d8-a9a3-495d-8dd9-98d461317a8d


Release Notes:

- Added ability to extend selection with Shift + click in the terminal.
2025-02-19 14:43:59 +05:30
smit
1fa105eaa5
docs: Fix selection highlight default value (#25134)
Changed default debounce value in docs to match default settings.

Release Notes:

- N/A
2025-02-19 13:27:49 +05:30
smit
043c4ed296
editor: Fix highlight selection panic (#25141)
Use the latest selection state for highlighting instead of the state
before debounce.

Release Notes:

- N/A
2025-02-19 12:50:49 +05:30
Kirill Bulatov
e57b9e5f83
Ignore selections persistence for multi buffer editors (#25140)
Follow-up of https://github.com/zed-industries/zed/pull/25083

Release Notes:

- N/A
2025-02-19 06:42:22 +00:00
Conrad Irwin
13da468e22
Fix for #25039 (#25138)
Release Notes:

- vim: Fix crash in `ci{`
2025-02-19 06:24:54 +00:00
Conrad Irwin
1678e3cbf1
Fix clicking on file links in editor (#25117)
Closes #18641
Contributes: #13194

Release Notes:

- Open LSP documentation file links in Zed not the system opener
- Render completion documentation markdown consistently with
documentation markdown
2025-02-18 22:54:35 -07:00
Ben Kunkle
ebbc6a9752
Highlight super and this as keywords in JS/TS/TSX (#25135)
Closes #24951

We were highlighting both as `@variable.special` however, they are
_techinically_ keywords and other editors (VSCode/WebStorm) seem to
highlight them as keywords as well.

Release Notes:

- N/A
2025-02-19 05:53:16 +00:00
Ben Kunkle
bb600acaa1
Set base highlight for identifiers in go to variable highlight color (#25128)
Closes #24947 

Release Notes:

- N/A
2025-02-19 01:54:51 +00:00
Marshall Bowers
372aaecdb4
language_model_selector: Authenticate all providers up front (#25123)
This PR fixes an issue where configured language model providers would
not show up unless the configuration view was opened.

The problem was that we were filtering unauthenticated language model
providers out of the language model selector, but would only
authenticate the active provider when the selector loaded.
Authenticating the rest of the providers was deferred until the
configuration view was opened for the first time.

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

Release Notes:

- Fixed an issue where configured languages models were not showing up
in the language model selector until the configuration view was opened
for the first time.
2025-02-19 01:40:07 +00:00
Marshall Bowers
7a6b652ebc
language_model: Return AuthenticateErrors from LanguageModelProvider::authenticate (#25126)
This PR updates the `LanguageModelProvider::authenticate` method to
return an `AuthenticateError` instead of an `anyhow::Error`.

This allows us to model the "credentials not found" state explicitly as
`AuthenticateError::CredentialsNotFound`, which enables the caller to
check for this state and act accordingly.

Planning to use this in #25123 to silence errors about missing
credentials when authenticating providers in the background.

Release Notes:

- N/A
2025-02-19 00:01:48 +00:00
Danilo Leal
2627a5fdbe
assistant: Improve the language model selector (#25125)
This PR includes change such as:

- Ensures the popover width is fixed/not dancing around
- Ensures the popover is not obscuring the trigger in the buffer and
terminal inline assistant scenarios
- Removes ellipsis from the trigger button label
- Ensures the scrollbar doesn't hide the check icon

| Terminal | Prompt Editor | Buffer |
|--------|--------|--------|
| ![Screenshot 2025-02-18 at 8 43
46 PM](https://github.com/user-attachments/assets/9cdfbaf1-f27e-4f48-877e-9cf61767ecee)
| ![Screenshot 2025-02-18 at 8 43
49 PM](https://github.com/user-attachments/assets/7abf9be2-bd2a-43d7-9a5d-d665e7e9fda3)
| ![Screenshot 2025-02-18 at 8 43
52 PM](https://github.com/user-attachments/assets/017bbdb3-185a-4bf6-9005-018ecafef9dd)
|

Release Notes:

- N/A
2025-02-18 21:01:09 -03:00
Marshall Bowers
a6006afdd7
language_model_selector: Fix variable name (#25121)
This PR fixes an inaccurate variable name that I noticed in the language
model selector.

Release Notes:

- N/A
2025-02-18 23:10:47 +00:00
Kirill Bulatov
92f128ebb0
Do not fail hard on selection persistence if the editor is removed (#25120)
Follow-up of https://github.com/zed-industries/zed/pull/25083

Follows practices from editors' scroll position persisting:
5a05b7461e/crates/editor/src/persistence.rs (L200)
and do not fail hard if the editor with the ID given does not exist.
Also add the problematic IDs into the error context to see them in the
error logs.

Release Notes:

- N/A
2025-02-18 22:52:23 +00:00
Marshall Bowers
98ea659af6
assistant2: Fix thread history only working in one Zed window (#25119)
This PR fixes an issue where the thread history would only work in one
Zed window at a time.

The backing LMDB database can only be opened once per Zed instance.
However, the `ThreadStore` has one instance per Zed window.

To fix this, we need to create the `heed` environment once and store it
as a global, and then reference the same environment across all of the
`ThreadStore`s.

Release Notes:

- N/A
2025-02-18 22:44:43 +00:00
João Marcos
d0816ef2e2
edit predictions: Fix fold not expanding after jump (#25116)
Closes #24938.

Release Notes:

- Edit predictions: Fix fold not expanding after jump
2025-02-18 18:55:00 -03:00
Agus Zubiaga
6885b28c22
assistant2: Deploy inline assistant in PromptEditor (#25094)
Release Notes:

- N/A

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2025-02-18 18:29:12 -03:00
Conrad Irwin
48f87a8d9a
Don't open file finder menu on command (#25097)
Closes #24740

Release Notes:

- Don't open the split menu in the file finder when command is pressed
2025-02-18 14:27:10 -07:00
Danilo Leal
bff1548b48
assistant2: Add file icons for mentioned creases (#25111)
This PR makes the mentioned file creases/buttons use `FileIcons`.

<img width="700" alt="Screenshot 2025-01-21 at 11 20 49 AM"
src="https://github.com/user-attachments/assets/876da534-c11a-4d13-af82-a5948863f954"
/>

Release Notes:

- N/A

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
2025-02-18 18:22:01 -03:00
Conrad Irwin
60a44359e4
Terminal mouse improvements (#25104)
Closes #24911
Closes #17983
Closes #7073

Release Notes:

- Terminal: Fix cmd-click on links/files when terminal is not focused
- Terminal: Remove hover treatment after Zed hides/re-opens

---------

Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2025-02-18 13:10:10 -08: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
Piotr Osiewicz
f606b0641e
workspace: Prevent user from undoing persistent session deserialization (#25106)
Closes #21846

Release Notes:

- Fixed a bug that made it possible to undo changes in dirty
deserialized buffer (with `restore_unsaved_buffers: true`)
2025-02-18 19:49:39 +00:00
Joseph T. Lyons
e5d8bd27da
Issue response: pull team members from staff team (#25102)
Release Notes:

- N/A
2025-02-18 18:43:37 +00:00
Cole Miller
529c65276e
Revert gutter stripes as indicator of hunk staged status (#25089)
We've decided to go in a different direction on indicating the staged
status of hunks, so go back for now to a world where we don't display
staged and unstaged hunks differently outside the (still gated) project
diff editor.

cc @iamnbutler 

This reverts commit 8c202b3b09.

Release Notes:

- N/A
2025-02-18 13:20:39 -05:00
Agus Zubiaga
737b177ab5
Switch to columnar selection by pressing alt-shift while mouse is down (#25096)
We begin a columnar selection when we drag the mouse while holding
`alt-shift`. This PR makes it possible to start the selection and then
turn it into columnar by pressing `alt-shift`.

Fixes #5372 

Release Notes:

- Support switching to columnar selection by pressing `alt-shift` while
mouse is down
2025-02-18 14:49:13 -03: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
Danilo Leal
1e255e41cc
assistant2: Show token count in the Prompt Editor view (#25091)
Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <hi@aguz.me>
2025-02-18 13:24:15 -03:00