Commit Graph

15253 Commits

Author SHA1 Message Date
Thorsten Ball
4eedbdedae
linux: Use optional compile-time RELEASE_VERSION variable (#11490)
This implements `app_version` on Linux by using an optional,
compile-time `RELEASE_VERSION` env var that can be set.

We settled on the `RELEASE_VERSION` as the name, since it's similar to
`RELEASE_CHANNEL` which we use in Zed.

cc @ConradIrwin @mikayla-maki 

Release Notes:

- N/A

Co-authored-by: Bennet <bennetbo@gmx.de>
2024-05-07 17:50:19 +02:00
Conrad Irwin
e2907983d1
don't report hangs on stable (#11494)
Release Notes:

- N/A
2024-05-07 09:35:52 -06:00
Kyle Kelley
72c47b7f01
Assistant grouping (#11479)
Groups collections of assistant messages with their tool calls as
children of the assistant message container.


![image](https://github.com/zed-industries/zed/assets/836375/b26b7c90-4c8d-4bbd-972a-1e769d78a455)

Release Notes:

- N/A
2024-05-07 08:21:57 -07:00
Marshall Bowers
c77d2eb73f
Increase short SHA length to 7 characters (#11492)
This PR increases the length of a shortened Git SHA from 6 to 7
characters.

This matches what GitHub uses.

I also took the opportunity to factor out a common method for computing
a short SHA so that we have a single source of truth for the length that
we're using.

Release Notes:

- Increased the short commit SHA length used by git blame from 6 to 7
characters.
2024-05-07 11:10:44 -04:00
Kirill Bulatov
bcf7bc9de8
Do not toggle hunk diffs when resizing the docks (#11489)
Closes https://github.com/zed-industries/zed/issues/11456 

Release Notes:

- N/A

---------

Co-authored-by: Piotr <piotr@zed.dev>
2024-05-07 17:06:12 +03:00
Thorsten Ball
5a7b8f7fe3
linux: Fix restarting by waiting for sockets to be closed (#11488)
This fixes a race-condition that showed up when trying to restart
Nightly/Preview/...

When running with these release channels, Zed tries to ensure that
there's only one instance of Zed running.

It does that by listening on a TCP socket to which other instances can
connect on start. If the other instance receives a message, it knows
that another Zed instance is running and exits.

On Linux, though, we ran into a race condition:

1. `kill -0`, which checks whether a process is still running, returns
an error, signalling that the old Zed process has exited
2. BUT: the process was still listening on the TCP port.

It seems like that on Linux, process resources aren't guaranteed to be
cleaned up as soon as signal handling stops working for a process.

The fix is to wait until the process is no longer listening on any TCP
sockets.

There's a slight downside to this: GPUI processes that never listen on
any TCP sockets now have to pay the cost of an additional `lsof` call
when restarting. We do think that it's a reasonable tradeoff for now
though, since the other options (extending the platform interface to
provide callbacks, sharing the listening port in the framework, ...)
seem wider-reaching only to fix a very local bug.



Release Notes:

- N/A

Co-authored-by: Bennet <bennetbo@gmx.de>
2024-05-07 15:46:41 +02:00
Piotr Osiewicz
0c11d841e8
editor: Move runnables querying to background thread (#11487)
Originally reported by @mrnugget and @bennetbo 
Also, instead of requerying them every frame, we do so whenever buffer
changes.

As a bonus, I modified tree-sitter query for Rust tests.

Release Notes:

- N/A
2024-05-07 15:31:07 +02:00
CharlesChen0823
843d299d9a
Windows: Fix canonicalize return UNC path (#11083)
In Windows platform, using notify to watch file events. 
1. in [notify windows
implement](3df0f65152/notify/src/windows.rs (L344)),
we get the full file path, just with `path.join(file_path)`.
2. In [zed worktree
start_backgroud_scan_tasks](d2569afe66/crates/worktree/src/worktree.rs (L679)),
`abs_path` is not unc path, so we get all file events with not unc path.
3. but in [zed worktree
process_event](d2569afe66/crates/worktree/src/worktree.rs (L3619)),
we `strip_prefix` unc path all times, it will always print annoy error.

@mikayla-maki I can't reopen pre closed pr #10501 .

Release Notes:

- N/A
2024-05-06 18:25:21 -07:00
Marshall Bowers
88c4e0b2d8
Add a registry for GitHostingProviders (#11470)
This PR adds a registry for `GitHostingProvider`s.

The intent here is to help decouple these provider-specific concerns
from the lower-level `git` crate.

Similar to languages, the Git hosting providers live in the new
`git_hosting_providers` crate.

This work also lays the foundation for if we wanted to allow defining a
`GitHostingProvider` from within an extension. This could be useful if
we wanted to extend the support to work with self-hosted Git providers
(like GitHub Enterprise).

I also took the opportunity to move some of the provider-specific code
out of the `util` crate, since it had leaked into there.

Release Notes:

- N/A
2024-05-06 21:24:48 -04:00
Max Brunsfeld
a64e20ed96
Centralize project context provided to the assistant (#11471)
This PR restructures the way that tools and attachments add information
about the current project to a conversation with the assistant. Rather
than each tool call or attachment generating a new tool or system
message containing information about the project, they can all
collectively mutate a new type called a `ProjectContext`, which stores
all of the project data that should be sent to the assistant. That data
is then formatted in a single place, and passed to the assistant in one
system message.

This prevents multiple tools/attachments from including redundant
context.

Release Notes:

- N/A

---------

Co-authored-by: Kyle <kylek@zed.dev>
2024-05-06 17:01:50 -07:00
Nate Butler
f2a415135b
Continue Assistant 2 Messages Layout (#11465)
Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
2024-05-06 15:44:34 -07:00
jansol
d6a6330419
gpui/blade: add alpha handling for non-rounded quads (#11461)
Fixes
https://github.com/zed-industries/zed/pull/10973#issuecomment-2096586316

Release Notes:

- N/A
2024-05-06 14:38:00 -07:00
Soroush Mirzaei
da6a6ec36b
Add col/row resize cursor styles (#11406)
This PR fixes a small issue I noticed with resize cursors. The
column/row resize cursors were missing and in a few places we were using
`ew-resize` and `ns-resize` even though the documentation mentions
`col-resize` and `row-resize`.

Finally updated the panes in the workspace to use the new column/row
resize cursors.

Before:

![Screenshot_20240505_111515](https://github.com/zed-industries/zed/assets/829535/50f28a1b-33e2-431a-8fc8-5048d89c8f7b)

![Screenshot_20240505_111521](https://github.com/zed-industries/zed/assets/829535/45856f7e-4ca9-4b39-9f8c-144934e9d41e)

After:

![Screenshot_20240505_110606](https://github.com/zed-industries/zed/assets/829535/2b247ec1-44ef-4293-87b3-7fda4b2ebf8f)

![Screenshot_20240505_110611](https://github.com/zed-industries/zed/assets/829535/b558e1ce-3e08-4de3-8a11-6a80184d84fe)



Release Notes:

- Added column/row resize cursor styles to GPUI
- Fixed the existing references that were incorrectly using `ew-resize`
for column resize and `ns-resize` for row resize
- Updated panes to use column/row resize cursors instead on `ew-resize`
and `ns-resize`

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-05-06 14:22:56 -07:00
Conrad Irwin
f3fffc25c4
Don't log JSON parse errors with no settings (#11459)
Release Notes:

- Silenced error messages on startup when no settings/keymap files
exist.
2024-05-06 14:55:44 -06:00
moshyfawn
2e6d044bac
Fix Collab context menu dismissal (#11414)
Closes: #11413

Release Notes:

- Fixed Collab panel context menu dismissal with `Escape` key
([#11413](https://github.com/zed-industries/zed/issues/11413)).
2024-05-06 13:51:02 -07:00
CharlesChen0823
530bc5c99e
windows: Fix crash in vim normal mode when IME key is pressed (#11387)
Fixed crash in vim normal mode when ime key press.

Release Notes:

- N/A
2024-05-06 13:31:49 -07:00
Tim
9edd81c740
Add Windows specific path parsing (#11119)
Since Windows paths are known to be weird and currently not handled at
all (outside of relative paths that just happen to work), I figured I
would add a windows specific implementation for parsing absolute paths.
It should be functionally the same, of course there's always a chance I
missed an edge case though.

This should fix
- #10849

Note that there are still some cases that will probably break the
current implementation, namely local drives that do not have a drive
letter assigned (not sure how to handle those). There's also UNC paths
but I don't know how important those are at the moment (I'll allow
myself to assume not at all)

Release Notes:

- N/A
2024-05-06 13:27:26 -07:00
apricotbucket28
11bc28080f
linux: Fix some small issues (#11458)
Fixed various small issues on Linux, mainly on Wayland.

Apart from the first commit (which should be self-describing), the other
commits have a description explaining the issue and what they do.

caadc58bea should fix
https://github.com/zed-industries/zed/issues/11037

Release Notes:

- N/A
2024-05-06 13:23:49 -07:00
张小白
68a0035264
Remove unused callbacks (#11410)
This PR follows up #11314 (which removes some deprecated `callback`s)
removes the corresponding implements.

Release Notes:

- N/A
2024-05-06 13:21:35 -07:00
Owen Law
9a60c0a059
Replace all X11 mouse events with XI2 equivalents (#11235)
This PR replaces all pointer events on X11 with their XI2 equivalents,
which fixes problems with scroll events not being reported when a mouse
button is down. Additionally it closes #11206 by resetting the tracked
global scroll valulator position with `None` on a leave event to prevent
a large scroll delta if scrolling is done outside the window. Lastly, it
resolves the bad window issue kvark was having.

Release Notes:

- Fixed X11 Scroll snapping (#11206 ).

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-05-06 13:19:28 -07:00
apricotbucket28
5486c3dc93
wayland: Refactor serial usage (#11388)
Adds a `SerialTracker` type which helps simplify serial handling.

Release Notes:

- N/A
2024-05-06 13:15:42 -07:00
Fernando Tagawa
3018a64a1b
Wayland: Improve first click detection (#11371)
Release Notes:

- N/A

This changes the first click detection in Wayland by requiring first
click after the keyboard loses focus, and after a `wl_pointer` enters a
window that has keyboard focus
2024-05-06 13:11:58 -07:00
张小白
8633909347
windows: Fix drag drop action (#11332)
The coordinates are screen-based points, converts them to client-based
points then to logical points.

Release Notes:

- N/A
2024-05-06 13:09:28 -07:00
apricotbucket28
091e7cb395
x11: Cursor style support (#11237)
Adds cursor style support to X11

![image](https://github.com/zed-industries/zed/assets/71973804/e5a2414f-4d80-4963-93d2-e4a15878a718)


Release Notes:

- N/A
2024-05-06 13:05:00 -07:00
Marshall Bowers
bb1817ff31
Refactor Git hosting providers (#11457)
This PR refactors the code pertaining to Git hosting providers to make
it more uniform and easy to add support for new providers.

There is now a `GitHostingProvider` trait that contains the
functionality specific to an individual Git hosting provider. Each
provider we support has an implementation of this trait.

Release Notes:

- N/A
2024-05-06 15:44:13 -04:00
Marshall Bowers
8871fec2a8
Adjust names of negated style methods (#11453)
This PR adjusts the names of the negated style methods by moving the
`neg_` to after the property name instead of before.

This will help keep related style methods grouped together in
completions.

It also makes it a bit clearer that the negation applies to the value.

### Before

```rs
div()
    .neg_mx_1()
    .neg_mt_2()
```

### After

```rs
div()
    .mx_neg_1()
    .mt_neg_2()
```

Release Notes:

- N/A
2024-05-06 13:56:25 -04:00
Kyle Kelley
32b59bfa0e
Trim index output (#11445)
Trims down the project index output view in assistant2 to just list the
filenames and hideaway the query.

<img width="374" alt="image"
src="https://github.com/zed-industries/zed/assets/836375/8603e3cf-9fdc-4661-bc45-1d87621a006f">

Introduces a way for tools to render running.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2024-05-06 10:37:31 -07:00
Marshall Bowers
f658af5903
Make border methods always require an explicit width (#11450)
This PR makes the `border` methods require an explicit width instead of
defaulting to 1px.

This breaks convention with Tailwind, but it makes GPUI more consistent
with itself. We already have an edge case where the parameterized method
had to be named `border_width`, since `border` was taken up by an alias
for the 1px variant.

### Before

```rs
div()
    .border()
    .border_t()
    .border_r()
    .border_b()
    .border_l()
    .border_width(px(7.))
```

### After

```rs
div()
    .border_1()
    .border_t_1()
    .border_r_1()
    .border_b_1()
    .border_l_1()
    .border(px(7.))
```

Release Notes:

- N/A
2024-05-06 13:22:47 -04:00
Dzmitry Malyshau
e4f13dd561
Blade window transparency (#10973)
Release Notes:

- N/A

Following up to #10880
TODO:
- [x] create window as transparent
  - [x] X11
  - [x] Wayland
  - [ ] Windows
  - [x] MacOS (when used with Blade)  
- [x] enable GPU surface transparency
- [x] adjust the pipeline blend modes
- [x] adjust shader outputs


![transparency2](https://github.com/zed-industries/zed/assets/107301/d554a41b-5d3f-4420-a857-c64c1747c2d5)

Blurred results from @jansol (on Wayland), who contributed to this work:


![zed-blur](https://github.com/zed-industries/zed/assets/107301/a6822171-2dcf-4109-be55-b75557c586de)

---------

Co-authored-by: Jan Solanti <jhs@psonet.com>
2024-05-06 09:53:08 -07:00
Conrad Irwin
0aab6d8bdc
Fix race condition in editor show_hover (#11441)
The DisplayPoint returned from the position map is only valid at the
snapshot in the position map.

Before this change we were erroneously using it to index into the
current version of the buffer.

Release Notes:

- Fixed a panic caused by a race condition in hover.
2024-05-06 09:46:30 -06:00
Adam
d0c95c2f43
Add Svelte to list of ESLint languages (#11437)
Release Notes:

- Added ESLint as a default language server for Svelte.
2024-05-06 11:38:55 -04:00
Bennet Bo Fenner
237cc9b4a9
remoting: Adjust prompt level for dev server prompts (#11440)
This changes the remoting prompts to use `PromptLevel::Warning` instead
of `PromptLevel::Destructive`.
In #11015 we decided to apply PromptLevel::Destructive to prompts other
than the new path picker. However, we did not notice that this breaks
confirmation with the keyboard, so it should really only be used in
specific situations (e.g. replacing a file with the remote "save as"
picker, because it matches the behavior of the macOS file dialog).

Release Notes:

- N/A
2024-05-06 17:30:06 +02:00
Piotr Osiewicz
d4636481ac
tasks: Prefer worktree tasks to global tasks in tag selection (#11427)
Release Notes:

- Added test indicators in Rust files, backed by task system.
2024-05-06 16:53:48 +02:00
Zelaren
80733e919d
Fix cfg!(target_os) spelling mistake (#11430)
This PR fixes the spelling mistake cfg!(target_os = "windows")

Release Notes:

- N/A
2024-05-06 16:41:05 +03:00
Piotr Osiewicz
27a9498cb0
editor: Fix up task indicators in multibuffers (#11434)
We were retrieving task context incorrectly with a display point row as
the location argument, and not the actual row in the buffer.



Release Notes:

- N/A
2024-05-06 15:39:49 +02:00
Bennet Bo Fenner
593f0e0c3e
remoting: Edit dev server (#11344)
This PR allows configuring existing dev server, right now you can:
- Change the dev servers name
- Generate a new token (and invalidate the old one)

<img width="563" alt="image"
src="https://github.com/zed-industries/zed/assets/53836821/9bc95042-c969-4293-90fd-0848d021b664">


Release Notes:

- N/A
2024-05-06 12:58:11 +02:00
José Olórtegui
6e2be283dd
emmet: Support more languages (#10779)
Hey guys! `emmet-language-server` author here. Thank you so much for the
amazing editor!

This PR adds more languages to the list for the `emmet-language-server`
to attach to.

I have a question though, I saw that you guys don't differentiate yet
between `JavaScript` and `JSX` files. I know that the tree-sitter parser
for `js` comes with the ability to parse both but we still need to make
that difference. Is that part of the plan? or do you have a reason for
doing that?

Aside from that, I've still added support for `JavaScript` files since
is important to have emmet completions in `JSX` files, but I would like
to know what are your thoughts on that since doing this may pollute the
completions in `.js` files.

And one last thing, the emmet language server accepts more filetypes
such as `pug`, `sass`, `scss` and `less` files, which are not currently
supported by zed. Should I create some extensions to add grammar support
to those files later? Should those extensions be part of the zed repo?
I'm just thinking that those are sort of core languages.

Aside from that, let me know if there's anything left to do on my side.
Greetings!

Fixes #10654.

Release Notes:

- N/A
2024-05-06 12:09:19 +02:00
Bennet Bo Fenner
cf6c2daaa2
remoting: Register remote modal action when flag is present (#11426)
Fixes #11391

Release Notes:

- N/A
2024-05-06 11:31:30 +02:00
Bennet Bo Fenner
283d424485
remoting: Prevent user from creating multiple dev servers accidentally (#11425)
Fixes #11389 

Release Notes:

- N/A
2024-05-06 11:02:52 +02:00
Nate Butler
08c9157a1e
Standardize TabBar start_slot and end_slot elements (#11403)
- Unifies spacing between left and right sides of the tab bar
- Use the default icon color for `end_slot` tools. This should help more
clearly differentiate when forward or backward navigation is disabled
due to the tools on the other side not looking so much like the disabled
navigation arrows.
- Rework the TabBar implementation in `pane.rs` to directly pass in
items to the `start_slot` instead of an unneeded extra horizontal
layout.

Left side:

![CleanShot 2024-05-05 at 11 08
35@2x](https://github.com/zed-industries/zed/assets/1714999/ec80fda5-17ce-4cd4-ae54-8c63dcc79e69)

Right side:

![CleanShot 2024-05-05 at 11 09
04@2x](https://github.com/zed-industries/zed/assets/1714999/0281e462-202f-407b-b6b7-7acbcde9138f)

Release Notes:

- Standardized some Tab Bar UI elements. You many notice some slight
spacing or color changes.
2024-05-05 19:59:18 -04:00
Kirill Bulatov
1e84f01041
Use lowercased language name as language id fallback (#11412) 2024-05-05 22:27:18 +03:00
Piotr Osiewicz
5a71d8c7f1
Add support for detecting tests in source files, and implement it for Rust (#11195)
Continuing work from #10873 

Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-05-05 16:32:48 +02:00
Piotr Osiewicz
14c7782ce6
chore: Fix main CI after upgrade to Rust 1.78 (#11402)
The CI was green at the time I've merged Rust 1.78, but a change that
violated clippy::empty_doc has slipped through into main in the
meantime. Mea culpa, I should've reran the CI.



Release Notes:

- N/A
2024-05-05 15:37:53 +02:00
Piotr Osiewicz
1a9b0536a2
Rust 1.78 (#11314)
Notable things I've had to fix due to 1.78:
- Better detection of unused items
- New clippy lint (`assigning_clones`) that points out places where assignment operations with clone rhs could be replaced with more performant `clone_into`
Release Notes:

- N/A
2024-05-05 15:02:50 +02:00
Kirill Bulatov
9ec0927701
Respect LSP completion triggers when copilot suggestion is on (#11401) 2024-05-05 13:01:52 +03:00
Max Brunsfeld
89039f6f34
Restore rendering of assistant tool calls (#11385)
Chat message rendering was restructured in
https://github.com/zed-industries/zed/pull/11327, but it caused tool
calls not to be rendered if the assistant hadn't generated any message
text.

before:

![Screenshot 2024-05-03 at 10 02
57 PM](https://github.com/zed-industries/zed/assets/326587/2b7fd763-0c75-4690-9824-3bd37a3efef2)

after:

<img width="518" alt="Screenshot 2024-05-03 at 11 17 45 PM"
src="https://github.com/zed-industries/zed/assets/326587/34de19ba-daf2-4ac1-9fe0-f51d0ce94872">

Release Notes:

- N/A
2024-05-03 23:33:47 -07:00
Max Brunsfeld
6964302d89
More fixes to the semantic index's chunking (#11376)
This fixes a tricky intermittent issue I was seeing, where failed to
chunk certain files correctly because of the way we reuse Tree-sitter
`Parser` instances across parses.

I've also accounted for leading comments in chunk boundaries, so that
items are grouped with their leading comments whenever possible when
chunking.

Finally, we've changed the `debug project index` action so that it opens
a simple debug view in a pane, instead of printing paths to the console.
This lets you click into a path and see how it was chunked.

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-05-03 19:00:18 -07:00
Kyle Kelley
f576bd3aaf
Clean up some stray todos (#11380)
Quick little todo comment cleanups, either because they aren't needed or
a comment will suffice.

Release Notes:

- N/A
2024-05-03 16:17:56 -07:00
Kyle Kelley
3e5dcd1bec
Attachment store for assistant2 (#11327)
This sets up a way for the user (or Zed) to _push_ context instead of
having the model retrieve it with a function. Our first use is the
contents of the current file.

<img width="399" alt="image"
src="https://github.com/zed-industries/zed/assets/836375/198429a5-82af-4b82-86f6-cb961f10de5c">

<img width="393" alt="image"
src="https://github.com/zed-industries/zed/assets/836375/cfb52444-723b-4fc1-bddc-57e1810c512b">

I heard the asst2 example was deleted in another branch so I deleted
that here too since we wanted the workspace access.

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
2024-05-03 14:48:00 -07:00
apricotbucket28
86696d88cf
wayland: Implement xdg-activation when opening urls (#11368)
Since Wayland doesn't have a way for windows to activate themselves,
currently, when you click on a link in Zed, the browser window opens in
the background.

This PR implements the `xdg-activation` protocol to get an activation
token, which the browser can use to raise its window.


https://github.com/zed-industries/zed/assets/71973804/8b3456c0-89f8-4201-b1cb-633a149796b7

Release Notes:

- N/A
2024-05-03 14:02:39 -07:00