Commit graph

25456 commits

Author SHA1 Message Date
Joseph T. Lyons
ee280b0d05
Resurrect top-ranking issues script (#25433)
Release Notes:

- N/A
2025-02-23 14:24:56 -05:00
Marshall Bowers
a43793493a
docs: Remove empty Tree-sitter grammar link in the Tailwind docs (#25426)
This PR removes the empty Tree-sitter grammar link in the Tailwind docs.

Tailwind does not use a Tree-sitter grammar.

Release Notes:

- N/A
2025-02-23 10:33:03 -05:00
Marshall Bowers
3b3c379852
docs: Fix casing of "Tree-sitter" (#25427)
This PR fixes the casing of "Tree-sitter" in the docs.

It is "Tree-sitter", not "Tree Sitter" or "Tree-Sitter".

Release Notes:

- N/A
2025-02-23 15:30:10 +00:00
Kirill Bulatov
147f407b7a
Fix theme selector resetting the buffer size (#25425)
Closes https://github.com/zed-industries/zed/issues/25413

As the issue points out well, themes do not need to alter any in-memory
state on load: that is done via settings file load.
Originally, it was introduced in
https://github.com/zed-industries/zed/pull/4064 and
https://github.com/zed-industries/zed/pull/24857 had restored that
behavior, which seems wrong to do.

Apart from removing that part, removes unnecessary methods and
emphasizes that in-memory state is the Buffer/UI size — no need to add
`Adjusted` there as the settings file presence is already enough.

Release Notes:

- Fixed theme selector resetting the buffer size
2025-02-23 15:24:43 +00:00
Marshall Bowers
822f42e8fe
docs: Remove outdated note about pinning @vue/language-server (#25424)
This PR removes the outdated note about pinning `@vue/language-server`
to v1.8.

As of https://github.com/zed-extensions/vue/pull/1 we now use the latest
available version.

Release Notes:

- N/A
2025-02-23 15:21:51 +00:00
Aivaz Latypov
7e097d529a
zeta: Add LICENSE.md and LICENCE.md to license detection (#25422)
Maybe it's not a very common, but it has a place to be.

Release Notes:

- Added `LICENSE.md` and `LICENCE.md` files to license detection for
edit prediction.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-23 15:08:24 +00:00
Coenen Benjamin
65f76e6f4d
Add support for --target-dir for Rust tasks (#24725)
This PR is an attempt to add support for `--target-dir` argument to
`cargo` commands when executing tasks with rust.
When using VSCode I was already using this trick to not block the
current binary compilation when I was trying a specific test. As it's a
different target directory it won't block the `cargo` commands I'm using
in my terminal.

I used the task variables to achieve this but I'm not sure it's the best
option to be honest. I didn't find any examples in your docs to see if
sometimes you had specific configuration for languages and tasks.

Let me know if this solution would be a good fit and if the
implementation is ok.

If so feel free to redirect me to an example I can reproduce to write a
unit test or so... And I will also update the docs.

Example of config:

```
{
  "languages": {
    "Rust": {
      "tasks": {
        "variables": {
          "RUST_TARGET_DIR": ".cargo_check"
        }
      }
    }
  }
}
```

it will run `cargo test -p XXX --target-dir .cargo-check`


Release Notes:

- Added support for `--target-dir` for Rust tasks

---------

Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
2025-02-23 11:05:07 +01:00
Piotr Osiewicz
918cba4cce
lsp: Check for existing snapshots before sending off a didOpen notification (#25409)
Closes #ISSUE

Release Notes:

- Fixed Zed sending out didOpen notification to a language server when
opening documents.
2025-02-23 01:17:46 +01:00
Conrad Irwin
4067ae4b37
Fix stage/unstage buttons on new empty files (#25365)
Closes #ISSUE

Release Notes:

- N/A
2025-02-22 13:49:58 -07:00
Thomas Heartman
084a0233b6
vim: Add exchange (#24678)
Implements [vim-exchange](https://github.com/tommcdo/vim-exchange)
functionality.

Lets you swap the content of one selection/object/motion with another.

The default key bindings are the same as in exchange:
- `cx` to begin the exchange in normal mode. Visual mode does not have a
default binding due to conflicts.
- `cxx` selects the current line
- `cxc` clears the selection
- If the previous operation was an exchange, `.` will repeat that
operation.

Closes #22759

## Overlapping regions

According to the vim exchange readme:

> If one region is fully contained within the other, it will replace the
containing region.

Zed does the following:
- If one range is completely contained within another: the smaller
region replaces the larger region (as in exchange.vim)
- If the ranges only partially overlap, then we abort and cancel the
exchange. I don't think we can do anything sensible with that. Not sure
what the original does, evil-exchange aborts.

## Not implemented: cross-window exchange

Emacs's evil-exchange allows you to exchange across buffers. There is no
code to accommodate that in this PR. Personally, it'd never occurred to
me before working on this and I've never needed it. As such, I'll leave
that implementation for whomever needs it.

As an upside; this allows you to have concurrent exchange states per
buffer, which may come in handy.

## Bonus

Also adds "replace with register" for the full line with `grr` 🐕 This
was an oversight from a previous PR.

Release notes:

- Added an implementation of `vim-exchange`
- Fixed: Added missing default key binding for `Vim::CurrentLine` for
replace with register mode (`grr`)

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-02-22 20:36:21 +00:00
renovate[bot]
04732b23fb
Update Rust crate ctor to v0.3.6 (#25188)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [ctor](https://redirect.github.com/mmastrac/rust-ctor) |
workspace.dependencies | patch | `0.3.1` -> `0.3.6` |

---

### 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 this update
again.

---

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

---

Release Notes:

- N/A

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xNzMuMSIsInVwZGF0ZWRJblZlciI6IjM5LjE3My4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-22 22:04:42 +02:00
Angelk90
abc027558a
Only authenticate if the credentials provider has credentials when running in development (#25403)
Closes #25394

Release Notes:

- N/A

Scenarios:

| Scenarios | What it does |
|------|--------|
| Interactive Terminal + Impersonate Active Login | Login without saved
credentials |
| Interactive Terminal + Saved credentials | Login with saved
credentials |
| Interactive Terminal + No credentials | Does nothing |
| Non-interactive Terminal + Saved credentials | Login with saved
credentials |
| Non-interactive Terminal + No credentials | Does nothing |

@maxdeviant : You can take a look at it.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-22 18:29:27 +00:00
Marshall Bowers
4d106a4b0b
zed_extension_api: Add simple process API (#25399)
This PR adds a simple API for working with processes to the extension
API.

The API is designed to mirror Rust's
[`std::process::Command`](https://doc.rust-lang.org/std/process/struct.Command.html).

Release Notes:

- N/A
2025-02-22 18:05:36 +00:00
Marshall Bowers
ec4d9ec111
zed_extension_api: Use v0.3.0 WIT files for codegen (#25398)
This PR updates the `zed_extension_api` to use the v0.3.0 WIT files for
code generation.

I missed this in https://github.com/zed-industries/zed/pull/25357.

Release Notes:

- N/A
2025-02-22 17:47:57 +00:00
张小白
10053e2566
windows: Fix incorrect button ID setting for TaskDialog (#25391)
Closes #22821

It turns out that on Windows, the `Cancel` button should **always** have
a button ID of `2`. Even if the button label is something like "Don't
Cancel", when the user presses the `Esc` key, Windows will still report
that the button with ID `2` was pressed.

Release Notes:

- N/A
2025-02-22 23:39:43 +08:00
Marshall Bowers
7a55da58d9
Revert "Hide the mouse when the user is typing in the editor (#25040)" (#25393)
This reverts commit a8610fbd13.

I've been seeing some reports of segmentation faults that appear to
point to this change as the culprit.

Closes #25366.

Release Notes:

- Community: Reverted #25040, so remove the corresponding entry from the
release notes.
2025-02-22 10:19:23 -05:00
mattmc3
5043eaedc4
Change C-a C-e keybindings to match macOS default behavior (#25385)
Closes #25372
2025-02-22 13:43:38 +00:00
Péter Leéh
328e4d6278
Remove unnecessary Arc from AhoCorasick since it's using it internally (#25379)
This PR removes the unnecessary `Arc` around the `AhoCorasick` struct,
since [it's already using it
internally](https://docs.rs/aho-corasick/latest/aho_corasick/struct.AhoCorasick.html#cloning).

Release Notes:

- N/A
2025-02-22 09:13:35 +00:00
Kirill Bulatov
83513bab59
Emphasize defaults for line movement actions (#25378)
Closes https://github.com/zed-industries/zed/issues/25372

Release Notes:

- N/A
2025-02-22 08:08:16 +00:00
Marshall Bowers
b9ca240242
editor: Fix compile errors after bad merge (#25374)
This PR fixes the compile errors after
https://github.com/zed-industries/zed/pull/25367 was merged without
passing CI.

Release Notes:

- N/A
2025-02-22 02:31:20 +00:00
Dino
5d751cd407
vim: Handle visual selection when jumping to mark (#25360)
Fix how vim mode handles jumping to mark, when one of vim's visual modes
is active, in order to behave just like neovim. Here's a quick video
showing the updated behavior ↓


https://github.com/user-attachments/assets/db91f574-d7e8-429d-952e-3435c43e31bd

Closes #18131 

Release Notes:

- Fixed vim's visual selections when jumping to marks
2025-02-21 19:24:54 -07:00
Cole Miller
ef53f7af22
Fix issues with adjacent diff hunks (#25367)
Closes #ISSUE

Release Notes:

- Fixed being unable to toggle diff hunks with the mouse in some cases
2025-02-21 19:07:04 -05:00
Cole Miller
4118f42d61
Rename ExpandAllHunkDiffs to ExpandAllDiffHunks (#25369)
This is more consistent with the nomenclature in the rest of Zed.

Release Notes:

- Renamed the `editor::ExpandAllHunkDiffs` action to
`editor::ExpandAllDiffHunks`
2025-02-21 19:06:03 -05:00
Marshall Bowers
ec56755f9e
Eagerly load the active theme and icon theme (#25368)
This PR adds eager loading of the active theme and icon theme set in the
user settings.

Previously for themes and icon themes that were provided by extensions,
we would have to wait until extensions were loaded before we could apply
the themes.

In some cases this could lead to a visible delay during which time the
user would see the default themes, and then switch to their desired
themes once extensions had loaded.

To avoid this, we now take a fast path of loading the active themes
directly from the filesystem so that we can load them as soon as
possible.

Closes #10173 and #25305.

Release Notes:

- Added eager loading of the active theme and icon theme. This should
address some reports of seeing the default themes briefly on startup.
2025-02-21 23:57:55 +00:00
Cole Miller
aba89ba12a
Shorten overflowing paths in file finder (#25303)
Closes #7711

This PR changes the file finder to shorten the path portion of each
match by replacing a segment with `...`, if it would otherwise overflow
horizontally. Details:

- The overflow calculation is based on a crude linear width estimate for
ASCII text at the current em width. No elision is done for non-ASCII
paths.
- A path component will not be elided if it contains a matching position
for the file finder's search, or if it's the first or last component.
- Elision is only applied when it is successful in shortening the path
enough to not overflow.

Release Notes:

- Improved the appearance of the file finder when long paths are shown
by eliding path segments
2025-02-21 17:04:44 -05:00
Beniamin Zagan
7ff40091d8
title_bar: Allow deafening audio without microphone permission (#24761)
The deafen audio button wasn't visible in the titlebar unless you had
the 'use microphone permission'. Meaning if I would join a call, and
didn't receive permission to speak, I wouldn't be able to use the deafen
audio button.

Now the button is directly visible when you join a call. So you can
deafen the audio even if you didn't receive the mic permission.

Release Notes:

- N/A
2025-02-21 22:02:40 +00:00
Arseny Kapoulkine
dabc35b257
Improve C++ highlighting for sized type specifiers (#25362)
For consistency, sized type specifiers should be highlighted the same
way as primitive types, to make sure 'unsigned', 'int' and 'unsigned
int' are all the same color. [A previous
change](https://github.com/zed-industries/zed/pull/18016) moved
primitive types from `@keyword` to `@type`, and this PR adjusts the
sized type specifier to follow suit.

Before this change:


![image](https://github.com/user-attachments/assets/d0982ced-882f-4477-b716-f07ac4a72170)

After this change:


![image](https://github.com/user-attachments/assets/2fb6a7e7-061b-46e1-a4e3-e906e1e87bd8)

Release Notes:

- Improved C++ syntax highlighting for sized type specifiers.
2025-02-21 16:57:57 -05:00
chbk
8f40bcc86c
Improve JavaScript and TypeScript syntax highlighting (#25328)
Release Notes:

  - Improved JavaScript and TypeScript syntax highlighting.

| Zed 0.174.6 | With this PR |
| --- | --- |
|
![Image](https://github.com/user-attachments/assets/a64f0abf-3b4e-4369-80c5-1d1381c925fc)
|
![Image](https://github.com/user-attachments/assets/f8224243-f4ab-4af9-8dd8-5062dd7ea743)
|

- `regex_flags`: `keyword.regex`, see the [Regex
PR](https://github.com/zed-industries/zed/pull/25332) for other Regex
scopes
- `@`: `punctuation.special`, as in Python
- `jsx_text`: `text.jsx`
- `=`: `operator` -> `punctuation.jsx.delimiter`, `punctuation` as in
[VS
Code](0fe195613e/extensions/html/syntaxes/html.tmLanguage.json (L78))
and
[Atom](ee750a014a/grammars/tree-sitter-html.cson (L47))
- added `jsx` scope to target JSX tokens specifically

```javascript
/**
 * @keyword comment
 */
@log
class X {
  render() {
    return (
      <div jsx_attribute="value">
        <Input onKeyPress={super.bind(this)}/>
        jsx_text
      </div>
    );
  }
}
const IDENTIFIER = true
```

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-21 21:54:16 +00:00
chbk
3e75a661dd
Improve Rust syntax highlighting (#25333)
Release Notes:

  - Improved Rust syntax highlighting.

| Zed 0.174.6 | With this PR |
| --- | --- |
|
![Image](https://github.com/user-attachments/assets/0ec56dd0-2c17-4b5f-98e3-0897cb4e0192)
|
![Image](https://github.com/user-attachments/assets/309de467-dd32-47e9-ac40-96334a20d5c3)
|

- `identifier`: `variable`

```rust
let identifier = true;
const IDENTIFIER: i32 = 3;
```

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-21 16:20:53 -05:00
Marshall Bowers
a9e753fc07
extension_host: Remove duplicate linker registration (#25361)
This PR fixes a panic that would occur when loading an extension using
v0.2.0 of the extension API after #25357 landed:

```
Thread "<unnamed>" panicked with "called `Result::unwrap()` on an `Err` value: map entry `zed:extension/github` defined twice" at crates/extension_host/src/wasm_host/wit.rs:38:31
10a6cd00e7/src/crates/extension_host/src/wasm_host/wit.rs (L38) (may not be uploaded, line may be incorrect if files modified)
   0: backtrace::backtrace::libunwind::trace
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.74/src/backtrace/libunwind.rs:116:5
      backtrace::backtrace::trace_unsynchronized
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.74/src/backtrace/mod.rs:66:5
   1: backtrace::backtrace::trace
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.74/src/backtrace/mod.rs:53:14
   2: backtrace::capture::Backtrace::create
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.74/src/capture.rs:292:9
   3: backtrace::capture::Backtrace::new
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/backtrace-0.3.74/src/capture.rs:257:22
   4: zed::reliability::init_panic_hook::{{closure}}
             at /Users/maxdeviant/projects/zed/crates/zed/src/reliability.rs:56:29
   5: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/alloc/src/boxed.rs:2084:9
      std::panicking::rust_panic_with_hook
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:808:13
   6: std::panicking::begin_panic_handler::{{closure}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:674:13
   7: std::sys::backtrace::__rust_end_short_backtrace
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/backtrace.rs:168:18
   8: rust_begin_unwind
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/panicking.rs:665:5
   9: core::panicking::panic_fmt
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/panicking.rs:74:14
  10: core::result::unwrap_failed
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/result.rs:1679:5
  11: core::result::Result<T,E>::unwrap
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/result.rs:1102:23
      extension_host::wasm_host::wit::new_linker
             at /Users/maxdeviant/projects/zed/crates/extension_host/src/wasm_host/wit.rs:38:5
  12: extension_host::wasm_host::wit::since_v0_2_0::linker::{{closure}}
             at /Users/maxdeviant/projects/zed/crates/extension_host/src/wasm_host/wit/since_v0_2_0.rs:43:9
  13: std::sync::once_lock::OnceLock<T>::get_or_init::{{closure}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sync/once_lock.rs:276:50
  14: std::sync::once_lock::OnceLock<T>::initialize::{{closure}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sync/once_lock.rs:483:19
  15: std::sync::once::Once::call_once_force::{{closure}}
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sync/once.rs:217:40
  16: std::sys::sync::once::queue::Once::call
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sys/sync/once/queue.rs:183:21
  17: std::sync::once::Once::call_once_force
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sync/once.rs:217:9
  18: std::sync::once_lock::OnceLock<T>::initialize
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sync/once_lock.rs:482:9
  19: std::sync::once_lock::OnceLock<T>::get_or_try_init
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sync/once_lock.rs:364:9
  20: std::sync::once_lock::OnceLock<T>::get_or_init
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/std/src/sync/once_lock.rs:276:15
  21: extension_host::wasm_host::wit::since_v0_2_0::linker
             at /Users/maxdeviant/projects/zed/crates/extension_host/src/wasm_host/wit/since_v0_2_0.rs:42:5
  22: extension_host::wasm_host::wit::Extension::instantiate_async::{{closure}}
             at /Users/maxdeviant/projects/zed/crates/extension_host/src/wasm_host/wit.rs:122:17
  23: extension_host::wasm_host::WasmHost::load_extension::{{closure}}
             at /Users/maxdeviant/projects/zed/crates/extension_host/src/wasm_host.rs:385:14
  24: <core::pin::Pin<P> as core::future::future::Future>::poll
             at /rustc/eeb90cda1969383f56a2637cbd3037bdf598841c/library/core/src/future/future.rs:123:9
  25: async_task::raw::RawTask<F,T,S,M>::run
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-task-4.7.1/src/raw.rs:557:17
  26: async_task::runnable::Runnable<M>::run
             at /Users/maxdeviant/.cargo/registry/src/index.crates.io-6f17d22bba15001f/async-task-4.7.1/src/runnable.rs:781:18
  27: gpui::platform::mac::dispatcher::trampoline
             at /Users/maxdeviant/projects/zed/crates/gpui/src/platform/mac/dispatcher.rs:106:5
  28: <unknown>
  29: <unknown>
  30: <unknown>
  31: _pthread_mach_thread_np
```

We don't need the added `add_to_linker` calls anymore.

Release Notes:

- N/A
2025-02-21 21:20:19 +00:00
Beniamin Zagan
2d6592dcaa
title_bar: Hide screen share when user doesn't have the permission (#25192)
On macos: 
- user has the required permission to screen share. 
- user doesn't have the can_use_microphone permission


When an user doesn't have the can_use_microphone permission the screen
share icon would be visible. If an user therefor would click on it, we
would give the error that they don't have the permission given to zed to
screen share. (which is false).

I've tested this together with @JosephTLyons because we first thought it
was a mac os permission issue.

Should we mention in the zed.dev/docs/collaboration what kind of
permissions are needed to be able to screen share?

Release Notes:

- Fixed: Screen sharing would be visible even when user didn't have the
right permission resulting in errors later on.
2025-02-21 14:16:15 -07:00
chbk
59a153b2e1
Improve Python syntax highlighting (#25331)
Release Notes:

  - Improved Python syntax highlighting.

| Zed 0.174.6 | With this PR |
| --- | --- |
|
![Image](https://github.com/user-attachments/assets/3d8830c9-23cd-437d-88a6-258bcfba5f50)
|
![Image](https://github.com/user-attachments/assets/fd34ca38-c105-4f27-9979-98ab8d616c51)
|

- `identifier`: `variable`
- `.`, `,`, `:`: `punctuation.delimiter`
- `@`: `operator`, for matrix multiplication

```python
class Mat(list):
  def __matmul__(self, b):
    ...
a, b = Mat(), Mat()
identifier = a @ b
IDENTIFIER = True
```

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-21 20:52:04 +00:00
Rémi Bardon
10a6cd00e7
docs: Add missing comma in YAML configuration (#25351)
Release Notes:

- N/A
2025-02-21 15:18:11 -05:00
Marshall Bowers
f6f6980463
zed_extension_api: Fork new version of extension API (#25357)
This PR forks a new version of the `zed_extension_api` in preparation
for new changes.

Release Notes:

- N/A
2025-02-21 20:00:46 +00:00
Danilo Leal
2e302b1a7c
context menu: Improve docs aside responsiveness (#25347)
Closes https://github.com/zed-industries/zed/issues/24883

While this PR closes the issue above, it still doesn't implement a
bullet-proof solution for the context menu docs aside, meaning, it might
not work the best way if there are other places using it (like the
Editor Controls menu). For that, I think we'll want a more robust
collision-aware solution, possibly similar to the LSP completion menu.

Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <hi@aguz.me>
Co-authored-by: Nate Butler <1714999+iamnbutler@users.noreply.github.com>
2025-02-21 16:12:53 -03:00
Angelk90
17323ed7b2
Show git items in the panel only when in a git repository (#24865)
| Before | After | After2 |
| - | - | - |
| <img width="368" alt="Screenshot 2025-02-14 alle 13 45 41"
src="https://github.com/user-attachments/assets/9ed6f233-c7e3-45b4-b2cd-605b6f785cbe"
/> | <img width="367" alt="Screenshot 2025-02-14 alle 14 25 24"
src="https://github.com/user-attachments/assets/808da265-dd1d-4679-9b62-a4def459fc8f"
/> | <img width="371" alt="Screenshot 2025-02-14 alle 14 25 38"
src="https://github.com/user-attachments/assets/09d0e27e-1e58-43b4-9a35-eb14c0d14961"
/> |

Release Notes:

- If it is not a git repository it shows nothing.
- Fix stage and unstage title in context_menu
2025-02-21 12:11:17 -07:00
smit
3759e0bf55
terminal: Update terminal reopening from global to per-workspace (#25336)
Closes #7145

Currently, terminal persistence is global, i.e. split configurations are
restored across all workspaces.

This PR changes it to per-workspace, so configurations are restored only
within the same workspace. Opening a new window will start with a fresh
terminal.


https://github.com/user-attachments/assets/d43fe747-9f28-4723-b409-e8dbb3a23912


Release Notes:

- Improved terminal reopening to be per workspace instead of global.
2025-02-22 00:05:52 +05:30
chbk
144d8a1db6
Improve C and C++ syntax highlighting (#25325)
Release Notes:

  - Improved C and C++ syntax highlighting.

| Zed 0.174.6 | With this PR |
| --- | --- |
|
![Image](https://github.com/user-attachments/assets/fa5bf2e0-c682-4e6a-ab64-bb873579d47c)
|
![Image](https://github.com/user-attachments/assets/dc980de9-cd6a-4b0b-8ddc-ac705f687910)
|

- `NULL`, `nullptr`: `constant` -> `constant.builtin`

```cpp
#include <stdbool.h>
int a[] = {true, false};
const int * IDENTIFIER = nullptr;
```

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-21 12:01:39 -05:00
chbk
7deceb62dc
Improve Go syntax highlighting (#25327)
Release Notes:

  - Improved Go syntax highlighting.

| Zed 0.174.6 | With this PR |
| --- | --- |
|
![Image](https://github.com/user-attachments/assets/7f6113cb-0517-4ea7-a979-902a2373314e)
|
![Image](https://github.com/user-attachments/assets/0cf07ebc-c5bd-4269-af7a-49496305d265)
|

- `package_identifier`: `namespace`, language-agnostic scope for
modules, packages, namespaces
- `method_elem`: `function.method`
- `;` ,`.` ,`,` ,`:`: `punctuation.delimiter`

```go
package my_package
import (
  pkg "fmt"
)
type A interface {
  method_elem(foo int, bar float64) int
}
func main() {
  identifier := true
  const constant int = 3
  for i := 0; i <= 3; i++ {
    pkg.Println(identifier)
  }
}
```

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-21 11:32:14 -05:00
Piotr Osiewicz
a97a2ebf35
lsp: Send non-null workspaceFolders in initialize (#25337)
This is a ~workaround for next-ls not handling null workspace folders in
initialize request
Related to #25264
/cc @timfjord
Closes #ISSUE

Release Notes:

- Changed how workspace folders are shared with language servers, fixing
a startup issue with `next-ls` in the process.
2025-02-21 17:05:14 +01:00
chbk
5e4bdbbcde
Improve JSON syntax highlighting (#25329)
Release Notes:

  - Improved JSON syntax highlighting.

| Zed 0.174.6 | With this PR |
| --- | --- |
|
![Image](https://github.com/user-attachments/assets/46c8ae89-aca1-4756-b66c-78ccd8f3778d)
|
![Image](https://github.com/user-attachments/assets/3ba5e5db-1467-40d7-a502-2790feec8ad3)
|

- `null`: `constant` -> `constant.builtin`
- `,`, `:`: `punctuation.delimiter`

```json
{
  "property": null,
  "boolean": true
}
```
2025-02-21 15:59:32 +00:00
chbk
d0a0303428
Improve Bash syntax highlighting (#25324)
Release Notes:

  - Improved Bash syntax highlighting

| Zed 0.174.6 | With this PR |
| --- | --- |
|
![Image](https://github.com/user-attachments/assets/ecff952a-c10c-447a-8a99-ebd4ac6d6936)
|
![Image](https://github.com/user-attachments/assets/37568a83-f32c-4d4c-bd9a-3ebbe9aa40ae)
|

- `string`: `string`
- `variable`: `property` -> `variable`
- `number`: `number`
- `regex`: `string.regex`
- `>&`, `>&-`, `:`, `//`, `/`, `%`, `%%`, `#`, `##`, `=`, `==`:
`operator`
- `-lt`, `-le`, `-gt`, `-ge`, `-eq`, `-ne`, `-z`, `-n`:
`keyword.operator`
- `;`: `punctuation.delimiter`
- `(`, `)`, `{`, `}`, `[`, `]`: `punctuation.bracket`
- `$`, `${ }`, `$( )`: `punctuation.special`, as defined in other
languages

```bash
variable=I\ like\ Zed
function my_function() {
  echo "Hello world, ${variable//regex/string}" > file
}
if [ $(uid) -lt 600 ]; then
  my_function;
  cat file | grep hello >&3
fi
```
2025-02-21 10:36:07 -05:00
Marshall Bowers
a4ade37a56
rust: Add raw to keyword list for syntax highlighting (#25342)
This PR adds support for syntax highlighting the `raw` keyword in Rust.

Release Notes:

- Added `raw` keyword to Rust language highlights (see the [Rust 1.82.0
announcement](https://blog.rust-lang.org/2024/10/17/Rust-1.82.0.html#native-syntax-for-creating-a-raw-pointer)).

Co-authored-by: everdrone <giorgiotropiano@gmail.com>
2025-02-21 15:28:30 +00:00
everdrone
1fb4620a90
Use @boolean for true and false in highlights (#25338)
Release Notes:

- Fixed issue where `true` and `false` were highlighted as constants,
ignoring the `boolean` highlight defined in themes.
  - This fix applies to: C, C++, Go, JSON, JSONC, Python, and Rust.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-21 15:26:52 +00:00
GiM
3c4903c6bf
Pass "menu" key presses in windows down as a Keystroke (#25000)
This is second part needed for #17819.
There is already binding in default bindings: `"menu":
"editor::OpenContextMenu",` (but won't work on windows without this
change)

Release Notes:

- Handle "menu" key in windows
2025-02-21 23:23:58 +08:00
Marshall Bowers
ad4163b9be
Revert "Add syntax scopes to themes (#25323)" (#25339)
This reverts commit 2f416aebbe.

We shouldn't have merged this yet, as it currently breaks syntax
highlighting for some languages that haven't had their requisite changes
merged yet.

We also need to be aware of the impact this will have on downstream
themes.

@chbk We should bundle any changes to the themes with the specific
language highlights that depend on those changes (and if there are
multiple languages that need the same change then pick one language to
come first and then stack the rest of the changes on top of that).

Release Notes:

- Community: This is a revert of
https://github.com/zed-industries/zed/pull/25323, so remove those notes
from the release notes.
2025-02-21 15:12:12 +00:00
chbk
2f416aebbe
Add syntax scopes to themes (#25323)
Release Notes:

  - Added syntax scopes to themes

Supports:

- [Improve CSS syntax
highlighting](https://github.com/zed-industries/zed/pull/25326)
- [Improve Go syntax
highlighting](https://github.com/zed-industries/zed/pull/25327)
- [Improve Markdown syntax
highlighting](https://github.com/zed-industries/zed/pull/25330)

Changes:

- Adds highlighting rules for the following new scopes, using theme
colors:
    - `heading`
    - `namespace`
    - `selector`
    - `strikethrough`
    - `unit`

- Renames scopes that are no longer used in `zed/crates/languages/src`
or `zed/extensions` to their new names:
    - `punctuation.list_marker` -> `punctuation.markup`
    - `link_text` -> `link`
- `link_uri` -> `link.url`, as defined in the [gitcommit
grammar](dff47a8436/crates/languages/src/gitcommit/highlights.scm (L5))
    - `text.literal` -> `raw`
2025-02-21 09:21:18 -05:00
Nate Butler
5397ca23a1
ui: More component previews, UI component cleanup (#25302)
- Don't require ui component docs (this isn't really working)
- Add more component previews
- Update component preview style & navigation

Release Notes:

- N/A
2025-02-21 09:20:53 -05:00
smit
c9235ff916
Revert unintended renaming (#25318)
Just little bit clean up from #25288

Release Notes:

- N/A
2025-02-21 18:44:23 +05:30
Coenen Benjamin
dff47a8436
rust: Add support for doctest runnables (#24806)
Screenshot:


![image](https://github.com/user-attachments/assets/0ac88029-76c1-4135-bef2-373636e3587d)

I would be happy to add tests if you point me to the right place to do
it please.

Release Notes:

- Added support for doc test in tasks for Rust

---------

Signed-off-by: Benjamin <5719034+bnjjj@users.noreply.github.com>
2025-02-21 10:57:09 +01:00