Commit Graph

15147 Commits

Author SHA1 Message Date
Conrad Irwin
3752ed294d
open new buffer (#11203)
Release Notes:

- Allow creating new untitled buffers in remote projects

TODO:
- Add a Test
- Fix version number check
2024-04-30 16:09:43 -06:00
Marshall Bowers
d55b637b7e
assistant2: Fix the height of collapsed messages (#11230)
This PR fixes the height of collapsed messages, addressing the
associated TODO comment.

Release Notes:

- N/A
2024-04-30 17:44:51 -04:00
Marshall Bowers
f2a1226e18
assistant2: Setup storybook (#11228)
This PR sets up the `assistant2` crate with the storybook so that UI
elements can be iterated on in isolation.

To start, we have some stories for the `ChatMessage` component:

```sh
cargo run -p storybook -- components/assistant_chat_message
```

<img width="1233" alt="Screenshot 2024-04-30 at 5 20 03 PM"
src="https://github.com/zed-industries/zed/assets/1486634/510967ea-0e9b-4fa9-94fb-421ee74bcc45">

Release Notes:

- N/A
2024-04-30 17:33:32 -04:00
Marshall Bowers
96b1fc4650
assistant2: Align chat messages with composer (#11227)
This PR adds some additional spacing to the composer so it aligns with
the chat messages.

Release Notes:

- N/A
2024-04-30 17:00:23 -04:00
Conrad Irwin
cb7350174e
Don't allow dropping files on remote projects (#11218)
Release Notes:

- Fixed a panic when a remote participant dropped a local file on your
project
2024-04-30 14:24:47 -06:00
Marshall Bowers
f11a7811f3
assistant2: Use composer for editing inline messages (#11222)
This PR updates the assistant to render historical user messages the
same as ones from the assistant.

Double-clicking on a message will open a composer inline for editing.
Pressing `Esc` will cancel the edit.

We don't yet restore the previous state of the message upon canceling.

<img width="401" alt="Screenshot 2024-04-30 at 4 04 01 PM"
src="https://github.com/zed-industries/zed/assets/1486634/5f253fa8-6578-4054-be30-c495e326d700">

<img width="401" alt="Screenshot 2024-04-30 at 4 04 28 PM"
src="https://github.com/zed-industries/zed/assets/1486634/edf25cea-d97e-44d2-8772-3690eac017a4">


Release Notes:

- N/A
2024-04-30 16:12:20 -04:00
Max Brunsfeld
38b9d5cc36
Fix some semantic index issues (#11216)
* [x] Fixed an issue where embeddings would be assigned incorrectly to
files if a subset of embedding batches failed
* [x] Added a command to debug which paths are present in the semantic
index
* [x] Determine why so many paths are often missing from the semantic
index
* we erroring out if an embedding batch contained multiple texts that
were the same, which can happen if a worktree contains multiple copies
of the same text (e.g. a license).

Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Kyle <kylek@zed.dev>
Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
2024-04-30 10:55:38 -07:00
Marshall Bowers
d01428e69c
assistant2: Add create buffer tool (#11219)
This PR adds a new tool to the `assistant2` crate that allows the
assistant to create a new buffer with some content.

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-04-30 13:43:25 -04:00
Piotr Osiewicz
ada2791fa3
editor: Move code actions menu closer to the indicator when it is deployed via click (#11214)
Before:

![image](https://github.com/zed-industries/zed/assets/24362066/98d633a7-c982-4522-b4dc-b944b70b8081)

After: 

![image](https://github.com/zed-industries/zed/assets/24362066/79931e12-0e6c-4ece-b734-5af7d02f7e50)

Release Notes:

- N/A
2024-04-30 18:51:20 +02:00
Marshall Bowers
713c314d67
Clean up doc comments on LanguageModelTool trait (#11217)
This PR cleans up the doc comments on the `LanguageModelTool` trait to
follow Rust documentation conventions.

Release Notes:

- N/A
2024-04-30 12:32:59 -04:00
Marshall Bowers
e3de440715
assistant2: Restructure tools in preparation for adding more (#11213)
This PR does a slight restructuring of how tools are defined in the
`assistant2` crate to make it more amenable to adding more tools in the
near future.

Release Notes:

- N/A
2024-04-30 11:12:44 -04:00
Thorsten Ball
d743c19fe2
Add script to package Linux binary into archive (#11165)
Release Notes:

- N/A
2024-04-30 14:56:48 +02:00
Thorsten Ball
73d0600ad2
project: Set completion to undocumented if text empty (#11207)
I think the previous code was missing a `return` in there because it
always overwrote the `completion.documentation` field, even if the
`text.is_empty()` is true.

Release Notes:

- N/A
2024-04-30 14:56:22 +02:00
Stanislav Alekseev
f96cab286c
Add avatar support for codeberg in git blame (#10991)
Release Notes:

- Added support for avatars in git blame for repositories hosted on
codeberg

<img width="1144" alt="Screenshot 2024-04-25 at 16 45 22"
src="https://github.com/zed-industries/zed/assets/43210583/d44770d8-44ea-4c6b-a1c0-ac2d1d49408f">

Questions:
- Should we move git stuff like `Commit`, `Author`, etc outside of
hosting-specific files (I don't think so, as other hostings can have
different stuff)
- Should we also add support for self hosted forgejo instances or should
it be a different PR?
2024-04-30 12:57:10 +02:00
Conrad Irwin
62c12cd549
Reduce frequency of workspace save (#11183)
Co-Authored-By: Mikayla <mikayla@zed.dev>

Release Notes:


- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-04-29 20:27:01 -06:00
Hans
4fad96b179
Add yss operation support for vim surrounds: (#11084)
The Motion::CurrentLine operation will contain the newline of the
current line, so we need to deal with this edge case



Release Notes:

- N/A
2024-04-29 19:38:14 -06:00
Conrad Irwin
ad44237467
Fix panic in SVG rendering (#11196)
Release Notes:

- Fixed a panic in SVG rendering
2024-04-29 19:03:37 -06:00
Danny Hua
bc736265be
support vim replace command with range (#10709)
Release Notes:

- Added support for line ranges in vim replace commands #9428


- not supporting anything other than bare line numbers right now
- ~need to figure out how to show range in question in search bar~
@ConradIrwin implemented showing a highlight of the selected range for a
short direction instead
- ~tests lol~
2024-04-29 18:49:30 -06:00
Conrad Irwin
0697b417a0
Hang diagnostics (#11190)
Release Notes:

- Added diagnostics for main-thread hangs on macOS. These are only
enabled if you've opted into diagnostics.

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-04-29 17:13:28 -07:00
Marshall Bowers
04cd8dd0f2
assistant2: Add the ability to collapse chat messages (#11194)
This PR adds the ability to collapse/uncollapse chat messages.

I think the spacing might be a little off with the collapsed
calculations, so we'll need to look into that.


https://github.com/zed-industries/zed/assets/1486634/4009c831-b44e-4b30-85ed-0266cb5b8a26

Release Notes:

- N/A
2024-04-29 19:25:58 -04:00
apricotbucket28
6ab9c3c3ab
x11: HiDPI support (#11140)
Fixes https://github.com/zed-industries/zed/issues/11121

Release Notes:

- N/A
2024-04-29 16:07:54 -07:00
apricotbucket28
a765535557
wayland: Implement cursor-shape-v1 (#11106)
Fixes wrong cursor icons and sizes on KDE 6 (and possibly other
compositors)

Gnome still doesn't support this protocol, so to fix cursor settings
there we'll need to read `gsettings`.

Before:

![image](https://github.com/zed-industries/zed/assets/71973804/f0c3dc1b-2bed-43f7-b579-df6c9c0b547f)

After:

![image](https://github.com/zed-industries/zed/assets/71973804/6de639f9-653d-4896-80ca-b7c69641eded)


Release Notes:

- N/A
2024-04-29 16:06:18 -07:00
Marshall Bowers
089ea7852d
assistant2: Use ChatMessage component to render chat messages (#11193)
This PR updates the new assistant panel to use the `ChatMessage`
component to render its chat messages.

This also lays the foundation for collapsing the messages, though that
has yet to be wired up.

Adapted from the work on the `assistant-chat-ui` branch.

Release Notes:

- N/A
2024-04-29 18:47:16 -04:00
Marshall Bowers
ae650342ce
assistant2: Add headers to chat messages (#11191)
This PR adds headers to the chat messages in the new assistant panel.

Adapted from the work on the `assistant-chat-ui` branch.

Release Notes:

- N/A
2024-04-29 18:21:43 -04:00
Max Brunsfeld
1c09b69384
Pin message composer to the bottom of the new assistant panel (#11186)
Release Notes:

- N/A

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Nate <nate@zed.dev>
Co-authored-by: Kyle <kylek@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-04-29 14:26:19 -07:00
Nate Butler
f842d19b0b
Remove extra space right of traffic lights on macOS (#11176)
This PR balances the left and right spacing around the traffic lights on
macOS.

Release Notes:

- Minor UI changes to the titlebar
2024-04-29 16:43:21 -04:00
Marshall Bowers
d633a0da78
gpui: Fix Global trait (#11187)
This PR restores the `Global` trait's status as a marker trait.

This was the original intent from #7095, when it was added, that had
been lost in #9777.

The purpose of the `Global` trait is to statically convey what types can
and can't be accessed as `Global` state, as well as provide a way of
restricting access to said globals.

For example, in the case of the `ThemeRegistry` we have a private
`GlobalThemeRegistry` that is marked as `Global`:
91b3c24ed3/crates/theme/src/registry.rs (L25-L34)

We're then able to permit reading the `ThemeRegistry` from the
`GlobalThemeRegistry` via a custom getter, while still restricting which
callers are able to mutate the global:
91b3c24ed3/crates/theme/src/registry.rs (L46-L61)

Release Notes:

- N/A
2024-04-29 16:37:37 -04:00
Piotr Osiewicz
91b3c24ed3
editor: Clear diagnostics when folding a range that contains it (#11167)
Fixes #4659 

Release Notes:

- Fixed active diagnostic in editor showing up when it's line is in a
folded range.
2024-04-29 20:50:14 +02:00
Bennet Bo Fenner
20625e98ad
preview tabs: Allow replacing preview tab when using code navigation (#10730)
This PR adds support for replacing the current preview tab when using
GoToDefinition. Previously a tab, that was navigated away from, was
converted into a permanent tab and the new tab was opened as preview.

Without `enable_preview_from_code_navigation`:


https://github.com/zed-industries/zed/assets/53836821/99840724-d6ff-4738-a9c4-ee71a0001634

With `enable_preview_from_code_navigation`:


https://github.com/zed-industries/zed/assets/53836821/8c60efcb-d597-40bf-b08b-13faf5a289b6

Note: In the future I would like to improve support for the navigation
history, because right now tabs that are not "normal" project items,
e.g. FindAllReferences cannot be reopened

Release Notes:

- Added support for replacing the current preview tab when using code
navigation (`enable_preview_from_code_navigation`)
2024-04-29 20:47:01 +02:00
Marshall Bowers
9ff847753e
Register ESLint as an available language server (#11178)
This PR adds the ability for the ESLint language server (`eslint`) to be
controlled by the `language_servers` setting.

Now in your settings you can indicate that the ESLint language server
should be used for a given language, even if that language does not have
the ESLint language server registered for it already:

```json
{
  "languages": {
    "My Language": {
      "language_servers": ["eslint", "..."]
    }
  }
}
```

Release Notes:

- N/A
2024-04-29 13:18:30 -04:00
Owen Law
ec95605fec
XI2 Smooth Scrolling for X11 - Attempt 2 (#11110)
This should have fixed the problems that some users were reporting with
https://github.com/zed-industries/zed/pull/10695 .

The problem was with devices which send more than one valuator axis in a
single event whereas the original PR assumed there would only ever be
one axis per event. This version also does away with the complicated
device selection and instead just uses the master pointer device, which
automatically uses all sub-pointers.

Edit: Confirmed working for one of the user's which the first attempt
was broken for.

Release Notes:

- Added smooth scrolling for X11 on Linux
- Added horizontal scrolling for X11 on Linux
2024-04-29 09:40:42 -07:00
Jakob Hellermann
ff8e7f91c1
Fix wayland keyrepeat: use modifier-independant keycode instead of keysym (#11095)
fix bug introduced by #11052



https://github.com/zed-industries/zed/pull/11052#issuecomment-2080475491
the keysym for `a` pressed with or without shift is different, so
keyrepeat was never ended for `Shift-A`.

Release Notes:

- N/A
2024-04-29 09:33:53 -07:00
apricotbucket28
2614215090
wayland: Fix crash on wayfire (#11081)
It is a protocol violation to attach a buffer before acknowledging in
xdg_surface::configure.

Release Notes:

- N/A
2024-04-29 09:33:11 -07:00
Jakob Hellermann
2386ae9f0e
Set appid/wmclass for zed window (#10909)
fixes https://github.com/zed-industries/zed/issues/9132

By setting the app id, window managers like `sway` can apply custom
configuration like `for_window [app_id="zed"] floating enable`.
Tested using `wlprop`/`hyprctl activewindow` for wayland, `xprop` for
x11.


Release Notes:

- Zed now sets the window app id / class, which can be used e.g. in
window managers like `sway`/`i3` to define custom rules
2024-04-29 09:27:25 -07:00
Conrad Irwin
5674ba2a49
Validate buffer_id of anchors in is_valid (#11170)
Release Notes:

- Fixes diagnostic panic better (follow up from #11066)
2024-04-29 10:24:04 -06:00
William Viktorsson
95118c6568
Restore previous workspace on application resume (#10813)
Addresses #10812 

Release Notes:

- Launching an empty already-running Zed application now behaves like a
regular startup and respects the user `resume_on_startup` setting.
([#10812](https://github.com/zed-industries/zed/issues/10812)).

See attached showcase which highlights how the previous project can now
be re-opened through both "quit" and "close window".

This has a noticeable performance benefit on startup/project resume
time.

This should also make the behaviour of closing/opening an application
consistent between macOS/Linux/Windows.


https://github.com/zed-industries/zed/assets/22855292/9c37ba31-ce0a-4c3d-940d-a56e3347e64a
2024-04-29 09:56:23 -06:00
jansol
35c3af7fd0
gpui/mac: Disable shadows on non-opaque windows (#10896)
The culprit behind ghost images in transparent windows and bad
performance with blurred windows turns out to be one and the same:
window shadows. The simplest and most popular fix appears to be to
simply disable shadows on non-opaque windows so let's just do that.

Disabling shadows on a window that is already visible however leaves the
shadow on screen, detached from the window, until a full screen effect
such as exposé or a virtual desktop switch wipes it clean. There does
not seem to be any known solution to this, and it does not affect
windows created after switching to a transparent theme so this is a good
enough compromise for now.



Release Notes:

- Fixed ghostly artifacts in transparent window backgrounds.
- Fixed sluggishness with blurred window backgrounds.
2024-04-29 11:04:11 -04:00
Thorsten Ball
5ef75919f0
git: Do not log error if repository has no commits (#11163)
This is a follow-up to #10685 which started to hide these errors instead
of displaying them to the user.

But the errors are still noisy and not actionable, so we hide them
instead.

Release Notes:

- Removed error message being logged when `git blame` is run in a
repository without commits.

Co-authored-by: Bennet <bennetbo@gmx.de>
2024-04-29 16:00:29 +02:00
Bennet Bo Fenner
9746f4f267
Fix relative line numbers (#11161)
Closes #11105

Release Notes:

- Fixed rendering of relative line numbers in editor
([#11105](https://github.com/zed-industries/zed/issues/11105)).

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-04-29 15:54:40 +02:00
Thorsten Ball
9693e394f7
Remove unused fields (#11158)
Release Notes:


- N/A
2024-04-29 15:34:34 +02:00
Bennet Bo Fenner
45d217f6e0
Set destructive action only when prompt level is set to Destructive (#11154)
Oversight from #11015, where we added `PromptLevel::Destructive`, which
should be used when a prompt performs a "destructive" action (e.g.
deleting a file). However, we accidentally set `setHasDestructiveAction`
to `true` regardless of which prompt level would be specified

Release Notes:

- N/A
2024-04-29 12:12:11 +02:00
William Villeneuve
ca187c8386
Allow users to configure ESLint's rulesCustomizations settings (#11135)
https://github.com/zed-industries/zed/assets/2072378/18f0bb28-0546-4234-a11f-39af6c9fcc12

`rulesCustomizations` is an array of rule severity overrides. Globs can
be used to apply default severities for multiple rules. See
[docs](553e632fb4/README.md (L312-L333))
& [type
definitions](553e632fb4/%24shared/settings.ts (L168))

Example Zed `settings.json` to override all eslint errors to warnings:
```jsonc
{
    "lsp": {
        "eslint": {
            "settings": {
                "rulesCustomizations": [
                    // set all eslint errors/warnings to show as warnings
                    { "rule": "*", "severity": "warn" }
                ]
            }
        }
    }
}
```


Release Notes:

- Added support for configuring ESLint's `rulesCustomizations` settings,
ie. `{"lsp": {"eslint": {"settings": {"rulesCustomizations": [{"rule":
"*", "severity": "warn"}]}}}}`
2024-04-29 11:41:48 +03:00
d1y
f72cf2afe3
Highlight reference types directive in TypeScript (#11039)
Before:

<img width="443" alt="image"
src="https://github.com/zed-industries/zed/assets/45585937/a8037edb-ed5b-4b12-92b4-2d409442ad4b">


After:

<img width="429" alt="image"
src="https://github.com/zed-industries/zed/assets/45585937/1fd66523-d667-4041-952f-c1125e7feab9">


Release Notes:

- Add typescript reference types directive highlighted(#11001)
2024-04-29 11:38:53 +03:00
CharlesChen0823
c8a496ec4b
Windows: Fix direct_write crash when clicking an empty line (#11117)
Windows platform direct_write using `LineLayout::default` indicates
`font_size` will be 0. Zed crashed when click empty line.

Release Notes:
- N/A
2024-04-28 21:37:45 -07:00
Michael Angerman
c826ad2f82
gpui: Improve the image example (#11111)
### fix cropping problem

Prior to these changes the images were being cropped so you never
actually saw
the full image but you had to use your mouse to make the window bigger
to see
both the text and the images...

### activate
 
```rust
cx.activate(true);
```
was not in place so the window did not appear when you ran the example

### No longer need to Ctrl-c to quit the example

Now you can hit *Cmd-q* to quit out of the example instead of having to
*Ctrl-c* in your
terminal where you fired off the example

Release Notes:

- N/A
2024-04-28 20:59:21 -07:00
Mikayla Maki
f458f90673
Fix bugs from recent PRs (#11147)
Fix missed delete in project panel
Fix blinking scrollbar from selections-in-scrollbar change

Release Notes:

- N/A (nightly only)
2024-04-28 20:56:17 -07:00
Nathan Sobo
39fb1d567d
Incorporate ElementId as part of the Element::id trait method and expose GlobalId (#11101)
We're planning to associate "selection sources" with global element ids
to allow arbitrary UI text to be selected in GPUI. Previously, global
ids were not exposed outside the framework and we entangled management
of the element id stack with element state access. This was more
acceptable when element state was the only place we used global element
ids, but now that we're planning to use them more places, it makes sense
to deal with element identity as a first-class part of the element
system. We now ensure that the stack of element ids which forms the
current global element id is correctly managed in every phase of element
layout and paint and make the global id available to each element
method. In a subsequent PR, we'll use the global element id as part of
implementing arbitrary selection for UI text.

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
2024-04-28 13:59:21 -06:00
Mikayla Maki
d2569afe66
Switch from delete file by default to trash file by default (#10875)
TODO:

- [x] Don't immediately seg fault
- [x] Implement for directories 
- [x] Add cmd-delete to remove files
- [ ] ~~Add setting for trash vs. delete~~ You can just use keybindings
to change the behavior.

fixes https://github.com/zed-industries/zed/issues/7228
fixes https://github.com/zed-industries/zed/issues/5094

Release Notes:

- Added a new `project_panel::Trash` action and changed the default
behavior for `backspace` and `delete` in the project panel to send a
file to the systems trash, instead of permanently deleting it
([#7228](https://github.com/zed-industries/zed/issues/7228),
[#5094](https://github.com/zed-industries/zed/issues/5094)). The
original behavior can be restored by adding the following section to
your keybindings:

```json5
[
// ...Other keybindings...
  {
    "context": "ProjectPanel",
    "bindings": {
        "backspace": "project_panel::Delete",
        "delete": "project_panel::Delete",
    }
  }
]
2024-04-26 17:43:50 -07:00
blufony
5dbd23f6b0
vim: add keybinding to jump to parent directory in project panel (#11078)
Release Notes:

- vim: Support `-` to go to `parent directory` of the project panel.

As mentioned in the comments of #11073 this adds support for netrw's `-`
to go to the parent directory in the project panel. Again tested on
linux only.


- N/A
2024-04-26 18:22:15 -06:00
Max Brunsfeld
b7d9aeb29d
Semantic index progress (#11071)
Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Kyle <kylek@zed.dev>
Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-04-26 17:06:05 -07:00