Commit graph

24397 commits

Author SHA1 Message Date
Piotr Osiewicz
1b3b825c7f
lsp: Parse LSP messages on background thread - again (#23122)
Some checks are pending
CI / check_docs_only (push) Waiting to run
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) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
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
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
This is a follow-up to #12640.
While profiling latency of working with a project with 8192 diagnostics
I've noticed that while we're parsing the LSP messages into a generic
message struct on a background thread, we can still block the main
thread as the conversion between that generic message struct and the
actual LSP message (for use by callback) is still happening on the main
thread.
This PR significantly constrains what a message callback can use, so
that it can be executed on any thread; we also send off message
conversion to the background thread. In practice new callback
constraints were already satisfied by all call sites, so no code outside
of the lsp crate had to be adjusted.

This has improved throughput of my 8192-benchmark from 40s to send out
all diagnostics after saving to ~20s. Now main thread is spending most
of the time updating our diagnostics sets, which can probably be
improved too.

Closes #ISSUE

Release Notes:

- Improved app responsiveness with huge # of diagnostics.
2025-01-14 13:50:54 +00:00
Kirill Bulatov
8e65ec1022
Disable Prettier for C projects by default (#23119)
Follow-up of https://github.com/zed-industries/zed/pull/23112

Same reasoning applies.

Release Notes:

- Changed default formatter for C to be the primary language server, not
Prettier. Format-on-save is still disabled by default for C, but if one
uses the editor: format command now, it will default to the language
server. clangd can format C files, whereas prettier cannot.
2025-01-14 11:47:22 +00:00
Thorsten Ball
fcadd3e1ff
cpp: Enable language server as formatter by default (#23112)
As @hferreiro points out in [this

comment](https://github.com/zed-industries/zed/pull/18752#issuecomment-2589340565):
C++ and prettier don't work well together, so let's make the default
formatter for C++ the primary language server. We get that by disabling
prettier.

Release Notes:

- Changed default formatter for C++ to be the primary language server,
not Prettier. Format-on-save is still disabled by default for C++, but
if one uses the `editor: format` command now, it will default to the
language server. `clangd` can format C++ files, whereas prettier cannot.
2025-01-14 09:56:57 +00:00
Michael Sloan
a13e64e0cd
Keymap json schema generation improvements intended to be in #23098 (#23114)
Intended to include these in #23098, but seems they didn't push before
merge. Probably didn't use `--force-with-lease`
2025-01-14 09:51:20 +00:00
0x2CA
26be440d99
vim: Add Subword Textobject (#22387)
Some checks are pending
CI / check_docs_only (push) Waiting to run
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) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
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
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
Closes #22761

[Vim: subword text object?
#22280](https://github.com/zed-industries/zed/discussions/22280)

Release Notes:

- Added Vim SubWord TextObject

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-01-14 03:34:49 +00:00
0x2CA
03c99e39f9
vim: Fix vim delete to line (#23053)
Closes #23024

Release Notes:

- Fixed Vim `dxG` delete to line

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-01-14 03:07:47 +00:00
Marshall Bowers
93f117b21a
Improve registration for Assistant code action providers (#23099)
This PR is a follow-up to
https://github.com/zed-industries/zed/pull/22911 to further improve the
registration of code action providers for the Assistant in order to
prevent duplicates.

The `CodeActionProvider` trait now has an `id` method that is used to
return a unique ID for a code action provider. We use this to prevent
registering duplicates of the same provider.

The registration of the code action providers for Assistant1 and
Assistant2 have also been reworked. Previously we were not call the
registration function—and thus setting up the subscriptions—until we
resolved the feature flags. However, this could lead to the registration
happening too late for existing workspace items.

We now perform the registration right away and then remove the undesired
code action providers once the feature flags have been resolved.

Release Notes:

- N/A
2025-01-13 22:25:58 +00:00
Marshall Bowers
830f45e56a
assistant2: Add floating indicator when a response is streaming (#23096)
This PR adds a separate indicator at the bottom of the thread that shows
when a response is being streamed (as well as how to cancel it):

<img width="1309" alt="Screenshot 2025-01-13 at 4 19 07 PM"
src="https://github.com/user-attachments/assets/b64f785b-d522-458d-b915-3f604890597f"
/>

Release Notes:

- N/A
2025-01-13 22:03:45 +00:00
Michael Sloan
ae103fdf64
Fix confusing keymap json errors and hovers for nonexistent actions (#23098)
Release Notes:

- N/A
2025-01-13 21:53:12 +00:00
Marshall Bowers
c599ba64bc
assistant2: Only show the streaming indicator on the last Assistant message (#23090)
Some checks are pending
CI / check_docs_only (push) Waiting to run
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) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
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
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
This PR is a follow-up to #23078 to ensure that the streaming indicator
only shows up on the last Assistant message.

Release Notes:

- N/A
2025-01-13 21:09:01 +00:00
Piotr Osiewicz
867c069b99
editor: Adjust offset of the opened jump target in the multibuffer (#23091)
This PR fixes an issue with jumping from multi_buffer to a file; namely,
the scroll offset of the opened buffer used to match the position within
the multibuffer, but it broke a while back. This is because we were
opening a buffer without providing the data about the origin scroll
offset.

Closes #ISSUE

Release Notes:

- Fixed a bug where the relative position of an excerpt within the
multibuffer was not accounted for while jumping to the buffer, causing
the clicked line to drastically change position on screen.
2025-01-13 21:08:46 +00:00
Marshall Bowers
ac2d3eec91
Remove commented-out code (#23089)
This PR removes some commented-out code from the codebase.

Release Notes:

- N/A
2025-01-13 21:02:45 +00:00
Agus Zubiaga
4054d4a5b7
assistant2: Fix inline context picker and handle dismiss (#23081)
The new `ContextMenu`-based `ContextPicker` requires initialization when
opened, but we were only doing this for the `ContextStrip` picker, not
the inline one.

Additionally, because we have a wrapper element around ContextMenu, we
need to propagate the `DismissEvent` so that it properly closes when
Escape is pressed.

Release Notes:

- N/A
2025-01-13 21:00:20 +00:00
Michael Sloan
7c2c409f6d
Show configuration in language server debug logs (#23084)
Release Notes:

- Added configuration sent on initialization to the `Server Info`
section of the language server logs.
2025-01-13 21:00:03 +00:00
Michael Sloan
d4e91c1898
Add support for namespace changes in action deprecations (#23086)
cc @cole-miller 

Release Notes:

- N/A
2025-01-13 20:56:22 +00:00
Michael Sloan
b633f62aa6
Add test that JSON schema generation works + actions build from no input (#23049)
Release Notes:

- N/A
2025-01-13 20:42:08 +00:00
Joseph T. Lyons
85b727c1a2
Remove inaccurate comments (#23056)
These comments are inaccurate. Even if `convert_case` provided a way to
customize which boundaries were used (which is now does, it 0.7.1), they
would be removed from the string and replaced with the new boundary
character (`-`, `_`, ...), and we'd lose the ability to reconstruct the
text the way the author formatted it. This is not a hack, this is the
way we have to do it.

Release Notes:

- N/A
2025-01-13 20:38:44 +00:00
Cole Miller
bd3c7d6cbf
git: Fully implement "all staged" checkbox (#23079)
Also includes some improvements to the "stage/unstage all" actions and
buttons.

Release Notes:

- N/A
2025-01-13 20:13:14 +00:00
Marshall Bowers
2179be1855
assistant2: Add an indicator when a response is streaming in (#23078)
This PR adds an indicator to the Assistant message to indicate that it
is still streaming:

<img width="1310" alt="Screenshot 2025-01-13 at 2 10 33 PM"
src="https://github.com/user-attachments/assets/635ee60d-b5ea-40ac-952a-b7bfa7e04fcc"
/>

Release Notes:

- N/A
2025-01-13 19:29:50 +00:00
Michael Sloan
2f762955cd
Take a reference in LSP notify (#23077)
In current code this doesn't have benefit. In preparation for avoiding a
clone of workspace configuration. Having the interface this way may make
opportunities for efficiency clearer in the future

Release Notes:

- N/A
2025-01-13 19:26:28 +00:00
Marshall Bowers
c1c767a5bd
assistant2: Make Esc cancel current completion (#23076)
This PR makes it so pressing `Esc` in Assistant2 will cancel the current
completion.

Release Notes:

- N/A
2025-01-13 19:09:27 +00:00
Michael Sloan
b59a9f1f42
Document why rust-analyzer doesn't show action name in action docs (#23072)
rust-analyzer does not support derive_macro expansion in attributes -
https://github.com/rust-lang/rust-analyzer/issues/8092. This could be
worked around via a proc_macro, but I think it'd be best to just require
docs for every action.

Release Notes:

- N/A
2025-01-13 17:48:50 +00:00
Nate Butler
102e70816c
git: Git Panel UI, continued (#22960)
TODO:

- [ ] Investigate incorrect hit target for `stage all` button
- [ ] Add top level context menu
- [ ] Add entry context menus
- [x] Show paths in list view
- [ ] For now, `enter` can just open the file
- [ ] 🐞: Hover deadzone in list caused by scrollbar
- [x] 🐞: Incorrect status/nothing shown when multiple worktrees are
added

---

This PR continues work on the feature flagged git panel.

Changes:
- Defines and wires up git panel actions & keybindings
- Re-scopes some actions from `git_ui` -> `git`.
- General git actions (StageAll, CommitChanges, ...) are scoped to
`git`.
- Git panel specific actions (Close, FocusCommitEditor, ...) are scoped
to `git_panel.
- Staging actions & UI are now connected to git!
- Unify more reusable git status into the GitState global over being
tied to the panel directly.
- Uses the new git status codepaths instead of filtering all workspace
entries

Release Notes:

- N/A

---------

Co-authored-by: Cole Miller <53574922+cole-miller@users.noreply.github.com>
Co-authored-by: Cole Miller <cole@zed.dev>
2025-01-13 16:47:09 +00:00
everdrone
1c6dd03e50
Add Diagnostics key context (#23043)
Closes #17337

Release Notes:

- Add `Diagnostics` key context
- Enables users to specify key bindings for that pane

```json
{
    "context": "Diagnostics",
    "bindings": {
        "alt-q": "diagnostics::ToggleWarnings"
    }
}
```
2025-01-13 16:07:04 +00:00
SkywardSyntax
955248fee0
copilot_chat: Rename o1-preview model to o1 (#23038)
https://github.blog/news-insights/openais-o1-model-available-in-copilot-chat-and-github-models/

Release Notes:

- Renamed Github Copilot Chat "o1-preview" model to "o1".

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2025-01-13 15:32:26 +00:00
tims
7ed834bd79
terminal: Fix unresponsive buttons on load until center pane is clicked + Auto-focus docked terminal on load if no other item is focused (#23039)
Closes #23006

This PR should have been split into two, but since the changes are
related, I merged them into one.

1. On load, the title bar actions and bottom bar toggles are
unresponsive until the center pane is clicked. This happens because the
terminal captures focus (even if it's closed) long after the workspace
sets focus to itself during loading.

The issue was in the `focus_view` call used in the `new` method of
`TerminalPanel`. Since new terminal views can be created behind the
scenes (i.e., without the terminal being visible to the user), we
shouldn't handle focus for the terminal in this case. Removing
`focus_view` from the `new` method has no impact on the existing
terminal focusing logic. I've tested scenarios such as creating new
terminals, splitting terminals, zooming, etc., and everything works as
expected.

2. Currently, on load, docked terminals do not automatically focus when
they are only visible item to the user. This PR implements it.

Before/After:

1. When only the dock terminal is visible on load. Terminal is focused.

<img
src="https://github.com/user-attachments/assets/af8848aa-ccb5-4a3b-b2c6-486e8d588f09"
alt="image" height="280px" />

<img
src="https://github.com/user-attachments/assets/8f76ca2e-de29-4cc0-979b-749b50a00bbd"
alt="image" height="280px" />

2. When other items are visible along with the dock terminal on load.
Editor is focused.

<img
src="https://github.com/user-attachments/assets/d3248272-a75d-4763-9e99-defb8a369b68"
alt="image" height="280px" />

<img
src="https://github.com/user-attachments/assets/fba5184e-1ab2-406c-9669-b141aaf1c32f"
alt="image" height="280px" />

3. Multiple tabs along with split panes. Last terminal is focused.

<img
src="https://github.com/user-attachments/assets/7a10c3cf-8bb3-4b88-aacc-732b678bee19"
alt="image" height="270px" />

<img
src="https://github.com/user-attachments/assets/4d16e98f-9d7a-45f6-8701-d6652e411d3b"
alt="image" height="270px" />

Future:

When a docked terminal is in a zoomed state and Zed is loaded, we should
prioritize focusing on the terminal over the active item (e.g., an
editor) behind it. This hasn't been implemented in this PR because the
zoomed state during the load function is stale. The correct state is
received later via the workspace. I'm still investigating where exactly
this should be handled, so this will be a separate PR.

cc: @SomeoneToIgnore 

Release Notes:

- Fixed unresponsive buttons on load until the center pane is clicked.  
- Added auto-focus for the docked terminal on load when no other item is
focused.
2025-01-13 15:11:45 +00:00
Ozan
13405ed4a3
Add emacs keybindings for mark emulation (#22904)
These keybindings extend the already selected text. This allows closer
emacs emulation where subsequent movement commands extend / shrink the
current selection instead of dismissing it.

This is a follow up on 
- #21927

Release Notes:

- Added emacs movement keybindings that extend/shrink the current
selection

---------

Co-authored-by: Peter Tripp <peter@zed.dev>
2025-01-13 14:53:13 +00:00
Antonio Scandurra
c26553de82
Add more metrics for Fireworks Completion Requested (#23062)
Some checks are pending
CI / check_docs_only (push) Waiting to run
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) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
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
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
Release Notes:

- N/A

Co-authored-by: Thorsten <thorsten@zed.dev>
2025-01-13 12:04:28 +00:00
Antonio Scandurra
f2ab00cec7
Improve prompt caching for edit prediction (#23061)
This is achieved by halving the number of events instead of popping the
front.

Release Notes:

- N/A

Co-authored-by: Thorsten <thorsten@zed.dev>
2025-01-13 10:58:49 +00:00
Michael Sloan
e08484840b
Clarify logic for Autoscroll::newest() and Autoscroll::fit() (#23048)
Release Notes:

- N/A
2025-01-13 05:33:24 +00:00
Michael Sloan
6aba3950d2
Improve keymap json schema (#23044)
Some checks are pending
CI / check_docs_only (push) Waiting to run
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) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
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
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
Also:

* Adds `impl_internal_actions!` for deriving the `Action` trait without
registering.

* Removes some deserializers that immediately fail in favor of
`#[serde(skip)]` on fields where they were used. This also omits them
from the schema.

Release Notes:

- Keymap settings file now has more JSON schema information to inform
`json-language-server` completions and info, particularly for actions
that take input.
2025-01-13 02:34:35 +00:00
Michael Sloan
4c50201036
For informational LSP queries log errors instead of notifying in UI (#23040)
I added these notifies in #23011, but in practive have found them to be
overly disruptive. It would definitely be good to do something better
than logging here, but having a sticky error notification is worse. I
think it is still good to notify on mutation failures, so left those in

In particular with rust-analyzer, "Go to definition" and "Find
references" frequently fail with "Content modified" quite a while after
sending the request. Since users are probably used to these operations
being finicky it doesn't seem useful to have a prominent display of
errors for them.
2025-01-12 21:22:16 +00:00
Kirill Bulatov
fb65044484
Reuse vtsls logic for completion details display (#23030)
Some checks are pending
CI / check_docs_only (push) Waiting to run
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) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
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
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
Part of https://github.com/zed-industries/zed/issues/22833,
https://github.com/zed-industries/zed/issues/22267,
https://github.com/zed-industries/zed/issues/22503

Before:

![image](https://github.com/user-attachments/assets/b6abd3dc-b5d7-4d6a-91e2-92361a519adb)

![image](https://github.com/user-attachments/assets/e3a9e766-efbe-4f4d-b4f9-e6b019e165a5)

After:

![image](https://github.com/user-attachments/assets/d29414d5-4fcc-4d2f-adb2-48304cbafdf6)

Copies https://github.com/zed-industries/zed/pull/15087 change into
`typescript-language-server`-related label details rendering code.

Release Notes:

- Improved typescript-language-server's completion details rendering
2025-01-12 13:44:24 +00:00
Kirill Bulatov
b6b87405b0
Do not try to activate the terminal panel twice (#23029)
Some checks are pending
CI / check_docs_only (push) Waiting to run
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) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
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
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
Closes https://github.com/zed-industries/zed/issues/23023

Fixes terminal pane button opening two terminals on click.

The culprit is in

61115bd047/crates/workspace/src/workspace.rs (L2412-L2417)

* We cannot get any panel by index from the Dock, only an active one
* Both `dock.activate_panel(panel_index, cx);` and `dock.set_open(true,
cx);` do `active_panel.panel.set_active(true, cx);`

So, follow other pane's impls that have `active: bool` property for this
case, e.g.
3ec52d8451/crates/assistant/src/inline_assistant.rs (L2687)

Release Notes:

- Fixed terminal pane button opening two terminals on click
2025-01-12 12:56:31 +00:00
Michael Sloan
61115bd047
Fix a completions panic when no fuzzy matches + inline completion (#23019)
Some checks are pending
CI / check_docs_only (push) Waiting to run
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) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
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
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
My mistake in #22977, in the case where the inline completion was not
selected it set the index to 1 assuming there would be following match
entries.
2025-01-12 02:41:28 +00:00
Michael Sloan
5785266c8c
Improve doc comments about keybinding order (#23014)
Release Notes:

- N/A
2025-01-11 22:47:42 +00:00
Michael Sloan
daaa250109
Include display text for LSP commands in errors (#23012)
https://github.com/zed-industries/zed/pull/23011 adds display of errors
in the UI so it's now more important to contextualize these.

Release Notes:

- N/A
2025-01-11 21:59:06 +00:00
Michael Sloan
de2e197ad9
Inline perform_rename_impl as its only used in one spot (#23013)
Also removes a redundant use of `to_point_utf16`.

Release Notes:

- N/A
2025-01-11 21:58:35 +00:00
Michael Sloan
65c38f22f9
Notify user about LSP errors from editor actions (#23011)
Closes #22976

Release Notes:

* Improved visibility of errors from language servers by reporting them
in the UI when the user invokes an LSP action.
2025-01-11 21:48:50 +00:00
Tyler Albee
6bc89eb4b1
docs: Fix "copy" being used instead of "paste" in vim mode documentation (#23010)
It seems the original author intended to write either "`ctrl+c` to copy"
or "`ctrl+v` to paste". Updated to be "`ctrl+v` to paste".

Release Notes:

- N/A

Co-authored-by: Michael Sloan <michael@zed.dev>
2025-01-11 21:45:41 +00:00
Michael Sloan
bda0c67ece
Add support for rename with language servers that lack prepareRename (#23000)
This adds support for LSPs that use the old rename flow which does not
first ask the LSP for the rename range and check that it is a valid
range to rename.

Closes #16663

Release Notes:

* Fixed rename symbols action when the language server does not have the
capability to prepare renames - such as `luau-lsp`.
2025-01-11 21:22:17 +00:00
Michael Sloan
b65dc8c566
Fix jank in LSP debug log autoscroll (#22998)
Some checks are pending
CI / check_docs_only (push) Waiting to run
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) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
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
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
Not sure why scroll was janky with `Autoscroll::newest()`, but this
appears to fix it. Probably better to conditionally do the autoscroll
requests anyway.

Release Notes:

- N/A
2025-01-11 05:59:21 +00:00
Michael Sloan
bbbd1e9902
LSP debug logs: Default to soft wrap + fold long lines + autoscroll (#22996)
Closes #18737

Release notes:

- Improved LSP debug logs by defaulting to soft wrap and folding a
suffix of long lines. Also adds autoscroll, so if the cursor is on the
last line of the logs they will scroll like `tail`.
2025-01-11 04:48:44 +00:00
Marshall Bowers
40ecc38dd2
assistant2: Make ContextStore::insert_* methods private (#22989)
Some checks are pending
CI / check_docs_only (push) Waiting to run
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) Blocked by required conditions
CI / (Linux) Run Clippy and tests (push) Blocked by required conditions
CI / (Linux) Build Remote Server (push) Blocked by required conditions
CI / (Windows) Run Clippy and tests (push) Blocked by required conditions
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
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
This PR makes the `insert_*` methods on the `ContextStore` private, to
reduce confusion with the public `add_*` methods.

Release Notes:

- N/A
2025-01-10 22:50:33 +00:00
Thorsten Ball
1fcc9b36ba
zeta: Report Fireworks request data to Snowflake (#22973)
Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Conrad <conrad@zed.dev>
2025-01-10 22:40:54 +00:00
Thorsten Ball
3d80b21a91
eslint: Allow configuring workingDirectory (#22972)
This addresses this comment here:
https://github.com/zed-industries/zed/issues/9648#issuecomment-2579246865

Release Notes:

- Added ability to configure `workingDirectory` when using ESLint.
Example: `{"lsp": {"eslint": {"settings": {"workingDirectory": {"mode":
"auto" }}}}}`
2025-01-10 22:21:51 +00:00
Danilo Leal
05b48e8877
zeta: Add tooltip to completion modal list items (#22987)
This is an extra visual aid to make assessing the status of each list
item faster/easier.

<img width="800" alt="Screenshot 2025-01-10 at 7 01 22 PM"
src="https://github.com/user-attachments/assets/4aa712ed-cc70-4ded-afab-e7ceda535ec0"
/>

Release Notes:

- N/A
2025-01-10 22:20:20 +00:00
狐狸
8bd7a048ab
Improve TypeScript highlights (#18525)
- Move function queries under constant queries to avoid uppercase
functions highlighted as constants
- Merge keywords and remove duplicates
- Highlights type aliases on import
- Highlights literal built-in types (null, undefined, true, false) as
`@type.builtin`

Confused about case-based queries, should they be rewritten?

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2025-01-10 22:00:28 +00:00
Danilo Leal
1e0ded4feb
zeta: Show keybinding in completion rating buttons in review modal (#22985)
This PR also removes the `ThumbsUp` action that wasn't being triggered
correctly. We didn't have it's counterpart `ThumbsDown`, too, so I
mostly assumed it would be harmless to remove `ThumbsUp` as well.

<img width="800" alt="Screenshot 2025-01-10 at 6 18 44 PM"
src="https://github.com/user-attachments/assets/9fd5da9f-9dff-454d-9f31-c02f1370b937"
/>

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2025-01-10 22:00:11 +00:00
Marshall Bowers
dad1a3bd31
assistant2: Inline read calls (#22982)
This PR inlines the `read` calls on models in a few spots.

Release Notes:

- N/A
2025-01-10 21:54:50 +00:00