Commit graph

23316 commits

Author SHA1 Message Date
Max Brunsfeld
1adb9f4c45 WIP 2024-11-12 22:54:16 -08:00
Max Brunsfeld
55cd99cdc4
Revert "macOS: Improve deadkeys (#20515)" (#20570)
This reverts commit https://github.com/zed-industries/zed/pull/20515

I'm reverting for now to fix issues with key bindings on Nightly:
* `ctrl-c` and `ctrl-m` are being treated as `ctrl-enter`
* `ctrl-[` isn't working in vim mode
* there's a delay before `cmd-shift-[` switches tabs w/ vim mode enabled

Release Notes:

- N/A
2024-11-12 22:32:14 -08:00
Kyle Kelley
0547748c48
Compare explicitly to YES/NO instead relying on booliness for objc (#20567)
Just x86_64-apple-darwin things. Fixes the build for nightly.

Release Notes:

- N/A
2024-11-12 18:35:58 -08:00
Kyle Kelley
54735199a4
Be more explicit about BOOL (#20564)
On x86 Macs BOOL is not the same within the `objc` crate we're using.
This only comes up on nightly builds (not on CI), so I don't think I
have a way to trigger this issue locally.

Release Notes:

- N/A
2024-11-12 18:01:32 -08:00
Kyle Kelley
466d3316a0
Fix issue with image output from Jupyter kernels that didn't use base64 padding (#20561)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
This upgrades `nbformat` and `runtimelib` to handle jupyter types with
even more validation and flexiblity. This also processes any multiline
string data coming from the kernel, including with image data (like
`image/png`). While I was at it I also fixed a longstanding issue around
images by eliminating all whitespace (something `atob` does) and using
the no pad decoder.

Fixes: #17956

Before:

<img width="741" alt="image"
src="https://github.com/user-attachments/assets/37ec2cae-ce78-4475-aaa3-4d785e4015d0">

After:

<img width="727" alt="image"
src="https://github.com/user-attachments/assets/e2431ba2-048b-4205-9898-54f357795a9c">


Release Notes:

- Fixed issue with image output from REPL kernels that didn't use base64
padding
2024-11-12 16:25:49 -08:00
Marshall Bowers
3ebb64ea1d
Expose context server settings to extensions (#20555)
This PR exposes context server settings to extensions.

Extensions can use `ContextServerSettings::for_project` to get the
context server settings for the current project.

The `experimental.context_servers` setting has been removed and replaced
with the `context_servers` setting (which is now an object instead of an
array).

Release Notes:

- N/A

---------

Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2024-11-12 17:21:58 -05:00
Nils Koch
0a9c78a58d
Show error and warning indicators in project panel items (#18182)
Closes #5016

Release Notes:

- Add setting to display error and warning indicators in project panel
items.


https://github.com/user-attachments/assets/8f8031e6-ca47-42bf-a7eb-718eb1067f36

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Co-authored-by: Danilo Leal <67129314+danilo-leal@users.noreply.github.com>
2024-11-12 18:58:59 -03:00
Danilo Leal
a7eb3a9b9f
Add "Book Onboarding" action across the app (#20503)
This PR adds a small UI touch-up to the welcome page so we can introduce
the "Book Onboarding" over there, as well as adding it to the user menu
(both in the signed in and signed out states). The actual URL these
buttons take to will still be updated to the correct destination.

<img width="700" alt="Screenshot 2024-11-12 at 12 45 27"
src="https://github.com/user-attachments/assets/9933bf94-f57a-43e2-8da3-bfbfd9fd24d0">

Release Notes:

- N/A
2024-11-12 18:41:20 -03:00
Conrad Irwin
47ca3401ce
Disable ligatures in SSH connection dialogue (#20549)
Closes #20381

Release Notes:

- Fixed password dialog for remote server showing ligatures
2024-11-12 11:33:22 -07:00
Piotr Osiewicz
d1e2c6e657
python: Add pylsp as the secondary language server (#20358)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Closes #ISSUE

Release Notes:

- Added python-lsp-server as a secondary built-in language server.
2024-11-12 17:23:40 +01:00
Arthur Brussee
181c3724aa
windows: Fix rust-analyzer download (#20408)
After https://github.com/rust-lang/rust-analyzer/pull/18412, there is no
longer a .gz file for windows rust-analyzer targets, and the rust
analyzer LSP fails to download. This fixes it by using the .zip version
on windows.

The .zip also extracts to a _folder_ containing rust-analyzer.exe rather
than just a file. I've handled it in this code, but am not 100% sure if
other parts of the code need too be aware of it.

Release Notes:

- N/A
2024-11-12 12:52:52 +01:00
Michael Sloan
aad3ed7f91
Fix window drawing when switching X11 workspaces by presenting when expose events occur (#20535)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Closes #18184

Release Notes:

- Fix window drawing when switching X11 workspaces, particularly for tiling window managers such as i3wm and XMonad.
2024-11-12 01:20:25 -07:00
Conrad Irwin
ad3171d16d
Expose active key equivalents in the keymap context view (#20530)
Release Notes:

- Added macOS key equivalents to cmd-shift-p `debug: Open Key Context
View`
2024-11-11 23:04:15 -07:00
Conrad Irwin
e4bf586cff
SSH Remoting: Improve unsupported error messages (#20529)
Updates #19697

Release Notes:

- SSH Remoting: Improved error message on unsupported OS/Arch.
2024-11-11 22:26:05 -07:00
Michael Sloan
ab20681818
Use char level diff for Rewrap action for cursor preservation + not reinserting all text (#20368)
Closes #18896

Release Notes:

- Fixed #18896 - `editor::Rewrap` now preserves cursors and only inserts
whitespace by using character-level diff instead of line-level diff.
2024-11-11 22:24:04 -07:00
ifsheldon
6819108bcb
Bump rustls and async-tungstenite to remove child dep ring 0.16.20 (#20489)
Closes #18891 

Tests:
- I have cargo checked and built `remote-server` on my riscv64 dev
board.
- I have cargo checked and tested on my M1 Mac
- Almost all test passed. Some (LLM tests, Postgres tests)failed due to,
IMO, irrelevant reasons

Release Notes:

- Improved support of Zed remote server compilation for riscv64

cc @ConradIrwin 

PS: I didn't include the changes of `Cargo.lock`, which may look messy.
Probably I should include these? Or, should a reviewer do this? The
expected Cargo.lock should have only one version of `ring` with version
> 0.17.0
2024-11-11 21:29:55 -07:00
Michael Sloan
2521ef7bc4
Document why join_lines has a special case for single-line selections (#20528)
Release Notes:

- N/A
2024-11-11 21:28:26 -07:00
Michael Sloan
b08ac2ae3e
Heaptrack documentation (#20266)
Release Notes:

- N/A
2024-11-11 21:03:46 -07:00
Conrad Irwin
2ea4ede08e
macOS: Improve deadkeys (#20515)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Closes #19738

This change refactors how we handle input on macOS to avoid simulating
our own IME. This fixes a number of small edge-cases, and also lets us
remove a bunch of code that had been added to work around bugs in the
previous version.

Release Notes:

- On macOS: Keyboard shortcuts are now handled before activating the IME
system, this enables using vim's default mode on keyboards that use IME
menus (like Japanese).
- On macOS: Improvements to handling of dead-keys. For example when
typing `""` on a Brazillian keyboard, you now get a committed " and a
new marked ", as happens in other apps. Also, you can now type cmd-^ on
an AZERTY keyboard for indent; and ^ on a QWERTZ keyboard now goes to
the beginning of line in vim normal mode, or `d i "` no requires no
space to delete within quotes on Brazilian keyboards (though `d f "
space` is still required as `f` relies on the input handler, not a
binding).
- On macOS: In the terminal pane, holding down a key will now repeat
that key (as happens in iTerm2) instead of opening the character
selector.
2024-11-11 16:34:36 -07:00
Kirill Bulatov
38f2a919f8
Fix default project panel autofold docs (#20517)
Closes https://github.com/zed-industries/zed/issues/20511

Release Notes:

- N/A
2024-11-11 23:47:48 +01:00
Danilo Leal
82427e1ffb
Add new DecoratedIcon component (#20516)
This PR creates a new, revamped `DecoratedIcon` component that enables
using different SVGs, one for the knockout background and another for
the actual icon. That's different than what we were doing before—copying
the SVG and using slightly different positioning—because we wanted to
unlock an aligned knockout effect, which was particularly hard to do
with non-simple shapes such as an X.

Release Notes:

- N/A

---------

Co-authored-by: Nate Butler <1714999+iamnbutler@users.noreply.github.com>
2024-11-11 19:09:02 -03:00
Max Brunsfeld
149e5fde36
Don't try to make project search and outline order match project panel (#20513)
A straight alphabetical order is arguably clearer, and avoids a large
initial delay when searching large repos.

Release Notes:

- Fixed a long initial delay when performing a project search in a large
repository.
2024-11-11 12:20:04 -08:00
Kyle Kelley
97b542b22a
Discover available python environments with Jupyter kernel support (#20467)
![image](https://github.com/user-attachments/assets/7c042bc9-88be-4d7b-b63d-e5b555d54b18)

Closes #18291
Closes #16757
Closes #15563

Release Notes:

- Added support for kernelspecs based on python environments
2024-11-11 10:19:05 -08:00
Nate Butler
6152230152
Fix DynamicSpacing docs (#20509)
In #20504 the CustomSpacing enum variants ended up not having docs. This
PR fixes that, now docs correctly show for variants.


https://github.com/user-attachments/assets/8cc409c9-7b71-4c21-a538-3fd5dded3e00

Release Notes:

- N/A
2024-11-11 12:58:39 -05:00
Caleb Heydon
a47759fd03
Add initial FreeBSD support (#20480)
This PR adds initial support for FreeBSD
(https://github.com/zed-industries/zed/issues/15309). While there is
still work left to be done, it seems to be usable. As discussed by
@syobocat (https://github.com/zed-industries/zed/discussions/10247), the
changes were just adding ```target_os = "freebsd"``` to wherever it
checks if the OS is Linux.


![image](https://github.com/user-attachments/assets/80ea5b29-047f-4cbd-8263-42e5fa6c94b7)

Needs to be build with ```RUSTFLAGS="-C link-dead-code"```

Known Issues:
- There's an issue in ```crates/project/src/environment.rs``` where a
command fails because ```/bin/sh``` on FreeBSD doesn't support the
```-l``` option.

![image](https://github.com/user-attachments/assets/c3c38633-160f-4f47-8840-e3da67f6ebc8)
- The file/folder choosers provided by the ```ashpd``` crate don't work
on FreeBSD (at least with KDE). This isn't that bad since a fallback
dialog is used.

![image](https://github.com/user-attachments/assets/29373006-1eb9-4ed0-bd52-2d0047fab418)
 - Moving to trash won't work.
- Numerous tests fail (when running on FreeBSD). While I haven't looked
into this much, it appears that the corresponding features seem to work
fine.

Release Notes:

- Added initial support for FreeBSD
2024-11-11 18:39:05 +01:00
Michael Sloan
b5da1198f5
Refactor rewrap test to use a test utility (#20424)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Release Notes:

- N/A

Co-authored-by: Max <max@zed.dev>
2024-11-11 10:15:58 -07:00
Thorsten Ball
ba743a1bd9
Add setting to disable inline completions in language scopes (#20508)
This adds a setting to disable inline completions in language scopes to,
for example, disable them in comments or strings.

This setting can be made per language.

Examples:

```json
{
  "languages": {
    "Go": {
      "inline_completions_disabled_in": ["comment", "string"]
    }
  }
}
```

```json
{
  "inline_completions_disabled_in": ["comment"]
}
```

Closes #9133

Release Notes:

- Added language setting to disable inline comments in certain scopes.
Example: `{"languages": {"Go": {"inline_completions_disabled_in":
["comment", "string"]}}}`

Co-authored-by: Bennet <bennet@zed.dev>
2024-11-11 18:09:05 +01:00
Thorsten Ball
9e7afe870a
tailwind: Allow configuring the rootFontSize (#20500)
This addresses this comment:
https://github.com/zed-industries/zed/pull/13923#issuecomment-2467213210

With the change in here it's now possible to use the following settings:

```json
{
  "lsp": {
    "tailwindcss-language-server": {
      "settings": {
        "rootFontSize": 50
      }
    }
  }
}
```

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

Release Notes:

- Added ability to configure `rootFontSize` for the
`tailwindcss-language-server`. Example settings: `{"lsp":
{"tailwindcss-language-server": {"settings": { "rootFontSize": 50}}}}`

Co-authored-by: Bennet <bennet@zed.dev>
2024-11-11 17:13:00 +01:00
Nate Butler
94d8ead270
Refactor Spacing into DynamicSpacing using proc macro (#20504)
Density tracking issue: #18078 

This PR refactors our spacing system to use a more flexible and
maintainable approach. We've replaced the static `Spacing` enum with a
dynamically generated `DynamicSpacing` enum using a proc macro.

Enum variants now use a `BaseXX` format, where XX = the pixel value @
default rem size and the default UI density.

For example:

`CustomSpacing::Base16` would return 16px at the default UI scale &
density.

I'd love to find another name other than `Base` that is clear (to avoid
base_10, etc confusion), let me know if you have any ideas!

Changes:

- Introduced a new `derive_dynamic_spacing` proc macro to generate the
`DynamicSpacing` enum
- Updated all usages of `Spacing` to use the new `DynamicSpacing`
- Removed the `custom_spacing` function, mapping previous usages to
appropriate `DynamicSpacing` variants
- Improved documentation and type safety for spacing values

New usage example:

```rust
.child(
    div()
        .flex()
        .flex_none()
        .m(DynamicSpacing::Base04.px(cx))
        .size(DynamicSpacing::Base16.rems(cx))
        .children(icon),
)
```

vs old usage example:

```
.child(
    div()
        .flex()
        .flex_none()
        .m(Spacing::Small.px(cx))
        .size(custom_spacing(px(16.)))
        .children(icon),
)
```

Release Notes:

- N/A
2024-11-11 11:08:55 -05:00
Thorsten Ball
93ab6ad922
logs: Reduce log noise by using more debug logs (#20498)
Release Notes:

- N/A
2024-11-11 15:11:20 +01:00
Piotr Osiewicz
45bbfe077a
python: Fix toolchains not getting picked up after workspace deserialization (#20488)
Closes #20476

Release Notes:

- Fixed a bug in toolchain selector that caused it to not pick up venvs
for tabs before user interacted with them.
- Fixed a bug in language selector that caused it to pick up Markdown as
the language for a buffer up until the tab was interacted with.
2024-11-11 14:35:01 +01:00
Thorsten Ball
be8cc1146a
language server logs: Fix missing menu entries when using remoting (#20495)
This fixes the language server log menu only showing a single entry when
using SSH remoting.

Culprit was the `return menu;` statement that should've been a
`continue;`

Rest of the change is just refactoring.

Release Notes:

- Fixed `language server logs` menu only showing a single entry when
using SSH remoting.

Co-authored-by: Bennet <bennet@zed.dev>
2024-11-11 11:26:00 +01:00
Thorsten Ball
a97ab5eb3d
language servers: Fix wrong language server name (#20428)
This fixes the issue of multiple language servers showing up as `node`
in the language server logs dropdown.

It does this by changing `language_server.name()` to return the
adapter's name, not the binary name, and changing types to make sure
that we always use this.

Release Notes:

- Fixed language server names showing up only as `"node"`

---------

Co-authored-by: Sam Rose <hello@samwho.dev>
Co-authored-by: Bennet <bennet@zed.dev>
2024-11-11 10:18:38 +01:00
Kirill Bulatov
f4024cc602
Fix excerpt jumps using selections, not the match data (#20491)
Fixes
https://github.com/zed-industries/zed/pull/20469#issuecomment-2466805325

Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-11-11 10:17:32 +01:00
Maksim Bondarenkov
1460249a70
docs: Update msys2 section (#20478)
Some checks are pending
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
now Zed is available in MINGW64 repository as well

Release Notes:

- N/A
2024-11-10 18:24:28 +01:00
Adam Wolff
da7670cd6f
assistant: Track completions for each CodegenAlternative (#19999)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Release Notes:

- N/A

Co-authored-by: Bennet Bo Fenner <bennet@zed.dev>
2024-11-10 17:22:24 +01:00
Joseph T. Lyons
ebdc255b73
Add additional instructions to issue templates (#20473)
Release Notes:

- N/A
2024-11-10 08:34:23 -05:00
Bennet Bo Fenner
4d49a851ef
image viewer: Ensure images can never be loaded twice (#20472)
Follow up to #20374, this prevents a race condition where we could load
images twice.

Release Notes:

- N/A
2024-11-10 13:17:19 +01:00
Will Bradley
0dbda71423
Enable reload of images in image viewer (#20374)
Closes #11529

Release Notes:

- Fixed an issue where the image preview would not update when the
underlying file changed

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-11-10 11:37:02 +01:00
Piotr Osiewicz
f3320998a8
lsp: Track completion triggers for each language separately (#20471)
This PR improves how we handle completions in buffers with multiple
LSPs.

Context: while working on
https://github.com/zed-industries/zed/issues/19777 with @mgsloan we
noticed that completion triggers coming from language servers are not
tracked properly. Namely, each buffer has `completion_triggers` field
which is read from the configuration of a language server. The problem
is, there can be multiple language servers for a single buffer, in which
case we'd just stick to the one that was registered last.

This PR makes the tracking a bit more fine-grained. We now track not
only what the completion triggers are, but also their origin server id.
Whenever completion triggers are updated, we recreate the completion
triggers set.
Release Notes:

- Fixed completions not triggering when multiple language servers are
used for a single file.
2024-11-10 10:29:10 +01:00
Kirill Bulatov
2b7ee1e872
Debounce runnable refreshes in the editor (#20470) 2024-11-10 11:06:22 +02:00
Kirill Bulatov
767a82527a
Open all kinds of files from multi buffers' headers (#20469)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Closes https://github.com/zed-industries/zed/issues/11661

Release Notes:

- Fixed multi buffer headers not able to jump to untitled files
2024-11-10 09:03:11 +01:00
Antar
ba8f027c18
editor: Fix toggle_comment in readonly mode (#20464)
Closes #20459

Release Notes:

- Fixed comments toggle in readonly mode
2024-11-10 08:47:30 +01:00
Nate Butler
0a28800049
Add preview for Checkbox with Label (#20448)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Add previews for Checkbox with Label.

Merge checkbox components.

Release Notes:

- N/A
2024-11-08 22:53:15 -05:00
Nate Butler
31a6ee0229
Add ui::table (#20447)
This PR adds the `ui::Table` component.

It has a rather simple API, but cells can contain either strings or
elements, allowing for some complex uses.

Example usage:

```rust
Table::new(vec!["Product", "Price", "Stock"])
    .width(px(600.))
    .striped()
    .row(vec!["Laptop", "$999", "In Stock"])
    .row(vec!["Phone", "$599", "Low Stock"])
    .row(vec!["Tablet", "$399", "Out of Stock"])
```

For more complex use cases, the table supports mixed content:

```rust
Table::new(vec!["Status", "Name", "Priority", "Deadline", "Action"])
    .width(px(840.))
    .row(vec![
        element_cell(Indicator::dot().color(Color::Success).into_any_element()),
        string_cell("Project A"),
        string_cell("High"),
        string_cell("2023-12-31"),
        element_cell(Button::new("view_a", "View").style(ButtonStyle::Filled).full_width().into_any_element()),
    ])
    // ... more rows
```

Preview:

![CleanShot 2024-11-08 at 20 53
04@2x](https://github.com/user-attachments/assets/b39122f0-a29b-423b-8e24-86ab4c42bac2)

This component is pretty basic, improvements are welcome!

Release Notes:

- N/A
2024-11-08 21:10:15 -05:00
Kyle Kelley
1f974d074e
Set up editor actions after workspace not on stack (#20445)
Release Notes:

- N/A

Co-authored-by: Conrad Irwin <conrad@zed.dev>
2024-11-08 17:11:43 -08:00
Elias Müller
72125949d9
Add shortcuts for 'open settings' and 'revert selected hunks' to Jetbrains keymap (#20414) 2024-11-08 19:34:52 -05:00
Kirill Bulatov
d605d192af
Use a different keybinding for editor::AcceptPartialInlineCompletion action (Linux) (#20443)
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Follow-up of https://github.com/zed-industries/zed/pull/20419

Release Notes:

- - (breaking change) Use `ctrl-right` instead of `cmd-right` as a macOS
default for `editor::AcceptPartialInlineCompletion` (Linux)
2024-11-09 01:38:18 +02:00
Marshall Bowers
f92e6e9a95
Add support for context server extensions (#20250)
This PR adds support for context servers provided by extensions.

To provide a context server from an extension, you need to list the
context servers in your `extension.toml`:

```toml
[context_servers.my-context-server]
```

And then implement the `context_server_command` method to return the
command that will be used to start the context server:

```rs
use zed_extension_api::{self as zed, Command, ContextServerId, Result};

struct ExampleContextServerExtension;

impl zed::Extension for ExampleContextServerExtension {
    fn new() -> Self {
        ExampleContextServerExtension
    }

    fn context_server_command(&mut self, _context_server_id: &ContextServerId) -> Result<Command> {
        Ok(Command {
            command: "node".to_string(),
            args: vec!["/path/to/example-context-server/index.js".to_string()],
            env: Vec::new(),
        })
    }
}

zed::register_extension!(ExampleContextServerExtension);
```

Release Notes:

- N/A
2024-11-08 16:39:21 -05:00
Conrad Irwin
ff4f67993b
macOS: Add key equivalents for non-Latin layouts (#20401)
Closes  #16343
Closes #10972

Release Notes:

- (breaking change) On macOS when using a keyboard that supports an
extended Latin character set (e.g. French, German, ...) keyboard
shortcuts are automatically updated so that they can be typed without
`option`. This fixes several long-standing problems where some keyboards
could not type some shortcuts.
- This mapping works the same way as
[macOS](https://developer.apple.com/documentation/swiftui/view/keyboardshortcut(_:modifiers:localization:)).
For example on a German keyboard shortcuts like `cmd->` become `cmd-:`,
`cmd-[` and `cmd-]` become `cmd-ö` and `cmd-ä`. This mapping happens at
the time keyboard layout files are read so the keybindings are visible
in the command palette. To opt out of this behavior for your custom
keyboard shortcuts, set `"use_layout_keys": true` in your binding
section. For the mappings used for each layout [see
here](a890df1863/crates/settings/src/key_equivalents.rs (L7)).

---------

Co-authored-by: Will <will@zed.dev>
2024-11-08 13:05:10 -07:00