Commit Graph

16091 Commits

Author SHA1 Message Date
sgj123456
8a659af82c
gpui_macros: Enable extra-traits feature for syn (#14067)
Must enable extra-traits of syn feature to enable Debug trait of
Visibility

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-07-10 12:32:46 -04:00
Kyle Kelley
896b9bda23
Stick REPL icon in quick action bar (#14064)
REPL Quick Actions

<img width="325" alt="image"
src="https://github.com/zed-industries/zed/assets/836375/faaf4c8f-ef12-4417-a9dd-158d5beae8ba">

When the Jupyter REPL is enabled and a kernel is available, show the
status in the editor bar:

![quick action bar
repl](https://github.com/zed-industries/zed/assets/836375/f3445283-f1fc-4714-895b-7aa842d4ab76)


Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
2024-07-10 09:20:52 -07:00
Piotr Osiewicz
33a67ad6b9
chore: Clippy fixes for 1.80 (#13987)
The biggest hurdle turned out to be use of `Arc<Language>` in maps, as
`clippy::mutable_key_type` started triggering on it (due to - I suppose
- internal mutability on `HighlightMap`?). I switched over to using
`LanguageId` as the key type in some of the callsites, as that's what
`Language` uses anyways for it's hash/eq, though I've still had to
suppress the lint outside of language crate.

/cc @maxdeviant , le clippy guru.

Release Notes:

- N/A
2024-07-10 17:53:17 +02:00
Jason Lee
d4ddc4c62c
gpui: Fix cx.bounds, cx.open_window position on macOS (#14044)
Release Notes:

- gpui: Fixed `cx.bounds` method to get correct `y` position on macOS.
- gpui: Fixed `cx.open_window` position when macOS Dock is existed.
- Fixed call notification and reopen window position.

## Before


![image](https://github.com/zed-industries/zed/assets/5518/4a435ffd-d7ef-4de7-a7de-44d21db4a719)


https://github.com/zed-industries/zed/assets/5518/ab925779-4253-4b27-9084-01023888087f


## After

<img width="533" alt="image"
src="https://github.com/zed-industries/zed/assets/5518/142e9aaa-ae82-4a72-9acf-04097c545bf0">


https://github.com/zed-industries/zed/assets/5518/8793824a-8b74-4913-8204-7b39649aeeed


---

The case is I have made a Popover by use child window, the coordinate of
the window is always can't placement a right position.

So, I make this example to test the `cx.bounds` and set bounds to
window.

---

By this test, is the `cx.bounds` have a bug?

For example the **Top Left** window, we give it origin (150,150), but it
`cx.bounds()` returns (150,262)

> On the window label, middle line is the `bounds` that we set to the
window, last line is `cx.bounds()` result.

Display 1:

<img width="1512" alt="CleanShot 2024-07-10 at 14 52 26@2x"
src="https://github.com/zed-industries/zed/assets/5518/3adf9e79-f237-431a-a72b-02face7b2361">


---

Or is there something I missed. Is it correct to use `cx.bounds` method
to get the bounds of the current window?

At the same time, I also found that when there are multiple screens, the
information obtained by cx.bounds is very different on different
screens, and it seems that the origin is not relative to the screen.

Display 2:

<img width="2560" alt="SCR-20240710-nkmq"
src="https://github.com/zed-industries/zed/assets/5518/d87d4151-0562-4bf8-b3b3-5da3b4d09d82">
2024-07-10 09:52:33 -06:00
Antonio Scandurra
8944af7406
Lay the groundwork for collaborating on assistant panel (#13991)
This pull request introduces collaboration for the assistant panel by
turning `Context` into a CRDT. `ContextStore` is responsible for sending
and applying operations, as well as synchronizing missed changes while
the connection was lost.

Contexts are shared on a per-project basis, and only the host can share
them for now. Shared contexts can be accessed via the `History` tab in
the assistant panel.

<img width="1819" alt="image"
src="https://github.com/zed-industries/zed/assets/482957/c7ae46d2-cde3-4b03-b74a-6e9b1555c154">


Please note that this doesn't implement following yet, which is
scheduled for a subsequent pull request.

Release Notes:

- N/A
2024-07-10 17:36:22 +02:00
张小白
1662993811
windows: Revert "windows: Fix font clipping issue" (#14045)
The implemetation of that PR is totally wrong, sorry for that!

Release Notes:

- N/A
2024-07-10 08:19:29 -07:00
Joseph T Lyons
f147722fe0 v0.145.x dev 2024-07-10 10:12:35 -04:00
Daniel Schmidt
e1a6efa609
go: Quote targeting expression on runnables (#14055)
Release Notes:

- Go: fix test runnables in fish shell.
2024-07-10 16:02:29 +02:00
Piotr Osiewicz
6f99399224
extensions: Add support for snippets provided by extensions (#14020)
For now extensions can only register global snippets, but there'll be
follow-up work to support scope attribute in snippets.json.

Release Notes:

- Extensions can now provide snippets by including `snippets.json` file
next to the extension manifest.

---------

Co-authored-by: Marshall <marshall@zed.dev>
Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-07-10 09:40:50 +02:00
CharlesChen0823
2f2047ab22
outline_panel: Fix outline panel should autoscroll when selection has changed (#14038)
Fixed selection changed, outline panel not autoscroll.

Release Notes:

- N/A
2024-07-10 10:12:09 +03:00
Marshall Bowers
d01d76482d
gpui: Expose more granular style macros (#14035)
This PR extract more GPUI style methods into macros that can be composed
together to selectively add styles to components.

Release Notes:

- N/A
2024-07-09 19:49:25 -04:00
Marshall Bowers
a46a562dc2
ui: Add margin style methods to Label and LabelLike (#14032)
This PR adds margin style methods to the `Label` and `LabelLike`
components.

This allows for callers to provide a margin to these components without
needing to introduce a wrapping `div` to do so.

Release Notes:

- N/A
2024-07-09 17:41:54 -04:00
Kyle Kelley
4bb8a0845f
Measure maximum width of each cell to render table (#14026) 2024-07-09 14:19:10 -07:00
Marshall Bowers
c4bca874b6
assistant: Replace margin with gap (#14027)
This PR replaces a usage of margin with a gap. This allows us to remove
an extra wrapping `div`.

Release Notes:

- N/A
2024-07-09 17:08:29 -04:00
Marshall Bowers
2db06c1567
assistant: Remove unneeded wrapping div in ModelSelector (#14024)
This PR removes an unneeded wrapping `div` in the `ModelSelector`.

Release Notes:

- N/A
2024-07-09 16:40:00 -04:00
Conrad Irwin
c65673feae
Fix linux prompts (#14021)
Release Notes:

- N/A
2024-07-09 13:00:33 -07:00
Peter Tripp
110ce8a267
Python: Fix auto close for single quotes (#14014)
Fixes #13972
2024-07-09 15:27:57 -04:00
Marshall Bowers
c6b9f1920f
Remove additional wrapping elements in the chat panel (#14013)
This PR removes some wrapping elements that were used inside of the chat
panel.

To facilitate this, the `Label` component now has a `weight` method to
change the font weight.

Release Notes:

- N/A
2024-07-09 15:27:37 -04:00
张小白
df935df5a3
windows: Obtain mouse double-click information from the system instead of hardcoding (#13391)
Release Notes:

- N/A
2024-07-09 12:17:55 -07:00
Matin Aniss
68b5ea4e60
windows: Fix and simplify title bar padding (#13420)
This PR fixes the off by one pixel of the top client rect when not
maximized due to the added border. It also simplifies and properly fixes
the title bar padding problem when maximized, it is now properly taken
care of in GPUI rather then adding the padding in the UI.

Release Notes:

- N/A
2024-07-09 12:15:15 -07:00
Mikayla Maki
ba28827de5
Add support for numpad keys on linux (#14018)
Fixes https://github.com/zed-industries/zed/issues/12117

Partial application of the changes in
https://github.com/zed-industries/zed/pull/13396

Release Notes:

- N/A
2024-07-09 12:07:48 -07:00
张小白
c22dbbebe2
windows: Fix tailwindcss-language-server (#13891)
We should run this server with `powershell`, or we will get some runtime
errors.

![Screenshot 2024-07-06
180154](https://github.com/zed-industries/zed/assets/14981363/e272e146-d4a8-4447-aa65-b657a49622de)


Release Notes:

- Fixed `tailwindcss-language-server` on Windows.
2024-07-09 12:07:20 -07:00
张小白
8f29ff8a63
windows: Fix font clipping issue (#13854)
Closes #12737 . Left before this PR, right after.

![Screenshot 2024-07-05
180308](https://github.com/zed-industries/zed/assets/14981363/437baec3-2672-4b19-8595-17a6c564506e)


Release Notes:

- Fixed font rendering clipping issue on Windows.(#12737 )
2024-07-09 12:06:14 -07:00
Jason Lee
ae414e21f0
gpui: Fix hide titlebar on Windows, with titlebar: None option (#13975)
Release Notes:

- N/A

Ref the macOS Window:

When the `titlebar` is none, the titlebar should be hidden.


adaa483176/crates/gpui/src/platform/mac/window.rs (L516-L528)

```
cargo run -p gpui --example window_positioning
```

## Before


![img_v3_02ck_939c23d0-acc6-40c1-aaf7-c6dd73ddf7ag](https://github.com/zed-industries/zed/assets/5518/f2c7aa02-a102-4f24-8243-74219957d16b)

## After

<img width="466" alt="image"
src="https://github.com/zed-industries/zed/assets/5518/176ce4ea-14e9-44c8-8f2d-01e20ff3e543">
2024-07-09 12:04:55 -07:00
francesco-gaglione
2dd486733b
Reveal in files instead of Finder (#13432)
fixes: #12776 

Release Notes:

- Renamed `editor::RevealInFinder` to `editor::RevealInFileManager`

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2024-07-09 11:54:14 -07:00
Andy Weiss
c093bc8aa8
Fix search/replace start of line anchor (#13920)
This is related to #9428 

I noticed that doing a search and replace for the beginning of a line
`^` results in the trailing line being included in the search. This
seems to be because of the way the range is generated for generating
matches being the up to the start of the trailing line rather than up to
the end of the last line.

I added a test and took a stab at fixing it but it is a bit yolo as this
is the first time I've seen this codebase.
2024-07-09 12:39:24 -06:00
Piotr Osiewicz
09e7b481b8
lsp: Add support for ShowMessage notification (#14012)
When "one newer language" sends these messages, "one newer editor" will
display a pop-up for users to see. :)

Related to https://github.com/gleam-lang/gleam/issues/3274


![image](https://github.com/zed-industries/zed/assets/24362066/00d2c168-59f0-4033-91c8-af29c47516b3)

Release Notes:

- A certain popular language recently had to work around a missing LSP
notification. This has been fixed
2024-07-09 20:12:05 +02:00
Conrad Irwin
8cfa690271
Fix transparency (#14010)
Release Notes:

- (preview only) Fix transparent themes
2024-07-09 12:11:18 -06:00
Marshall Bowers
3cdd465226
gpui: Make style macros more composable (#14007)
This PR begins the process of breaking up the `style_helpers!` macro
into smaller macros that can be used to generate methods for a related
subset of styles.

The style method macros also now accept an optional `visibility`
parameter to control the visibility of the generated methods. This
allows for adding these methods to a struct instead of a just a trait.

For example, to expose just the padding styles on a `Facepile` we can do
this:

```rs
impl Facepile {
    fn style(&mut self) -> &mut StyleRefinement {
        self.base.style()
    }

    gpui::padding_style_methods!({
        visibility: pub
    });
}
```

Release Notes:

- N/A
2024-07-09 13:52:52 -04:00
张小白
8203b6875b
windows: Remove more todos (#13818)
Release Notes:

- N/A
2024-07-09 10:44:42 -07:00
Antonio Scandurra
ce7074c883
Fix panic when opening the same context twice (#14004)
Release Notes:

- Fixed a crash that occurred when opening the same context twice in the
assistant panel (preview-only).
2024-07-09 19:10:20 +02:00
Peter Tripp
6cc8412a05
Prevent dumping of temporary files in config_dir (#14002)
Move telemetry temp files from `config_dir` to `log_dir`. Fixes #7155 

- On MacOS: from `~/.config/zed` to `~/Library/Logs/Zed`
- On Linux: from `~/.config/zed` to `.local/share/zed/logs` (or
`$FLATPAK_XDG_DATA_HOME/zed/logs`).

Release Notes:

- Fixed telemetry putting temporary files in config_dir
([#7155](https://github.com/zed-industries/zed/issues/7155)).
2024-07-09 12:59:17 -04:00
Stanislav Alekseev
2a97aad273
Fix scrolling sticking to top (#13874)
The problem seemingly was that scrolling only started after autoscroll
has finished. I have added a function to forcefully stop it, which I
call when scroll event happens
Release Notes:

- Fixed delay when changing scrolling direction (#13720)

---------

Co-authored-by: Piotr <piotr@zed.dev>
2024-07-09 18:44:46 +02:00
Marshall Bowers
275dd3fa81
Remove extraneous Cargo.lock files (#14001)
This PR removes some extraneous `Cargo.lock` files for the `storybook`
and `sqlez` crates.

These lockfiles were not used, as everything uses the workspace's
`Cargo.lock`.

Release Notes:

- N/A
2024-07-09 12:15:34 -04:00
Marshall Bowers
3cb2a1404c
gpui_macros: Refactor style helpers (#13999)
This PR refactors the style definitions in the `gpui_macros` style
helpers to use structs instead of tuples for additional clarity.

Release Notes:

- N/A
2024-07-09 11:35:54 -04:00
Nate Butler
b691d1baf2
Improve experience when themes provide transparent status colors (#13996)
We shouldn't assume all themes will give us solid status color
backgrounds.

This change makes it so the status color renders on top of a normal
elevated surface background.

#### Before | After (Transparent status background color – Fixed)

![CleanShot 2024-07-09 at 10 50
17@2x](https://github.com/zed-industries/zed/assets/1714999/5f4b24c1-335a-4ed8-a1d0-f511e217e4a5)

![CleanShot 2024-07-09 at 10 50
31@2x](https://github.com/zed-industries/zed/assets/1714999/38c06533-bda5-4cfb-822a-ed5a9639fc33)

---

#### Before | After (Solid status background color – No change)

![CleanShot 2024-07-09 at 10 49
43@2x](https://github.com/zed-industries/zed/assets/1714999/bd60c807-a7bb-4f60-ab47-ddba17288e93)

![CleanShot 2024-07-09 at 10 49
58@2x](https://github.com/zed-industries/zed/assets/1714999/6ab27d60-5a77-448c-a23b-569b337f11e1)



Release Notes:

- Improved support for transparent status colors in themes.
2024-07-09 11:27:47 -04:00
Conrad Irwin
bc0359a474
gpui: Input example log keystrokes (#13963)
Release Notes:

- N/A
2024-07-09 08:33:29 -06:00
apricotbucket28
23c84f8dc0
linux: Treat fullscreen as tiled on X11 and prevent resizing while maximized (#13990)
Two quick fixes for issues I noticed:

1. Fullscreening an unmaximized X11 window still showed rounded window
corners and allowed resizing
2. Maximized windows still allowed for resizing on corners due to
missing checks

![image](https://github.com/zed-industries/zed/assets/71973804/47df4de2-4013-4e51-88c3-d33b52a909f5)


Release Notes:

- N/A
2024-07-09 16:30:30 +02:00
Kirill Bulatov
9b688655a8
Add a way to filter items in the outline panel (#13984)
https://github.com/zed-industries/zed/assets/2690773/145a7cf2-332c-46c9-ab2f-42a77504f54f

Adds a way to filter entries in the outline panel, by showing all
entries (even if their parents were collapsed) that fuzzy match a given
query.

Release Notes:

- Added a way to filter items in the outline panel
2024-07-09 16:44:24 +03:00
Piotr Osiewicz
9a6f30fd95
Snippets: Move snippets into the core of editor (#13937)
Release Notes:

- Move snippet support into core editor experience, marking the official
extension as deprecated. Snippets now show up in any buffer (including
plain text buffers).
2024-07-09 14:02:36 +02:00
Thorsten Ball
b3dad0bfcb
Revert "x11: Differentiate between mouse and keyboard focus #13943" (#13974)
This reverts #13943 and reopens #13897 since the fix in #13943 comes
with a regression:

Sometimes Zed loses keyboard focus and can't be restored. I haven't
figured out yet exactly when and how this happens and can't reliably
reproduce it yet, but there's something off with focus handling.

One reliable way to reproduce _one_ of the problems:

1. Open two zed windows
2. Focus one Zed window
3. Hover with the mouse over the other
4. Try to type in the window that should still be focused

So, to be careful, I'm going to revert the PR first, since I couldn't
find an obvious fix yet. If we do find a fix, we can unrevert.


Release Notes:

- N/A
2024-07-09 11:12:42 +02:00
Aleksei Gusev
18d6be250f
Add keyboard shortcuts for the prompts on Linux (#13915)
This change adds ability to choose any action from prompts, not just the
default one and cancel as Zed has right now. For example, when a user
tries to close a file with edits in it the prompt offers "Don't save"
option that can be selected only with mouse. Now you can use arrows,
tab/shift-tab to pick action and enter/space to confirm it.

Fixes [#13906](https://github.com/zed-industries/zed/issues/13906)


Release Notes:

- Added keyboard navigation in the prompts on Linux
([#13906](https://github.com/zed-industries/zed/issues/13906)).


Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
2024-07-09 10:50:13 +02:00
Matt Fellenz
034d905435
Allow vim counts with undo and redo (#13950)
These were previously passed directly to the editor module, which knows
nothing about vim counts. Instead, implement new actions in the vim
module which take the count and use it to invoke the corresponding
action in the editor module, properly repeated.

Release Notes:

- Fixed vim undo and redo commands not taking counts.
2024-07-08 23:16:52 -06:00
Stanislav Alekseev
ed50dea042
Only clear selections when right click was performed outside of selection (#13701)
Release Notes:

- Fixed selections being cleared when right-click was performed outside
of a selection
([#4267](https://github.com/zed-industries/zed/pull/13701)).

<img width="1136" alt="Screenshot 2024-07-01 at 16 53 58"
src="https://github.com/zed-industries/zed/assets/43210583/082bfb0a-c679-4e87-a4e8-7dd751d8f4a2">
2024-07-08 22:07:09 -06:00
Conrad Irwin
05e2e4d929
Send IME-supported key downs (#13964)
Release Notes:

- N/A
2024-07-08 21:37:19 -06:00
Sebastijan Kelnerič
30479bf062
Improve window decorations: check for compositor support (#13822)
Adds the `compositor_support` to the `X11WindowState` struct so that
correct window decorations are selected

Release notes:

- N/A

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2024-07-08 20:34:37 -06:00
Conrad Irwin
2e7db8f855
Add mouse handling to gpui input example (#13960)
Release Notes:

- N/A
2024-07-08 20:04:28 -06:00
Conrad Irwin
b0ecda6370
x11 calloop 2 (#13955)
Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
2024-07-08 18:38:36 -06:00
Marshall Bowers
efc2336be5
title_bar: Factor out collab-related code into collab module (#13957)
This PR refactors the `TitleBar` component to move all of the
collab-related code into the `collab` module.

This simplifies the top-level `Render` implementation of `TitleBar` by a
lot and makes it easier to read.

Release Notes:

- N/A
2024-07-08 19:43:20 -04:00
Marshall Bowers
9e36a66fec
ui: Add NumericStepper component (#13954)
This PR adds a `NumericStepper` component that can be used to display a
numeric value along with controls to increment, decrement, and reset the
value.

The `ApplicationMenu` has been updated to use the `NumericStepper` for
adjusting the buffer and UI font size.

Here it is in action:


https://github.com/zed-industries/zed/assets/1486634/03cffe67-1256-4283-aa3d-560fffa06dad

Note: Due to the way we do font adjustments, once modified the reset
button will be displayed until it is clicked (or the font size
adjustment is otherwise reset). Simply returning to the original value
will currently not hide the reset button.

Release Notes:

- N/A
2024-07-08 18:45:49 -04:00