Commit graph

191 commits

Author SHA1 Message Date
Danilo Leal
d52f07b77c
lsp tool: Make "Restart All Servers" always visible (#34255)
Next step is to have a "Restart Current Buffer Server(s)". 😬 

Release Notes:

- N/A
2025-07-10 22:00:01 -03:00
Kirill Bulatov
a1188848ef
Make inline and regular diagnostics more related (#34237)
Release Notes:

- N/A
2025-07-10 21:11:49 +00:00
Danilo Leal
e30e4381de
Add chevron icons to the dropdown menus in the LSP log pane (#34149)
A bunch of dropdown menus in this pane that weren't clear that were
menus without chevrons in it. :)

<img
src="https://github.com/user-attachments/assets/fc701a5d-ed89-4de3-a76e-06d22ad9e366"
width="600"/>

Release Notes:

- N/A
2025-07-09 16:33:07 -03:00
Kirill Bulatov
45d200f2f8
Wrap back around in context menu properly (#34112)
When navigating back in the context menu, it was not possible to get
past first element, if it was not selectable.
The other way around works, hence the fix.

Release Notes:

- N/A
2025-07-09 11:44:29 +00:00
Danilo Leal
ad8b823555
Improve the LSP popover menu design (#34081)
- Add a slightly different bolt icon SVG so it sits better when with an
indicator
- Attempt to clarify what happens when clicking any of the menu items
- Add descriptions to the tooltips to clarify what each indicator color
means
- Add section titles to clarify in which category each menu item is
sitting on

Release Notes:

- N/A
2025-07-08 19:51:24 -03:00
Kirill Bulatov
82aee6bcf7
Another lsp tool UI migration (#34009)
https://github.com/user-attachments/assets/54182f0d-43e9-4482-89b9-94db5ddaabf8

Release Notes:

- N/A
2025-07-07 14:28:18 +00:00
Ben Kunkle
6cd4dbdea1
gpui: Store action documentation (#33809)
Closes #ISSUE

Adds a new `documentation` method to actions, that is extracted from doc
comments when using the `actions!` or derive macros.

Additionally, this PR adds doc comments to as many action definitions in
Zed as possible.

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-07-02 21:14:33 -04:00
Conrad Irwin
a675ca7a1e
Remove into SelectionEffects from .change_selections (#33554)
In #32656 I generalized the argument to change selections to allow
controling both the scroll and the nav history (and the completion
trigger).

To avoid conflicting with ongoing debugger cherry-picks I left the
argument as an `impl Into<>`, but I think it's clearer to make callers
specify what they want here.

I converted a lot of `None` arguments to `SelectionEffects::no_scroll()`
to be exactly compatible; but I think many people used none as an "i
don't care" value in which case Default::default() might be more
appropraite

Closes #ISSUE

Release Notes:

- N/A
2025-06-27 14:31:31 -06:00
Conrad Irwin
6e762d9c05 Revert "Remove into SelectionEffects from .change_selections"
This reverts commit 28380d714d.
2025-06-27 14:06:17 -06:00
Conrad Irwin
28380d714d Remove into SelectionEffects from .change_selections
In #32656 I generalized the argument to change selections to allow
controling both the scroll and the nav history (and the completion
trigger).

To avoid conflicting with ongoing debugger cherry-picks I left the
argument as an `impl Into<>`, but I think it's clearer to make callers
specify what they want here.

I converted a lot of `None` arguments to `SelectionEffects::no_scroll()`
to be exactly compatible; but I think many people used none as an "i
don't care" value in which case Default::default() might be more
appropraite
2025-06-27 14:03:45 -06:00
Kirill Bulatov
865dd4c5fc
Rework LSP tool keyboard story (#33525)
https://github.com/user-attachments/assets/81da68fe-bbc5-4b23-8182-923c752a8bd2

* Removes all extra elements: headers, buttons, to simplify the menu
navigation approach and save space.
Implements the keyboard navigation and panel toggling.

* Keeps the status icon and the server name, and their ordering approach
(current buffer/other) in the menu.
The status icon can still be hovered, but that is not yet possible to
trigger from the keyboard: future ideas would be make a similar side
display instead of hover, as Zeta menu does:


![image](https://github.com/user-attachments/assets/c844bc39-00ed-4fe3-96d5-1c9d323a21cc)

* Allows to start (if all are stopped) and stop (if some are not
stopped) all servers at once now with the button at the bottom

Release Notes:

- N/A
2025-06-27 16:25:56 +03:00
Danilo Leal
2823771c06
Add design improvements to the LSP popover (#33485)
Not the ideal design just yet as that will probably require a different
approach altogether, but am pushing here just some reasonably small UI
adjustments that will make this feel slightly nicer!

Release Notes:

- N/A
2025-06-26 22:27:21 +00:00
Kirill Bulatov
a0bd25f218
Feature gate the LSP button (#33463)
Follow-up of https://github.com/zed-industries/zed/pull/32490

The tool still looks like designed by professional developers, and still
may change its UX based on the internal feedback.

Release Notes:

- N/A
2025-06-26 15:41:42 +00:00
David Barsky
1af9f98c1d
lsp-log: Avoid trimming leading space in language server logs (#33418)
Not sure what the full intention/right fix for this is, but
https://github.com/zed-industries/zed/pull/32659 re-introduced trimming
of leading spaces. rust-analyzer has [a custom tracing
formatter](317542c1e4/crates/rust-analyzer/src/tracing/hprof.rs)
that is _super_ useful for profiling what the heck rust-analyzer is
doing. It makes prodigious use of whitespace to delineate to create a
tree-shaped structure. This change reintroduces the leading whitespace.

I made a previous change similar to this that removed a `stderr:` in
https://github.com/zed-industries/zed/pull/27213/. If this is a
direction y'all are happy to go with, I'd be happy to add a test for
this!

<details>
<summary>A screenshot of the before</summary>

<img width="1624" alt="Screenshot 2025-06-25 at 2 12 45 PM"
src="https://github.com/user-attachments/assets/a714d973-9377-41ca-8087-3b0e82b41620"
/>

</details>

<details>
<summary>A screenshot of the after</summary>

<img width="1136" alt="Screenshot 2025-06-25 at 2 40 07 PM"
src="https://github.com/user-attachments/assets/b798ca13-11fc-4f97-9602-55e782068a5a"
/>

</details>

cc: @mgsloan.

Release Notes:

- Fixed the removal of leading whitespace in a language server's stderr
logs.
2025-06-25 16:24:51 -06:00
Kirill Bulatov
c0acd8e8b1
Add language server control tool into the status bar (#32490)
Release Notes:

- Added the language server control tool into the status bar

---------

Co-authored-by: Nate Butler <iamnbutler@gmail.com>
2025-06-25 19:57:28 +03:00
Cole Miller
bfffc293a3
debugger: Parse and highlight text with ANSI escape sequences (#32915)
Relanding #32817 with an improved approach, bugs fixed, and a test.

Release Notes:

- N/A
2025-06-17 23:39:31 -04:00
Cole Miller
2f1d25d7f3
Revert "debugger: Process ANSI color escape codes in console" (#32906)
Reverts zed-industries/zed#32817

Release Notes:
- N/A
2025-06-17 22:13:12 +00:00
Cole Miller
ffc6218349
debugger: Process ANSI color escape codes in console (#32817)
- [x] foreground highlights
- [x] background highlights
- [x] advertise support in DAP capabilities

Closes #31372

Release Notes:

- Debugger Beta: added basic support for highlighting in the console
based on ANSI escape codes.
2025-06-16 17:39:53 -04:00
Michael Sloan
babf846ef9
Fix newlines in language server logs when switching log types + misc (#32659)
Mistake in #31863 where the stored log entries no longer had a format
that could simply have `\n` added after each entry.

Also fixes a potential crash in the long line folding logic if unicode
was in the logs - introduced in #22996.

Also updates the log line truncation logic to never exceed the
pre-allocated capacity

Release Notes:

- N/A
2025-06-13 06:22:07 +00:00
Ben Kunkle
f567bb52ff
gpui: Simplify uniform list API by removing entity param (#32480)
This PR also introduces `Context::processor`, a sibling of
`Context::listener` that takes a strong pointer to entity and allows for
a return result.

Release Notes:

- N/A

Co-authored-by: Mikayla <mikayla@zed.dev>
2025-06-10 18:50:57 +00:00
Michael Sloan
feeda7fa37
Add newlines between messages in LSP RPC logs for more navigability (#31863)
Release Notes:

- N/A
2025-06-03 02:12:58 +00:00
Finn Evers
2c8049270a
language_tools: Increase available space for language server logs (#30742)
This PR contains some small improvements for the language server log
editors. Due to the large gutter as well as the introduction of the
minimap, the horizontally available space was rather small. As these
editors soft wrap at the editor width, it resulted in the logs becoming
vertically larger and somewhat harder to read.

The improvement here is to disable all elements in the gutter that will
never appear or be used in the logs anyway. Furthermore, I opted to
disable the minimap altogether, since from my point of view it did not
contain any valuable information about the logs being shown.

First image is the current main, second is this branch. I put these
below each other so the difference is easier to spot.


![main](https://github.com/user-attachments/assets/b3796e5f-4fe3-48c8-95a4-d3b84c607963)

![PR](https://github.com/user-attachments/assets/bd8a4e6c-dbbb-4a9e-99aa-474fa073196f)


Release Notes:

- N/A
2025-05-27 00:57:45 +03:00
Joseph T. Lyons
534bb0620d
Use read() over read_with() to improve readability in simple cases (#31455)
Follow up to: #31263 

Release Notes:

- N/A
2025-05-26 16:14:07 -04:00
Ben Kunkle
c0aa8f63fd
zlog: Replace usages of env_logger in tests with zlog (#31436)
Also fixes:
https://github.com/zed-industries/zed/pull/31400#issuecomment-2908165249

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2025-05-26 11:48:50 -04:00
Conrad Irwin
ed361ff6a2
Rename debug: commands to dev: (#30675)
Closes #ISSUE

Release Notes:

- Breaking change: The actions used while developing Zed have been
renamed from `debug:` to `dev:` to avoid confusion with the new debugger
feature:
- - `dev::OpenDebugAdapterLogs`
- - `dev::OpenSyntaxTreeView`
- - `dev::OpenThemePreview`
- - `dev::OpenLanguageServerLogs`
- - `dev::OpenKeyContextView`
2025-05-14 11:15:27 +02:00
tidely
8000151aa9
zed: Reduce clones (#30550)
A collection of small patches that reduce clones. Mostly by using owned
iterators where possible.

Release Notes:

- N/A
2025-05-12 10:09:23 +00:00
Julia Ryan
4dff47ae20
Add searchable global tab switcher (#28047)
resolves #24655
resolves #23945

I haven't yet added a default binding for the new command. #27797 added `:ls` and
`:buffers` which in my opinion should use the global searchable version
given that that matches the vim semantics of those commands better than
just showing the tabs in the local pane.

There's also a question of what to do when you select a tab from another
pane, should the focus jump to that pane or should that tab move to the
currently focused pane? For now I've implemented the former.

Release Notes:

- Added `tab_switcher::ToggleAll` to search open tabs from all panes and focus the selected one.

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-04-28 09:21:27 +00:00
Conrad Irwin
c0f8e0f605
Fix context_stack race in KeyContextView (#29324)
cc @notpeter

Before this change we used our own copy of `cx.key_context()` when
matching.
This led to races where the context queried could be either before (or
after) the
context used in dispatching.

To avoid the race, gpui now passes out the context stack actually used
instead.

Release Notes:

- Fixed a bug where the Key Context View could show the incorrect
context,
  causing confusing results.
2025-04-23 23:34:39 -06:00
张小白
f0ef3110d3
gpui: Introduce PlatformKeyboardLayout trait for human-friendly keyboard layout names (#29049)
This PR adds a new `PlatformKeyboardLayout` trait with two methods:
`id(&self) -> &str` and `name(&self) -> &str`. The `id()` method returns
a unique identifier for the keyboard layout, while `name()` provides a
human-readable name. This distinction is especially important on
Windows, where the `id` and `name` can be quite different. For example,
the French layout has an `id` of `0000040C`, which is not
human-readable, whereas the `name` would simply be `French`. Currently,
the existing `keyboard_layout()` method returns what's essentially the
same as `id()` in this new design.

This PR implements the `name()` method for both Windows and macOS. On
Linux, for now, `name()` still returns the same value as `id()`.

Release Notes:

- N/A
2025-04-19 22:23:03 +08:00
Kirill Bulatov
602ae84542
Fix the buttons not working in key context view (#28910)
Release Notes:

- N/A
2025-04-16 21:02:37 +00:00
Cole Miller
42c3f4e7cf
debugger_ui: Preview thread state when using the dropdown (#28778)
This PR changes the thread list dropdown menu in the debugger UI to
eagerly preview the state of a thread when selecting it, instead of
waiting until confirming the selection.

Release Notes:

- N/A
2025-04-15 12:10:32 -04:00
Julia Ryan
01ec6e0f77
Add workspace-hack (#27277)
This adds a "workspace-hack" crate, see
[mozilla's](https://hg.mozilla.org/mozilla-central/file/3a265fdc9f33e5946f0ca0a04af73acd7e6d1a39/build/workspace-hack/Cargo.toml#l7)
for a concise explanation of why this is useful. For us in practice this
means that if I were to run all the tests (`cargo nextest r
--workspace`) and then `cargo r`, all the deps from the previous cargo
command will be reused. Before this PR it would rebuild many deps due to
resolving different sets of features for them. For me this frequently
caused long rebuilds when things "should" already be cached.

To avoid manually maintaining our workspace-hack crate, we will use
[cargo hakari](https://docs.rs/cargo-hakari) to update the build files
when there's a necessary change. I've added a step to CI that checks
whether the workspace-hack crate is up to date, and instructs you to
re-run `script/update-workspace-hack` when it fails.

Finally, to make sure that people can still depend on crates in our
workspace without pulling in all the workspace deps, we use a `[patch]`
section following [hakari's
instructions](https://docs.rs/cargo-hakari/0.9.36/cargo_hakari/patch_directive/index.html)

One possible followup task would be making guppy use our
`rust-toolchain.toml` instead of having to duplicate that list in its
config, I opened an issue for that upstream: guppy-rs/guppy#481.

TODO:
- [x] Fix the extension test failure
- [x] Ensure the dev dependencies aren't being unified by Hakari into
the main dependencies
- [x] Ensure that the remote-server binary continues to not depend on
LibSSL

Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
2025-04-02 13:26:34 -07:00
Piotr Osiewicz
dc64ec9cc8
chore: Bump Rust edition to 2024 (#27800)
Follow-up to https://github.com/zed-industries/zed/pull/27791

Release Notes:

- N/A
2025-03-31 20:55:27 +02:00
Piotr Osiewicz
0729d24d77
chore: Prepare for Rust edition bump to 2024 (without autofix) (#27791)
Successor to #27779 - in this PR I've applied changes manually, without
futzing with if let lifetimes at all.

Release Notes:

- N/A
2025-03-31 20:10:36 +02:00
David Barsky
7ade7d8e45
lsp-config: Allow setting a server's environment variables (#27213)
Closes https://github.com/zed-industries/zed/issues/14334, allowing
users to set environment variables for a language server binary like:

```json
"lsp": {
  "rust-analyzer": {
    "binary": {
      "path": "/Users/dbarsky/.cargo/bin/rust-analyzer",
      "env": {
        "RA_PROFILE": "*>100"
      }
    },
  }
}
```

The newly introduced environment variables are merged with the shell
environment. Perhaps more controversially, I've _also_ removed the
trimming/`stderr:`-prefixing of language server logs. This because
rust-analyzer has some nice, tree-shaped profiling built-in, and it
prevents us from printing profiles like this:

<details>
<img width="1147" alt="Screenshot 2025-03-20 at 12 09 14 PM"
src="https://github.com/user-attachments/assets/b7066651-6394-492b-b745-906c66d3c7b2"
/>
</details>

Release Notes:

- Added the ability to set a language server's environment variables.
- Removed the `stderr`-prefix of a language server's stderr logs.
2025-03-21 09:15:41 +02:00
CharlesChen0823
382f9f6151
language_tools: Fix buffer search keeping focusing when pressing enter in vim mode (#26266)
Closes #25643 

Release Notes:

- Fixed buffer search keep focus when pressing enter in vim mode

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-03-19 04:25:29 +00:00
Mikayla Maki
1aefa5178b
Move "async move" a few characters to the left in cx.spawn() (#26758)
This is the core change:
https://github.com/zed-industries/zed/pull/26758/files#diff-044302c0d57147af17e68a0009fee3e8dcdfb4f32c27a915e70cfa80e987f765R1052

TODO:
- [x] Use AsyncFn instead of Fn() -> Future in GPUI spawn methods
- [x] Implement it in the whole app
- [x] Implement it in the debugger 
- [x] Glance at the RPC crate, and see if those box future methods can
be switched over. Answer: It can't directly, as you can't make an
AsyncFn* into a trait object. There's ways around that, but they're all
more complex than just keeping the code as is.
- [ ] Fix platform specific code

Release Notes:

- N/A
2025-03-19 02:09:02 +00:00
Nico Lehmann
229e853874
Make buffer search aware of search direction (#24974)
This solves a couple of issues with Vim search by making the search
buffer and `SearchableItem` aware of the direction of the search. If
`SearchOptions::BACKWARDS` is set, all operations will be reversed. By
making `SearchableItem` aware of the direction, the correct active match
can be selected when searching backward.

Fixes #22506. This PR does not fix the last problem in that issue, but
that one is also tracked in #8049.

Release Notes:

- Fixes incorrect behavior of backward search in Vim mode
2025-03-04 19:27:37 -07:00
Kirill Bulatov
80458ffb96
Persist selections for editors (#25083)
Part of https://github.com/zed-industries/zed/issues/7371
Closes https://github.com/zed-industries/zed/issues/12853

Release Notes:

- Started to persist latest selections for editors, to restore those on
restart
2025-02-18 14:27:00 +00:00
Dino
e0fc767c11
Display case-sensitive keybindings for vim commands (#24322)
This Pull Request tackles the issue outline in #14287 by changing the
way `KeyBinding`s for vim mode are displayed in the command palette.
It's worth pointing out that this whole thing was pretty much
implemented by Conrad Irwin during a pairing session, I just tried to
clean up some other changes introduced for a different issue, while
improving some comments.

Here's a quick list of the changes introduced:

- Update `KeyBinding` with a new `vim_mode` field to determine whether
the keybinding should be displayed in vim mode.
- Update the way `KeyBinding` is rendered, so as to detect if the
keybinding is for vim mode, if it is, only display keys in uppercase if
they require the shift key.
- Introduce a new global state – `VimStyle(bool)` - use to determine
whether `vim_mode` should be enabled or disabled when creating a new
`KeyBinding` struct. This global state is automatically set by the `vim`
crate whenever vim mode is enabled or disabled.
- Since the app's context is now required when building a `KeyBinding` ,
update a lot of callers to correctly pass this context.

And before and after screenshots, for comparison:

| before | after |
|--------|-------|
| <img width="1050" alt="SCR-20250205-tyeq"
src="https://github.com/user-attachments/assets/e577206d-2a3d-4e06-a96f-a98899cc15c0"
/> | <img width="1050" alt="SCR-20250205-tylh"
src="https://github.com/user-attachments/assets/ebbf70a9-e838-4d32-aee5-0ffde94d65fb"
/> |

Closes #14287 

Release Notes:

- Fix rendering of vim commands to preserve case sensitivity

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-02-14 22:03:59 -07:00
Piotr Osiewicz
a618830aea
project: Fine-grained language server management (#24038)
Closes #ISSUE
https://github.com/zed-industries/zed/pull/23804
Release Notes:

- Improved detection of project roots for use by language servers.

Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: smit <0xtimsb@gmail.com>
Co-authored-by: Henrikh Kantuni <henrikh.kantuni@gmail.com>
Co-authored-by: Caleb! <48127194+kaf-lamed-beyt@users.noreply.github.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Agus Zubiaga <agus@zed.dev>
Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
2025-02-14 15:41:49 +01:00
Agus Zubiaga
0af048a7cf
edit predictions: Cache settings across renders (#24581)
We were reading edit prediction settings too often, causing frames to be
dropped. We'll now cache them and update them from
`update_visible_inline_completion`.

Release Notes:

- N/A
2025-02-10 20:57:25 +00:00
Caleb!
065fdcb86b
language_tools: Add background color to syntax tree view (#24524)
Closes #22830 

@jansol, please take a look. I don't know if this is correct as I
couldn't really tell the difference. I just added the active theme's
background color to the main container of the tree view.

<img width="1309" alt="Screenshot 2025-02-09 at 10 29 15 AM"
src="https://github.com/user-attachments/assets/dadf9333-0074-4bfa-bb06-ed4c4f275200"
/>
 
Release Notes:

- Added an explicit background color to the syntax tree view.

cc: @iamnbutler

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-09 15:54:14 +00:00
Peter Tripp
c484374b2f
Make OpenKeyContextView open to the right (#24452)
Match the behavior of OpenSyntaxTreeView logs and OpenLanguageServerLogs

Release Notes:

- Make `debug::OpenSyntaxTreeView` automatically open in split to the
right
2025-02-07 11:20:27 -05:00
张小白
74c4dbd237
windows: Fix tests on Windows (#22616)
Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla.c.maki@gmail.com>
2025-02-05 14:30:09 +00:00
Conrad Irwin
f2b3f3a9ab
Allow buffer search in project search (#23819)
Closes #13437
Closes #19993

Release Notes:

- Allow searching within the results of a project search
- vim: Fix `/`/`?`, `n`/`N`, `gn`/`gN`,`*`/`#` in project search results

---------

Co-authored-by: Nico <nico.lehmann@gmail.com>
2025-01-31 00:13:46 -07:00
Max Brunsfeld
399e2c1ed3
Revert "project: Fine-grained language server management" (#23977)
Reverts zed-industries/zed#23805
2025-01-30 13:42:56 -08:00
Piotr Osiewicz
e662e819fe
project: Fine-grained language server management (#23805)
Closes #ISSUE
https://github.com/zed-industries/zed/pull/23804
Release Notes:

- Improved detection of project roots for use by language servers.
2025-01-30 08:35:36 +00:00
Richard Feldman
33d1145c3f
Refactor to use SharedString in more places (#23813)
Splitting this off from
https://github.com/zed-industries/zed/pull/23808, per @maxdeviant's
suggestion!

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
2025-01-28 19:04:21 -05:00
Piotr Osiewicz
22afec32cf
Revert "project: Fine-grained language server management" (#23804)
Reverts zed-industries/zed#23708
2025-01-28 21:38:06 +00:00