Commit graph

24726 commits

Author SHA1 Message Date
Marshall Bowers
47dcbdfe51
gpui: Fix pattern example (#23786)
This PR fixes the `pattern` example, which was merged in
https://github.com/zed-industries/zed/pull/23576 without being updated
with the new GPUI changes.

Release Notes:

- N/A
2025-01-28 12:02:57 -05:00
Nate Butler
23672987ff
gpui: Add support for slash pattern fills (///) (#23576)
TODO:
- [x] Add BackgroundTag::PatternSlash
- [x] Support metal slash pattern fills
- [x] Support blade slash pattern fills
---

Adds support for a new background type in gpui, `pattern_slash`.

Usage:

```rust
div().size(px(56.0)).bg(pattern_slash(gpui::red()))
```
This will create a 56px square with a red slash pattern fill.

You can run the pattern example with `cargo run -p gpui --example
pattern`:

![CleanShot 2025-01-23 at 16 22
09@2x](https://github.com/user-attachments/assets/39d9f8c8-816c-4d3b-bc75-fcc122747e17)

---

After talking with @as-cii at length about how we want to support
patterns in gpui, we decided for now we'll simply add a new
BackgroundTag specific to this pattern.

It isn't the best long term plan however – we'll likely want to
introduce the concept of a `Fill` at some point so we can have
`Fill::Solid`, `Fill::Gradient(LinearGradient)`, etc in the future.

The pattern is designed to seamlessly tile vertically for elements of
the same height. For example, for use in editor line backgrounds:

![CleanShot 2025-01-23 at 16 27
41@2x](https://github.com/user-attachments/assets/d51b94bc-cfc2-4aff-89e3-289a04ea8841)

---


Release Notes:

(do we do gpui release notes?)
- Adds support for slash pattern fills in `gpui`.

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2025-01-28 11:33:34 -05:00
Marshall Bowers
070890d361
anthropic: Don't bail out on unknown model ID (#23782)
This PR fixes an issue introduced in
https://github.com/zed-industries/zed/pull/20551/ that would prevent
models with unknown IDs from working in the LLM service.

We only need to look up a model from its ID for the beta headers, and if
we can't find that particular model we should fall back to the default
beta headers instead of bailing out completely,

Release Notes:

- N/A
2025-01-28 10:56:05 -05:00
João Marcos
2b160f4f3c
Omit gitignored files from context file picker (#23777)
In both `thread` and `prompt editor` the context file picker, gitignored
files are hidden (as expected) when searching files by path, but they
are still shown initially as you create the file picker.

Plus, selecting gitignored files in the `prompt editor` is bugged and
collapses everything.

This PR settles on not showing gitignored files to solve these
inconsistencies.

Release Notes:

- Fix gitignored files filter occasionally not working in context file
picker.
2025-01-28 11:40:42 -03:00
Kirill Bulatov
a5957bfaeb
Sanitize another pair of brackets when hovering over a path in the terminal (#23776)
Closes https://github.com/zed-industries/zed/issues/23774

Release Notes:

- Improved terminal hover word matching
2025-01-28 16:03:48 +02:00
Piotr Osiewicz
b74a273934
project search: Do not bail on search when a binary file is encountered (#23775)
Closes #ISSUE

Release Notes:

- N/A
2025-01-28 14:54:00 +01:00
Kirill Bulatov
7105f9c68c
Show entries in remote git panels (#23773)
Now both remote collab and ssh remote get entries shown and updated in
the git panel.
This seems to be quite a step towards remote git support, hence
submitting a PR.

Further steps: remove `get_local_repo` and allow getting the repo from
`Worktree`, not its local counterpart + have another, remote impl of the
`GitRepository` trait.

Release Notes:

- N/A
2025-01-28 15:25:59 +02:00
Bennet Bo Fenner
fc5461adf4
Revert "edit prediction: Fix crash in highlight_text (#23766)" (#23771)
This reverts commit dfed43ab24.

Closes #ISSUE

Release Notes:

- N/A
2025-01-28 13:56:57 +01:00
Bennet Bo Fenner
57a3d8c491
edit prediction: Hide rate completions modal behind feature flag (#23597)
This hides the ability to rate completions behind the
`predict-edits-rate-completions` feature flag

Release Notes:

- N/A
2025-01-28 12:27:09 +01:00
Bennet Bo Fenner
dfed43ab24
edit prediction: Fix crash in highlight_text (#23766)
This fixes the panics we we're seeing in `EditPreview::highlight_edits`.
The reason for this was that we were interpolating edits incorrectly.

Here's an example:

```rust
let a = 0; // existing code
let c = 2; // suggested by edit prediction
```
The edits would look like this: `[(Point(1, 0)..Point(1, 0), "let c =
2;"]`

Now i type:
```rust
let a = 0; // existing code
let b = 1; // added this line
let c = 2; // suggested by edit prediction
```

Before this change, the `interpolate` function would allow insertions
before the edit prediction edits, the anchors will move to the next
line.
The edits would look now like this: `[(Point(2, 0)..Point(2, 0), "let c
= 2;"]`

However, now we end up with a call to `EditPreview::highlight_edits`,
with the following parameters:
- current_snapshot: 
  ```rust
  let a = 0;
  let b = 1;
  ```
- edits: `[(Point(2, 0)..Point(2, 0), "let c = 2;"]`
- applied_edits_snapshot:
  ```rust
  let a = 0;
  let c = 2;
  ```

And here you can see the issue, applying the `edits` to the
`current_snapshot` should always end up re-creating the text that is
present in the `applied_edits_snapshot`. That is not the case here
though, meaning that the offsets in the new buffer are not correct,
which can either lead to a confusing popup or a crash if the suggestion
is at the end of the file.

Here's a real world example (edit prediction is ONLY suggesting to
delete a new line):

<img width="487" alt="Screenshot 2025-01-27 at 13 05 26"
src="https://github.com/user-attachments/assets/a0a8064e-8cfa-48b2-9f1c-efc2d0d9d7d4"
/>

We fixed this by only allowing interpolation if the user is editing
after all the edit predictions OR if the user edit is a subset of the
model suggestion.



Co-Authored-by: Antonio <antonio@zed.dev>

Release Notes:

- N/A

Co-authored-by: Antonio <antonio@zed.dev>
2025-01-28 12:08:04 +01:00
loczek
b99159c59b
snippets: Fix snippets not updating while containing comments (#23755)
Closes #23699

Release Notes:

- Fixed issue where snippets would not update when a snippets file
contained comments.
2025-01-28 10:37:48 +01:00
jfmontanaro
bb59e7f217
Refine syntax highlighting for Python docstrings (#20898)
Following up on #20763, this PR adds support for module- and class-level
docstrings, adds "additional docstrings" as described in [PEP
257](https://peps.python.org/pep-0257/), and fixes function-level
docstrings so that only the first string literal in a function gets
treated as a docstring.

One question that occurs to me is: Would it be good to capture attribute
and additional docstrings differently from regular docstrings? E.g.
`@string.doc.attribute`, `@string.doc.additional`? PEP 257 mentions that
unlike regular docstrings, these docstrings are ignored by the
interpreter (regular docstrings get added as the `__doc__` property of
the object they document), so I can see someone potentially wanting to
style them a little differently.

Release notes:

* Added Python syntax highlighting for class- and module-level
docstrings, additional docstrings, and improved recognition of
function-level docstrings.

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2025-01-28 10:23:43 +01:00
Kirill Bulatov
b643080117
Use proper names for actions' async context (#23763)
Post-PR merge fixes.

Release Notes:

- N/A
2025-01-28 11:18:00 +02:00
tims
02af8dde16
menus: Add "Open File" action for Linux and Windows (#23707)
This PR adds menu item for `workspace::OpenFiles` in app menu on Linux
and Windows.

Context:
When opening a file or folder on Linux and Windows via the native file
picker, the picker can be either in file-only mode or folder-only mode.
This means you have to open it already knowing whether you want to open
a file or a folder, unlike macOS, which lets you choose either in the
same picker.

For this reason, a new action, `workspace::OpenFiles`, was recently
added for Linux and Windows. This is basically file-only mode, alongside
the existing `workspace::Open` action, which is folder-only. In macOS,
the `workspace::Open` action is sufficient to open both file and folder.

Before:  
<img
src="https://github.com/user-attachments/assets/67dc95d6-e98d-438a-9568-570e87617f85"
alt="Before" width="200" />

After:  
<img
src="https://github.com/user-attachments/assets/d0ffd02c-0f48-4edc-b426-4d430f2e0c86"
alt="After" width="200" />

Release Notes:

- Added "Open File" action in file menu for Linux and Windows.
2025-01-28 11:10:00 +02:00
tims
34d0b57945
editor: Fix inline Git blame not visible on long lines due to overflow (#23374)
Closes #18702

This is take 2 of [my previous
PR](https://github.com/zed-industries/zed/pull/19555), which was closed
due to inactivity and merge conflicts.

**Cause**: 

The editor's horizontal scroll width only considers the longest line in
the buffer, using `layout_line` for `longest_row`. The inline blame
width isn’t included in it because it is just a decoration on top of the
line (think of like CSS absolute) and not part of its actual content.
This causes blame to overflow.

**Solution**:

Along with `longest_row` width we also add that line's inline blame
width for scroll width calculation. We also have to add some padding
that is between inline blame and line's content.

**Alternate Solution**:

In my previous PR, instead of adding the inline blame width of the
longest line for scroll width calculation, I used the inline blame of
the current line the cursor is on (since we only see the blame for the
current line). I added that to the current line's width, giving us the
full width of that row. Then, we compare that row's width with the
longest row width and use the max of the two for the scroll width
calculation.

While this solution seems clever, it's overly complicated and could
cause issues, like the scroll width changing every time you move the
cursor up or down. I don't think we should go with this, but I'm open to
suggestions.

**Preview**:

Before:


https://github.com/user-attachments/assets/01ef90cf-06e7-4ebb-8bd1-637a53e0654e

After:


https://github.com/user-attachments/assets/b13616de-bdea-4da4-b32d-9c4104448166


Release Notes:

- Fixed inline Git blame not visible on long lines due to overflow.
2025-01-28 10:47:11 +02:00
tims
f314662048
project_panel: Add precise drag-and-drop for files onto folded directories (#22983)
Closes #19192

1. Changed the drag overlay of entries for better visibility of where to
drop.
2. Folded directories (except for the last folded one) will be
highlighted as drop targets.
3. The delimiter between folded directories prevents the directory
highlight from losing focus and acts as part of the directory to avoid
flickering.

This works just like VS Code does.


[fold-drop.webm](https://github.com/user-attachments/assets/853f7c5e-3492-4f56-9736-6d0e3ef09325)

Release Notes:

- Added precise drag-and-drop for files onto folded directories in the
Project Panel.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2025-01-28 10:42:10 +02:00
tims
5c650cdcb2
project_panel: Add Alt/Opt+Click to expand/collapse a directory and all its contents (#22896)
Closes #15966 

This PR adds `Alt/Opt+Click` to expand or collapse a directory and all
its contents.

Context:

The current `expand_entry` scans immediate child subdirectories if they
aren’t loaded, while `expand_all_for_entry` scans the entire subtree.
The latter takes longer, so we wait for it to complete to ensure
accurate results.

For full directory scan, instead of using
`refresh_entries_for_paths(vec![path])`, which requires specifying all
explicit paths to refresh, we use `add_path_prefix_to_scan`, which
eliminates the need to list every path. Both methods internally call
`reload_entries_for_paths`, which invokes `should_scan_directory`. This
determines whether to scan deeper based on a path prefix match between
the given directory and its subdirectories, returning `true` for
`add_path_prefix_to_scan`.

The existing code handles scanning, removing path prefixes after scans
complete, and managing ignored directories.

How it works (Expand):
1. Alt clicking on non-ignored closed directory, expands it and all its
subdirectories, except ignored subdirectories. This helps while working
on mono repos, where you might not want to expand dirs like
`node_modules`, `dist`, etc or git submodules, when you expand any root
dir.

In example, `draft` and `posts` dir are ignored dir.


[expand-1.webm](https://github.com/user-attachments/assets/07d3f724-0757-408f-b349-5beb4ee8440e)

2. Alt clicking on ignored closed directory, expands it and all its
subdirectories. This is when you explicitly want to do it, on dirs like
`node_modules`, `dist`, etc.

In example, `dist` dir is ignored dir.


[expand-2.webm](https://github.com/user-attachments/assets/99e55883-ab1a-4a9c-a0f0-48026991a922)

3. In case of auto folded subdirectories, expand all action will take
precedence over it. That is, it will unfold all the subdirectories
inside clicked dir. This is intentional, as user explicitly wants to
reveal as much content as possible. (This is my personal opinion on how
it should work).


[expand-3.webm](https://github.com/user-attachments/assets/f20b0311-e92a-4e34-b640-1469b0d6fa16)

How it works (Collapse):
1. Alt clicking any opened directory will collapse it and all its
children, whether ignored or not. This is when you want to start from a
fresh state.

2. When auto fold is enabled in settings, collapse action will also fold
all subdirectories that it can fold. This is to bring it back to its
fresh state as mentioned above.


[collapse-1-2.webm](https://github.com/user-attachments/assets/74db6cee-0afa-406b-a9a2-7421083a2c2a)


Future:
- Using keybinding to expand/collapse all for selected entry
- Handle expand/collapse all for folded entry

Todos:
- [x] Expand entries logic
- [x] Handle remote worktree for expand
- [x] Figure out scan complete status
- [x] Move expansion logic to status update event
- [x] Collapse entries logic
- [x] Handle fold/unfold subdirs interaction
- [x] Do not expand git ignored sub-dirs
- [x] Tests
- [x] Test Remote

Release Notes:

- Added Alt/Opt+Click functionality to expand or collapse a directory
and all its contents.
2025-01-28 10:37:56 +02:00
renovate[bot]
793873bdc9
Update Rust crate sqlx to v0.8.3 (#22867)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [sqlx](https://redirect.github.com/launchbadge/sqlx) |
dev-dependencies | patch | `0.8.2` -> `0.8.3` |
| [sqlx](https://redirect.github.com/launchbadge/sqlx) | dependencies |
patch | `0.8.2` -> `0.8.3` |

---

### Release Notes

<details>
<summary>launchbadge/sqlx (sqlx)</summary>

###
[`v0.8.3`](https://redirect.github.com/launchbadge/sqlx/blob/HEAD/CHANGELOG.md#083---2025-01-03)

[Compare
Source](https://redirect.github.com/launchbadge/sqlx/compare/v0.8.2...v0.8.3)

41 pull requests were merged this release cycle.

##### Added

- \[[#&#8203;3418]]: parse timezone parameter in mysql connection url
\[\[[@&#8203;dojiong](https://redirect.github.com/dojiong)]]
- \[[#&#8203;3491]]: chore: Update async-std v1.13
\[\[[@&#8203;jayvdb](https://redirect.github.com/jayvdb)]]
- \[[#&#8203;3492]]: expose relation_id and relation_attribution_no on
PgColumn
\[\[[@&#8203;kurtbuilds](https://redirect.github.com/kurtbuilds)]]
- \[[#&#8203;3493]]: doc(sqlite): document behavior for zoned date-time
types \[\[[@&#8203;abonander](https://redirect.github.com/abonander)]]
- \[[#&#8203;3500]]: Add sqlite commit and rollback hooks
\[\[[@&#8203;gridbox](https://redirect.github.com/gridbox)]]
- \[[#&#8203;3505]]: chore(mysql): create test for passwordless auth
([#&#8203;3484](https://redirect.github.com/launchbadge/sqlx/issues/3484))
\[\[[@&#8203;abonander](https://redirect.github.com/abonander)]]
- \[[#&#8203;3507]]: Add a "sqlite-unbundled" feature that dynamically
links to system libsqlite3.so library
\[\[[@&#8203;lilydjwg](https://redirect.github.com/lilydjwg)]]
- \[[#&#8203;3508]]: doc(sqlite): show how to turn options into a pool
\[\[[@&#8203;M3t0r](https://redirect.github.com/M3t0r)]]
- \[[#&#8203;3514]]: Support PgHstore by default in macros
\[\[[@&#8203;joeydewaal](https://redirect.github.com/joeydewaal)]]
- \[[#&#8203;3550]]: Implement Acquire for PgListener
\[\[[@&#8203;sandhose](https://redirect.github.com/sandhose)]]
- \[[#&#8203;3551]]: Support building with rustls but native
certificates
\[\[[@&#8203;IlyaBizyaev](https://redirect.github.com/IlyaBizyaev)]]
- \[[#&#8203;3553]]: Add support for Postgres lquery arrays
\[\[[@&#8203;philipcristiano](https://redirect.github.com/philipcristiano)]]
- \[[#&#8203;3560]]: Add PgListener::next_buffered(), to support batch
processing of notifications
\[\[[@&#8203;chanks](https://redirect.github.com/chanks)]]
- \[[#&#8203;3577]]: Derive Copy where possible for database-specific
types \[\[[@&#8203;veigaribo](https://redirect.github.com/veigaribo)]]
- \[[#&#8203;3579]]: Reexport AnyTypeInfoKind
\[\[[@&#8203;Norlock](https://redirect.github.com/Norlock)]]
- \[[#&#8203;3580]]: doc(mysql): document difference between `Uuid` and
`uuid::fmt::Hyphenated`
\[\[[@&#8203;abonander](https://redirect.github.com/abonander)]]
- \[[#&#8203;3583]]: feat: point
\[\[[@&#8203;jayy-lmao](https://redirect.github.com/jayy-lmao)]]
- \[[#&#8203;3608]]: Implement AnyQueryResult for Sqlite and MySQL
\[\[[@&#8203;pxp9](https://redirect.github.com/pxp9)]]
- \[[#&#8203;3623]]: feat: add geometry line
\[\[[@&#8203;jayy-lmao](https://redirect.github.com/jayy-lmao)]]
- \[[#&#8203;3658]]: feat: add Transaction type aliases
\[\[[@&#8203;joeydewaal](https://redirect.github.com/joeydewaal)]]

##### Changed

- \[[#&#8203;3519]]: Remove unused dependencies from sqlx-core, sqlx-cli
and sqlx-postgres
\[\[[@&#8203;vsuryamurthy](https://redirect.github.com/vsuryamurthy)]]
- \[[#&#8203;3529]]: Box Pgconnection fields
\[\[[@&#8203;joeydewaal](https://redirect.github.com/joeydewaal)]]
- \[[#&#8203;3548]]: Demote `.pgpass` file warning to a debug message.
\[\[[@&#8203;denschub](https://redirect.github.com/denschub)]]
- \[[#&#8203;3585]]: Eagerly reconnect in `PgListener::try_recv`
\[\[[@&#8203;swlynch99](https://redirect.github.com/swlynch99)]]
- \[[#&#8203;3596]]: Bump thiserror to v2.0.0
\[\[[@&#8203;paolobarbolini](https://redirect.github.com/paolobarbolini)]]
- \[[#&#8203;3605]]: Use `UNION ALL` instead of `UNION` in nullable
check \[\[[@&#8203;Suficio](https://redirect.github.com/Suficio)]]
- \[[#&#8203;3629]]: chore: remove BoxFuture's (non-breaking)
\[\[[@&#8203;joeydewaal](https://redirect.github.com/joeydewaal)]]
- \[[#&#8203;3632]]: Bump hashlink to v0.10
\[\[[@&#8203;paolobarbolini](https://redirect.github.com/paolobarbolini)]]
- \[[#&#8203;3643]]: Roll PostgreSQL 11..=15 tests to 13..=17
\[\[[@&#8203;paolobarbolini](https://redirect.github.com/paolobarbolini)]]
- \[[#&#8203;3648]]: close listener connection on TimedOut and
BrokenPipe errors
\[\[[@&#8203;DXist](https://redirect.github.com/DXist)]]
- \[[#&#8203;3649]]: Bump hashbrown to v0.15
\[\[[@&#8203;paolobarbolini](https://redirect.github.com/paolobarbolini)]]

##### Fixed

- \[[#&#8203;3528]]: fix: obey `no-transaction` flag in down migrations
\[\[[@&#8203;manifest](https://redirect.github.com/manifest)]]
- \[[#&#8203;3536]]: fix: using sqlx::test macro inside macro's
\[\[[@&#8203;joeydewaal](https://redirect.github.com/joeydewaal)]]
- \[[#&#8203;3545]]: fix: remove `sqlformat`
\[\[[@&#8203;tbar4](https://redirect.github.com/tbar4)]]
- \[[#&#8203;3558]]: fix: fix example code of `query_as`
\[\[[@&#8203;xuehaonan27](https://redirect.github.com/xuehaonan27)]]
- \[[#&#8203;3566]]: Fix: Cannot query Postgres `INTERVAL[]`
\[\[[@&#8203;Ddystopia](https://redirect.github.com/Ddystopia)]]
- \[[#&#8203;3593]]: fix: URL decode database name when parsing
connection url
\[\[[@&#8203;BenoitRanque](https://redirect.github.com/BenoitRanque)]]
- \[[#&#8203;3601]]: Remove default-features = false from url
\[\[[@&#8203;hsivonen](https://redirect.github.com/hsivonen)]]
- \[[#&#8203;3604]]: Fix mistake in sqlx::test fixtures docs
\[\[[@&#8203;andreweggleston](https://redirect.github.com/andreweggleston)]]
- \[[#&#8203;3612]]: fix(mysql): percent-decode database name
\[\[[@&#8203;abonander](https://redirect.github.com/abonander)]]
- \[[#&#8203;3640]]: Dont use `EXPLAIN` in nullability check for QuestDB
\[\[[@&#8203;Suficio](https://redirect.github.com/Suficio)]]

[#&#8203;3418]: https://redirect.github.com/launchbadge/sqlx/pull/3418

[#&#8203;3478]: https://redirect.github.com/launchbadge/sqlx/pull/3478

[#&#8203;3491]: https://redirect.github.com/launchbadge/sqlx/pull/3491

[#&#8203;3492]: https://redirect.github.com/launchbadge/sqlx/pull/3492

[#&#8203;3493]: https://redirect.github.com/launchbadge/sqlx/pull/3493

[#&#8203;3500]: https://redirect.github.com/launchbadge/sqlx/pull/3500

[#&#8203;3505]: https://redirect.github.com/launchbadge/sqlx/pull/3505

[#&#8203;3507]: https://redirect.github.com/launchbadge/sqlx/pull/3507

[#&#8203;3508]: https://redirect.github.com/launchbadge/sqlx/pull/3508

[#&#8203;3514]: https://redirect.github.com/launchbadge/sqlx/pull/3514

[#&#8203;3519]: https://redirect.github.com/launchbadge/sqlx/pull/3519

[#&#8203;3528]: https://redirect.github.com/launchbadge/sqlx/pull/3528

[#&#8203;3529]: https://redirect.github.com/launchbadge/sqlx/pull/3529

[#&#8203;3536]: https://redirect.github.com/launchbadge/sqlx/pull/3536

[#&#8203;3545]: https://redirect.github.com/launchbadge/sqlx/pull/3545

[#&#8203;3548]: https://redirect.github.com/launchbadge/sqlx/pull/3548

[#&#8203;3550]: https://redirect.github.com/launchbadge/sqlx/pull/3550

[#&#8203;3551]: https://redirect.github.com/launchbadge/sqlx/pull/3551

[#&#8203;3553]: https://redirect.github.com/launchbadge/sqlx/pull/3553

[#&#8203;3558]: https://redirect.github.com/launchbadge/sqlx/pull/3558

[#&#8203;3560]: https://redirect.github.com/launchbadge/sqlx/pull/3560

[#&#8203;3566]: https://redirect.github.com/launchbadge/sqlx/pull/3566

[#&#8203;3577]: https://redirect.github.com/launchbadge/sqlx/pull/3577

[#&#8203;3579]: https://redirect.github.com/launchbadge/sqlx/pull/3579

[#&#8203;3580]: https://redirect.github.com/launchbadge/sqlx/pull/3580

[#&#8203;3583]: https://redirect.github.com/launchbadge/sqlx/pull/3583

[#&#8203;3585]: https://redirect.github.com/launchbadge/sqlx/pull/3585

[#&#8203;3593]: https://redirect.github.com/launchbadge/sqlx/pull/3593

[#&#8203;3596]: https://redirect.github.com/launchbadge/sqlx/pull/3596

[#&#8203;3601]: https://redirect.github.com/launchbadge/sqlx/pull/3601

[#&#8203;3604]: https://redirect.github.com/launchbadge/sqlx/pull/3604

[#&#8203;3605]: https://redirect.github.com/launchbadge/sqlx/pull/3605

[#&#8203;3608]: https://redirect.github.com/launchbadge/sqlx/pull/3608

[#&#8203;3612]: https://redirect.github.com/launchbadge/sqlx/pull/3612

[#&#8203;3623]: https://redirect.github.com/launchbadge/sqlx/pull/3623

[#&#8203;3629]: https://redirect.github.com/launchbadge/sqlx/pull/3629

[#&#8203;3632]: https://redirect.github.com/launchbadge/sqlx/pull/3632

[#&#8203;3640]: https://redirect.github.com/launchbadge/sqlx/pull/3640

[#&#8203;3643]: https://redirect.github.com/launchbadge/sqlx/pull/3643

[#&#8203;3648]: https://redirect.github.com/launchbadge/sqlx/pull/3648

[#&#8203;3649]: https://redirect.github.com/launchbadge/sqlx/pull/3649

[#&#8203;3658]: https://redirect.github.com/launchbadge/sqlx/pull/3658

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 3pm on Wednesday" in timezone
America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS45Mi4wIiwidXBkYXRlZEluVmVyIjoiMzkuOTIuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-28 10:22:41 +02:00
张小白
79991650af
windows: Refactor mouse events related code (#23729)
Release Notes:

- N/A
2025-01-28 15:48:43 +08:00
张小白
e083679e0d
windows: Prefer WM_SETTINGCHANGE when handing theme changed events (#23727)
I recently noticed that on my Windows 11 machine, Zed no longer receive
the `WM_DWMCOLORIZATIONCOLORCHANGED` message when the system theme
changes. This functionality was present in the past. While this change
might be unexpected, it's understandable given Microsoft's history of
system updates.

This pull request proposes an alternative approach using the
`WM_SETTINGCHANGE` message to handle theme changes.

Release Notes:

- N/A
2025-01-28 15:47:55 +08:00
Joseph T. Lyons
1b88734c6c
Flag issues as stale more aggressively (#23761)
We used to wait 6 months to close stale issues. Jono suggested 1 month.
I'm sort of splitting the difference and adding a bit of buffer. We can
adjust again later on, if we want.

Release Notes:

- N/A
2025-01-28 01:38:15 -05:00
Jason Lee
3eba831de8
Fix closest_index_for_x to get correct offset when only 1 char (#23603)
Release Notes:

- N/A

----------

This bug can easy to replay by `input` example, just enter 1 char and
click on the middle of the char, we can't move cursor to 0, it is always
be 1.

```bash
cargo run -p gpui --example input
```

## Before


https://github.com/user-attachments/assets/3239dd47-278e-4311-9757-5165d1ccd796

## After


https://github.com/user-attachments/assets/4e2c1500-0142-4e28-bf34-7ef1f4929925
2025-01-27 23:18:18 -07:00
CharlesChen0823
02503cf3be
vim: Fix NextSubwordEnd crash (#23604)
Closes #23550 

Release Notes:

- N/A
2025-01-27 23:13:13 -07:00
tims
d090caccd7
workspace: Prefer active window over other local non-collab windows for opening file (#23726)
Closes #21625 #17401 #16426

This is how the opening of a file works currently:

1. We first check if the file is part of any existing worktree. If it
is, we focus on that file in the worktree, and the window is activated.
2. If the file is not part of any worktree, we open it in the first
local non-collab workspace we find and activate that window. This is the
bug that the issues are based on.

This PR fixes it by modifying the second part of the above step, where
the file is not part of any worktree. Now, we will first open the file
in the active window, but only if the active window is local and
non-collab. This resolves the issue. If the file can't be opened in the
active window due to the local non-collab check, we will carry out the
existing logic of opening the file in whichever window is local and
non-collab.

I have tested this using the "workspace::OpenFiles" action, and
"workspace::Open" also uses the same method. That is, it will work on
all platforms.

Future: Some users also mentioned there should be a setting for whether
we should open a non-workspace file in the existing window or in a
separate new window. However, this seems out of scope, and a new issue
should be created for this.

#9370 is related, but this likely doesn't fix it, as it deals with how
macOS Finder's "Open with" handles files. I don't have macOS to test,
but this PR won't resolve it if Finder always opens a new window.

Release Notes:

- Fixed the issue where a file outside of the workspace was opening in a
random window instead of the last active window.
2025-01-27 23:11:35 -07:00
Conrad Irwin
7deafdafae
Fix run indicators with expanded diff hunks (#23758)
Fix runnable positioning when diff hunks are altered.

Release Notes:

- N/A
2025-01-27 23:05:46 -07:00
Max Brunsfeld
ee5f270f3f
Fix unnecessarily large edits emitted from multi buffer on diff recalculation (#23753)
This fixes an issue introduced in #22994 where soft wrap would
recalculate for the entire buffer when editing.

Release Notes:

- N/A

---------

Co-authored-by: Conrad <conrad@zed.dev>
2025-01-27 18:11:15 -08:00
Danilo Leal
5331418f3a
pane: Add settings to hide the tab bar buttons (#23752)
This PR adds the `show_tab_bar_buttons` under `tab_bar` that allows
hiding the "New", "Split Pane", and "Zoom" buttons to the left of the
pane tab bar.

Release Notes:

- Added a new `show_tab_bar_buttons` setting, under `tab_bar`, that
enables hiding the pane tab bar buttons.
2025-01-27 21:36:33 -03:00
Danilo Leal
7a6223e71b
assistant2: Add tiny visual adjustments (#23748)
This PR adds really tiny visual adjustments to the assistant 2. I guess
the most note-worthy thing here is that I separated the `title` for
History views into two just because I wanted to render the `/` smaller
and lighter. 😬

Release Notes:

- N/A
2025-01-27 20:26:34 -03:00
Joseph T. Lyons
06424c9608
Update actions to open GitHub issue templates (#23747)
Release Notes:

- N/A
2025-01-27 18:17:43 -05:00
Peter Tripp
15933d478f
New Github Issue Templates v2 (#23746) 2025-01-27 17:45:53 -05:00
Peter Tripp
82b81ed6d6
New GitHub Issue Templates (#23745)
Co-authored-by: Joseph T. Lyons <joseph@zed.dev>
Co-authored-by: Conrad Irwin <conrad@zed.dev>
2025-01-27 17:38:29 -05:00
Joseph T. Lyons
23b92e3057
Remove issue automation (#23743)
Release Notes:

- N/A
2025-01-27 22:12:26 +00:00
Cole Miller
27d57ba3b6
git: First stab at adding Linux and Vim keybindings (#23738)
Release Notes:

- N/A
2025-01-27 16:58:09 -05:00
Mikayla Maki
a7c549b85b
Fix window double borrows (#23739)
Fix bugs caused by the window context PR, where the window could be on
the stack and is then requested from the App.
This PR also adds derive macros for `AppContext` and `VisualContext` so
that it's easy to define further contexts in API code, such as
`editor::BlockContext`.

Release Notes:

- N/A
2025-01-27 21:56:29 +00:00
邻二氮杂菲
29bfb56739
Add DeepSeek support (#23551)
- Added support for DeepSeek as a new language model provider in Zed
Assistant
- Implemented streaming API support for real-time responses from
DeepSeek models.
- Added a configuration UI for DeepSeek API key management and settings.
- Updated documentation with detailed setup instructions for DeepSeek
integration.
- Added DeepSeek-specific icons and model definitions for seamless
integration into the Zed UI.
- Integrated DeepSeek into the language model registry, making it
available alongside other providers like OpenAI and Anthropic.

Release Notes:

- Added support for DeepSeek to the Assistant.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-01-27 13:40:59 -05:00
Marshall Bowers
f096a28a19
assistant2: Don't block ThreadStore initialization on reloading the threads (#23728)
This PR changes the `ThreadStore` constructor to not block on reloading
the threads before we finish initializing it.

This allows us to make the constructor synchronous instead of
asynchronous.

Release Notes:

- N/A
2025-01-27 12:59:28 -05:00
Marshall Bowers
9705764892
assistant2: Fix opening the configuration via the button (#23732)
This PR fixes an issues where clicking the "Open Configuration" button
wasn't opening the configuration.

We needed to change how the action was dispatched after #22632.

Release Notes:

- N/A
2025-01-27 17:47:18 +00:00
João Marcos
2256c21841
Silence Rust-Analyzer false-positive (#23724)
Release Notes:

- N/A
2025-01-27 16:38:03 +00:00
Marshall Bowers
ad49f71e6e
assistant2: Add debug logging for initialization issues (#23722)
This PR adds some logging so we can debug the issues some folks have
been having with Assistant2 not getting initialized properly.

All the logs are prefixed with `[assistant2-debug]` so they're easier to
pick out of the logs, as well as find them later to clean up once we've
diagnosed the issue.

Release Notes:

- N/A
2025-01-27 16:27:59 +00:00
Danilo Leal
98ea0587df
assistant: Preserve selection focus in the model selector (#23713)
This PR fixes an incorrect behavior in the model selector where we were
removing the focus from the selected item back to the very first item of
the list. Now, if you click/hit return on an item, focus is preserved
there. In other words, focus is always initially in the selected item.

### Before

https://github.com/user-attachments/assets/62b72b1f-4e32-4b4a-adff-dcf9a2c13a28

### After

https://github.com/user-attachments/assets/a8528933-da01-481a-96f3-0173a39a03c0

Release Notes:

- N/A
2025-01-27 12:29:08 -03:00
Danilo Leal
93b62e0ed4
assistant: Fix model selector label shift (#23717)
This PR caps the width of the model label in the selector trigger to a
certain size. This is fix the behavior of the popover dancing around,
given its popover position is anchored to a certain edge of the trigger,
and if the trigger size increases while you select different models with
different name lengths, the popover dances around.

### Before


https://github.com/user-attachments/assets/0854fa2b-9eb2-45fb-886d-bde1cd644dcf

### After

Note how even though the second item has the largest label, the popover
stays in place.


https://github.com/user-attachments/assets/06b60030-65dc-4f06-b486-3045042bbff0

Fixing that then means truncating the model name to keep it constrained
into a max-width.

<img width="500" alt="Screenshot 2025-01-27 at 11 38 14 AM"
src="https://github.com/user-attachments/assets/94ce9cc6-848c-4dac-86b8-321da75c3af3"
/>

Release Notes:

- N/A
2025-01-27 12:28:58 -03:00
Danilo Leal
91f44725d9
assistant2: Fix model selector position (#23721)
This PR makes the model selector not render on top of its trigger.

<img width="800" alt="Screenshot 2025-01-27 at 12 02 01 PM"
src="https://github.com/user-attachments/assets/76c5ac6f-ae27-4b3d-a80a-3027042c75f8"
/>

Release Notes:

- N/A
2025-01-27 12:28:45 -03:00
Peter Tripp
b58c994706
docs: Example OpenAI model config missing version key (#23720) 2025-01-27 15:17:51 +00:00
Andrew Borg (Kashin)
9f3dbd6fa3
Make ZED_WORKTREE_ROOT always point to a directory or is not set (#23150)
When the out-of-tree file like `tasks.json` is-focus, tasks spawn with `ZED_WORKTREE_ROOT` unset.
2025-01-27 10:10:39 -05:00
Peter Tripp
33921362cf
docs: Fix error in OpenAI configuring custom models (#23716) 2025-01-27 14:47:09 +00:00
Peter Tripp
f6d286c7db
openai: Add back O1-Preview (#23715)
Follow-up to: https://github.com/zed-industries/zed/pull/23425
2025-01-27 14:44:12 +00:00
Kirill Bulatov
5bde053b0d
Avoid panics when normalizing completion label with invalid ranges (#23712)
Dev builds show panics related to completion label normalization

<details>
<summary>Panic</summary>

```
index out of bounds: the len is 103 but the index is 103
zed::reliability::init_panic_hook::{{closure}}::h78130eff43c84f6f+110375521
std::panicking::rust_panic_with_hook::hfe205f6954b2c97b+87457752
std::panicking::begin_panic_handler::{{closure}}::h6cb44b3a50f28c44+87456967
std::sys::backtrace::__rust_end_short_backtrace::hf1c1f2a92799bb0e+87449337
rust_begin_unwind+87456084
core::panicking::panic_fmt::h3d8fc78294164da7+7033011
core::panicking::panic_bounds_check::h9397cb495d89a72d+7033511
project::lsp_store::ensure_uniform_list_compatible_label::haf80316ce11edd67+72663592
project::lsp_store::populate_labels_for_completions::{{closure}}::hc93c3c540ef7d2d6+72642960
project::lsp_store::LspStore::completions::{{closure}}::{{closure}}::hb4b5432e24432ca8+72336627
async_task::raw::RawTask<F,T,S,M>::run::hf444c3dc07dd583b+68504803
<gpui::platform::linux::wayland::client::WaylandClient as gpui::platform::linux::platform::LinuxClient>::run::hbf5a316eb781a10d+50646579
gpui::platform::linux::platform::<impl gpui::platform::Platform for P>::run::hc85518d4552fc4cd+50496669
gpui::app::App::run::hca4e2eaf984ca6f6+109905269
zed::main::h849467ac1a6d32c9+110413414
std::sys::backtrace::__rust_begin_short_backtrace::h81b5ee155a7cf505+110835475
std::rt::lang_start::{{closure}}::h48a83f884cfb6865+110834761
std::rt::lang_start_internal::h5e7c81cecd7f0954+87382485
main+110425932
__libc_start_call_main+22789462491720
__libc_start_main_alias_1+22789462491915
_start+10436606
```
</details>

This can only happen when either `label.runs` or `label.filter_range`
has a range that's larger than the label text, which is an error.
Instead of panicking, log such errors and fall back to last index (which
is not really helpful, but still).

Release Notes:

- N/A
2025-01-27 14:18:39 +00:00
Matin Aniss
06d00b940d
gpui: Support windows dark mode title bar (#23700)
This will allow Windows GPUI applications that utilise the native title
bar to support the dark mode variant when the system user has dark mode
enabled in their system settings. [Related Win32
information](https://learn.microsoft.com/en-us/windows/apps/desktop/modernize/ui/apply-windows-themes)

| Before  | After |
| ------------- | ------------- |
|
![image](https://github.com/user-attachments/assets/50f3d131-8f41-4b91-8012-f8120b150033)
|
![image](https://github.com/user-attachments/assets/a36a6c6b-a469-49ba-85a8-9b55db9ea20f)
|

Release Notes:

- N/A

---------

Co-authored-by: 张小白 <364772080@qq.com>
2025-01-27 20:07:28 +08:00
loczek
6293b20fd0
Add auto-completion support for snippet files (#23698)
Release Notes:

- Added auto-completion support for snippet files.


![image](https://github.com/user-attachments/assets/ad165fc7-a6e7-426c-8892-f7004515dfc7)
2025-01-27 12:32:22 +01:00
Michael Sloan
6e9ea47849
Fix completions menu scroll when y_flipped and edit prediction arrives (#23580)
Release Notes:

- N/A
2025-01-27 00:36:21 -07:00