Commit graph

1767 commits

Author SHA1 Message Date
Tim Havlicek
518f8cc5b7
fix: Absolutize path to worktree root in worktree.read_text_file (#19064)
Closes #19050

Release Notes:

- Fixed `worktree.read_text_file` plugin API working incorrectly
([#19050](https://github.com/zed-industries/zed/issues/19050))
2024-10-11 13:26:37 +03:00
Thorsten Ball
1691652948
ssh: Fix abs paths in file history & repeated go-to-def (#19027)
This fixes two things:

- Go-to-def to absolute paths (i.e. opening stdlib files) multiple times
(opening, dropping, and re-opening worktrees)
- Re-opening abs paths from the file picker history that were added
there by go-to-def


Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-10-11 11:21:34 +02:00
Thorsten Ball
b75532fad7
ssh remote: Handle disconnect on project and show overlay (#19014)
Demo:



https://github.com/user-attachments/assets/e5edf8f3-8c15-482e-a792-6eb619f83de4


Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-10-10 12:59:09 +02:00
Max Brunsfeld
53cc82b132
Fix some issues with branch buffers (#18945)
* `Open Excerpts` command always opens the locations in the base buffer
* LSP features like document-highlights, go-to-def, and inlay hints work
correctly in branch buffers
* Other LSP features like completions, code actions, and rename are
disabled in branch buffers

Release Notes:

- N/A
2024-10-09 16:55:25 -07:00
Kirill Bulatov
49c75eb062
Rework remote task synchronization (#18746)
Reworks the way tasks are stored, accessed and synchronized in the
`project`.
Now both collab and ssh remote projects use the same TaskStorage kind to
get the task context from the remote host, and worktree task templates
are synchronized along with other worktree settings.

Release Notes:

- Adds ssh support to tasks, improves collab-remote projects' tasks sync
2024-10-09 22:28:42 +03:00
Thorsten Ball
b703514d0e
project: Observe SshRemoteClient to get notified about state changes (#18918)
Release Notes:

- N/A
2024-10-09 17:13:43 +02:00
Thorsten Ball
be531653a4
Direnv warn (#18850)
Follow-up fixes to #18567

Release Notes:

- N/A
2024-10-08 11:54:28 +02:00
Bennet Bo Fenner
fa85238c69
ssh: Limit amount of reconnect attempts (#18819)
Co-Authored-by: Thorsten <thorsten@zed.dev>

Release Notes:

- N/A

---------

Co-authored-by: Thorsten <thorsten@zed.dev>
2024-10-08 11:37:54 +02:00
Stanislav Alekseev
910a773b89
Display environment loading failures in the activity indicator (#18567)
As @maan2003 noted in #18473, we should warn the user if direnv call
fails

Release Notes:

- Show a notice in the activity indicator if an error occurs while
loading the shell environment
2024-10-08 11:36:18 +02:00
Thorsten Ball
9c5bec5efb
formatting: Use project environment to find external formatters (#18611)
Closes #18261

This makes sure that we find external formatters in the project
environment.

TODO:

- [x] Use a different type for the triplet of `(buffer_handle,
buffer_path, buffer_env)`. Something like `FormattableBuffer`.
- [x] Test this!!

Release Notes:

- Fixed external formatters not being found, even when they were
available in the `$PATH` of a project.

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-10-07 12:24:12 +02:00
Thorsten Ball
c03b8d6c48
ssh remoting: Enable reconnecting after connection losses (#18586)
Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-10-07 11:40:59 +02:00
Piotr Osiewicz
03c84466c2
chore: Fix some violations of 'needless_pass_by_ref_mut' lint (#18795)
Some checks are pending
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 / (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
While this lint is allow-by-default, it seems pretty useful to get rid
of mutable borrows when they're not needed.

Closes #ISSUE

Release Notes:

- N/A
2024-10-07 01:29:58 +02:00
Jordan Pittman
cac98b7bbf
Show color swatches for LSP completions (#18665)
Closes #11991

Release Notes:

- Added support for color swatches for language server completions.

<img width="502" alt="Screenshot 2024-10-02 at 19 02 22"
src="https://github.com/user-attachments/assets/57e85492-3760-461a-9b17-a846dc40576b">

<img width="534" alt="Screenshot 2024-10-02 at 19 02 48"
src="https://github.com/user-attachments/assets/713ac41c-16f0-4ad3-9103-d2c9b3fa8b2e">

This implementation is mostly a port of the VSCode version of the
ColorExtractor. It seems reasonable the we should support _at least_
what VSCode does for detecting color swatches from LSP completions.

This implementation could definitely be better perf-wise by writing a
dedicated color parser. I also think it would be neat if, in the future,
Zed handled _more_ color formats — especially wide-gamut colors.

There are a few differences to the regexes in the VSCode implementation
but mainly so simplify the implementation :
- The hex vs rgb/hsl regexes were split into two parts
- The rgb/hsl regexes allow 3 or 4 color components whether hsla/rgba or
not and the parsing implementation accepts/rejects colors as needed

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-10-03 14:38:17 -04:00
Piotr Osiewicz
19b186671b
ssh: Add session state indicator to title bar (#18645)
![image](https://github.com/user-attachments/assets/0ed6f59c-e0e7-49e6-8db7-f09ec5cdf653)
The indicator turns yellow when ssh client is trying to reconnect. Note
that the state tracking is probably not ideal (we'll see how it pans out
once we start dog-fooding), but at the very least "green=good" should be
a decent mental model for now.

Release Notes:

- N/A
2024-10-03 00:35:56 +02:00
Kirill Bulatov
778dedec6c
Prepare to sync other kinds of settings (#18616)
Some checks are pending
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 / (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 PR does not change how things work for settings, but lays the
ground work for the future functionality.
After this change, Zed is prepared to sync more than just
`settings.json` files from local worktree and user config.

* ssh tasks

Part of this work is to streamline the task sync mechanism.
Instead of having an extra set of requests to fetch the task contents
from the server (as remote-via-collab does now and does not cover all
sync cases), we want to reuse the existing mechanism for synchronizing
user and local settings.

* editorconfig

Part of the task is to sync .editorconfig file changes to everyone which
involves sending and storing those configs.


Both ssh (and remove-over-collab) .zed/tasks.json and .editorconfig
files behave similar to .zed/settings.json local files: they belong to a
certain path in a certain worktree; may update over time, changing Zed's
functionality; can be merged hierarchically.
Settings sync follows the same "config file changed -> send to watchers
-> parse and merge locally and on watchers" path that's needed for both
new kinds of files, ergo the messaging layer is extended to send more
types of settings for future watch & parse and merge impls to follow.

Release Notes:

- N/A
2024-10-02 22:00:40 +03:00
Thorsten Ball
7ce8797d78
ssh remoting: Add infrastructure to handle reconnects (#18572)
Some checks are pending
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 / (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 restructures the code in `remote` so that it's easier to replace
the current SSH connection with a new one in case of
disconnects/reconnects.

Right now, it successfully reconnects, BUT we're still missing the big
piece on the server-side: keeping the server process alive and
reconnecting to the same process that keeps the project-state.

Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-10-01 12:16:44 +02:00
Thorsten Ball
69e698c3be
terminal: Fix blinking settings & blinking with custom shape (#18538)
This is a follow-up to #18530 thanks to this comment here:
https://github.com/zed-industries/zed/pull/18530#issuecomment-2382870564

In short: it fixes the `blinking` setting and the `cursor_shape` setting
as it relates to blinking.

Turns out our `blinking` setting was always the wrong value when using
`terminal_controlled` and the terminal _would_ control the blinking.

Example script to test with:

```bash
echo -e "0 normal \x1b[\x30 q"; sleep 2
echo -e "1 blink block \x1b[\x31 q"; sleep 2
echo -e "2 solid block \x1b[\x32 q"; sleep 2
echo -e "3 blink under \x1b[\x33 q"; sleep 2
echo -e "4 solid under \x1b[\x34 q"; sleep 2
echo -e "5 blink vert \x1b[\x35 q"; sleep 2
echo -e "6 solid vert \x1b[\x36 q"; sleep 2
echo -e "0 normal \x1b[\x30 q"; sleep 2

echo -e "color \x1b]12;#00ff00\x1b\\"; sleep 2
echo -e "reset \x1b]112\x1b\\ \x1b[\x30 q"
```

Before the changes in here, this script would set the cursor shape and
the blinking, but the blinking boolean would always be wrong.

This change here makes sure that it works consistently:

- `terminal.cursor_shape` only controls the *default* shape of the
terminal, not the blinking.
- `terminal.blinking = on` means that it's *always* blinking, regardless
of what terminal programs want
- `terminal.blinking = off` means that it's *never* blinking, regardless
of what terminal programs want
- `terminal.blinking = terminal_controlled (default)` means that it's
blinking depending on what terminal programs want. when a terminal
program resets the cursor to default, it sets it back to
`terminal.cursor_shape` if that is set.

Release Notes:

- Fixed the behavior of `{"terminal": {"blinking":
"[on|off|terminal_controlled]"}` to work correctly and to work correctly
when custom `cursor_shape` is set.
- `terminal.cursor_shape` only controls the *default* shape of the
terminal, not the blinking.
- `terminal.blinking = on` means that it's *always* blinking, regardless
of what terminal programs want
- `terminal.blinking = off` means that it's *never* blinking, regardless
of what terminal programs want
- `terminal.blinking = terminal_controlled (default)` means that it's
blinking depending on what terminal programs want. when a terminal
program resets the cursor to default, it sets it back to
`terminal.cursor_shape` if that is set.

Demo:


https://github.com/user-attachments/assets/b3fbeafd-ad58-41c8-9c07-1f03bc31771f

Co-authored-by: Bennet <bennet@zed.dev>
2024-09-30 15:36:35 +02:00
Stanislav Alekseev
215bce1974
Make direct direnv loading default (#18536)
I've been running with direct direnv loading for a while now and haven't
experienced any significant issues other than #18473. Making it default
would make direnv integration more reliable and consistent. I've also
updated the docs a bit to ensure that they represent current status of
direnv integration

Release Notes:

- Made direnv integration use direct (`direnv export json`) mode by
default instead of relying on a shell hook, improving consistency and
reliability of direnv detection
2024-09-30 15:35:36 +02:00
Thorsten Ball
533416c5a9
terminal: Make CursorShape configurable (#18530)
This builds on top of @Yevgen's #15840 and combines it with the settings
names introduced in #17572.

Closes #4731.

Release Notes:

- Added a setting for the terminal's default cursor shape. The setting
is `{"terminal": {"cursor_shape": "block"}}``. Possible values: `block`,
`bar`, `hollow`, `underline`.

Demo:


https://github.com/user-attachments/assets/96ed28c2-c222-436b-80cb-7cd63eeb47dd
2024-09-30 12:38:57 +02:00
Stanislav Alekseev
5b40debb5f
Don't stop loading the env if direnv call fails (#18473)
Before this we we would stop loading the environment if the call to
direnv failed, which is not necessary in any way
cc @mrnugget

Release Notes:

- Fixed the environment not loading if `direnv` mode is set to `direct`
and `.envrc` is not allowed
2024-09-30 09:54:22 +03:00
Tom Wieczorek
77df7e56f7
settings: Make external formatter arguments optional (#18340)
If specifying a formatter in the settings like this:

    "languages": {
      "foo": {
        "formatter": {
          "external": {
            "command": "/path/to/foo-formatter"
          }
        }
      }
    }

Zed will show an error like this:

    Invalid user settings file
    data did not match any variant of untagged enum SingleOrVec

This is because the arguments are not optional. The error is hard to
understand, so let's make the arguments actually optional, which makes
the above settings snippet valid.

Release Notes:

- Make external formatter arguments optional
2024-09-30 09:34:41 +03:00
CharlesChen0823
8559731e0d
project: Fix worktree store event missing in remote projects (#18376)
Release Notes:

- N/A
2024-09-27 08:55:35 +02:00
Max Brunsfeld
c1a039a5d7
Remove old project search code path, bump min-supported zed version for collaboration (#18404)
Release Notes:

- N/A
2024-09-26 12:10:39 -07:00
Mikayla Maki
71da81c743
SSH Remoting: Fix bugs in worktree syncing (#18406)
Release Notes:

- N/A

---------

Co-authored-by: conrad <conrad@zed.dev>
2024-09-26 12:03:57 -07:00
Piotr Osiewicz
db92a31067
lsp: Do not notify all language servers on file save (#17756)
This is not an ideal solution to
https://github.com/fasterthanlime/zed-diags-readme, but current status
quo is not great either; we were just going through all of the language
servers and notifying them, whereas we should ideally do it based on a
glob.
/cc @fasterthanlime

Release Notes:

- N/A
2024-09-26 13:18:50 +02:00
Conrad Irwin
64532e94e4
Move adapters to remote (#18359)
Release Notes:

- ssh remoting: run LSP Adapters on host

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-09-25 15:29:04 -07:00
Mikayla Maki
ae6a3d15af
Make python run local worktree LSPs (#18353)
Release Notes:

- Python: made it possible to use locally installed `pyright` if
available

---------

Co-authored-by: conrad <conrad@zed.dev>
2024-09-25 12:45:41 -07:00
Richard Feldman
1eddd2f38d
Fix file descriptors leak in evals (#18351)
Fixes an issue where evals were hitting "too many open files" errors
because we were adding (and detaching) new directory watches for each
project. Now we add those watches globally/at the worktree level, and we
store the tasks so they stop watching on drop.

Release Notes:

- N/A

---------

Co-authored-by: Max <max@zed.dev>
Co-authored-by: Piotr <piotr@zed.dev>
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2024-09-25 15:21:00 -04:00
Conrad Irwin
dc48af0ca1
lsp: Remove reinstall, update config (#18318)
Release Notes:

- Fixed overriding the path of a language server binary for all language
servers. `{"lsp":{"<lsp-name>":{"binary":{"path": "_"}}}}` will now work
for all language servers including those defined by extensions.
- (breaking change) To disable finding lsp adapters in your path, you
must now specify
`{"lsp":{"<lsp-name>":{"binary":{"ignore_system_version": true}}}}`.
Previously this was `{"lsp":{"<lsp-name>":{"binary":{"path_lookup":
false}}}}`. Note that this setting still does not apply to extensions.
- Removed automatic reinstallation of language servers. (It mostly
didn't work)

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-09-25 10:45:56 -07:00
Thorsten Ball
19162c3160
ssh remoting: Show error message if project path does not exist (#18343)
Some checks are pending
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 / (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 now shows an error message if you try open a project over SSH that
doesn't exist. If it's a possible file-path though, it acts like Zed's
`cli` and opens the file so that it can be created.

- Works: `cargo run ssh://127.0.0.1/~/folder-exists/file-does-not-exist`
— this will open `file-does-not-exist`
- Shows error: `cargo run
ssh://127.0.0.1/~/folder-does-not-exist/file-does-not-exist` — this will
show an error

Release Notes:

- N/A

Co-authored-by: Bennet <bennet@zed.dev>
Co-authored-by: Conrad <conrad@zed.dev>
2024-09-25 18:08:34 +02:00
Thorsten Ball
ccc871c44c
ssh remoting: Expand tilde on host side (#18333) 2024-09-25 13:41:18 +02:00
Piotr Osiewicz
a6cb17fb51
chore: Fix violations of elided_named_lifetimes (#18330)
I compile Zed from nightly build pretty often and I've noticed that
we're getting a few hits on new rustc lint:
https://github.com/rust-lang/rust/pull/129207

Release Notes:

- N/A
2024-09-25 12:27:57 +02:00
Thorsten Ball
9d197ddc99
ssh remoting: Fix SSH connection not being closed (#18329)
This fixes the `SshSession` being leaked.

There were two leaks:

1. `Arc<SshSession>` itself got leaked into the `SettingsObserver` that
   lives as long as the application. Fixed with a weak reference.
2. The two tasks spawned by an `SshSession` had a circular dependency
   and didn't exit while the other one was running. Fixed by fixing (1)
   and then attaching one of the tasks to the `SshSession`, which means
   it gets dropped with the session itself, which leads the other task
   to error and exit.

Co-authored-by: Bennet <bennet@zed.dev>

Release Notes:

- N/A

---------

Co-authored-by: Bennet <bennet@zed.dev>
2024-09-25 12:03:24 +02:00
Conrad Irwin
d33600525e
ssh remoting: Fix cmd-o (#18308)
Release Notes:

- ssh-remoting: Cmd-O now correctly opens files on the remote host

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-09-24 16:23:08 -06:00
Conrad Irwin
c4e0f5e0ee
Rebuild buffer store to be aware of remote/local distinction (#18303)
Release Notes:

- N/A

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-09-24 14:52:30 -07:00
Conrad Irwin
f39e54decc
Start work on reload buffers (#18245)
Release Notes:

- Fixed: ssh-remote reload buffers

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-09-24 11:23:39 -07:00
Mikayla Maki
20c06545b6
SSH Remoting: Add the ability to resolve file paths on the remote host (#18250)
Some checks are pending
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 / (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
2024-09-23 16:47:25 -06:00
Conrad Irwin
3ba071b993
Allow using system node (#18172)
Release Notes:

- (Potentially breaking change) Zed will now use the node installed on
your $PATH (if it is more recent than v18) instead of downloading its
own. You can disable the new behavior with `{"node":
{"disable_path_lookup": true}}` in your settings. We do not yet use
system/project-local node_modules.

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-09-23 15:28:04 -06:00
Conrad Irwin
e4080ef565
Move formatting to LSP store (#18242)
Release Notes:

- ssh-remoting: Fixed format on save

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-09-23 13:33:28 -07:00
Antonio Scandurra
7051bc00c2
Add "Fix with Assistant" code action on lines with diagnostics (#18163)
Release Notes:

- Added a new "Fix with Assistant" action on code with errors or
warnings.

---------

Co-authored-by: Nathan <nathan@zed.dev>
2024-09-23 11:40:34 -06:00
Conrad Irwin
a36706aed6
Fix up/down project_id confusion (#18099)
Some checks are pending
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 / (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:

- ssh remoting: Fix LSP queries run over collab
2024-09-23 09:11:58 -06:00
Kirill Bulatov
05d18321db
Resolve completions properly (#18212)
Related to https://github.com/rust-lang/rust-analyzer/pull/18167

* Declare more completion item fields in the client completion resolve
capabilities
* Do resolve completions even if their docs are present
* Instead, do not resolve completions that could not be resolved when
handling the remote client resolve requests
* Do replace the old lsp completion data with the resolved one

Release Notes:

- Improved completion resolve mechanism
2024-09-23 12:53:57 +03:00
CharlesChen0823
75cb199a54
project: Fix typo error cause remove worktree not stop lsp (#18198)
Some checks are pending
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 / (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
2024-09-22 19:50:51 +03:00
Conrad Irwin
4f227fd3bf
Use LanguageServerName in more places (#18167)
Some checks failed
CI / Check formatting and spelling (push) Has been cancelled
CI / (macOS) Run Clippy and tests (push) Has been cancelled
CI / (Linux) Run Clippy and tests (push) Has been cancelled
CI / (Windows) Run Clippy and tests (push) Has been cancelled
Deploy Docs / Deploy Docs (push) Has been cancelled
Docs / Check formatting (push) Has been cancelled
CI / Create a macOS bundle (push) Has been cancelled
CI / Create a Linux bundle (push) Has been cancelled
CI / Create arm64 Linux bundle (push) Has been cancelled
This pushes the new LanguageServerName type to more places.

As both languages and language servers were identified by Arc<str>, it
was
sometimes hard to tell which was intended.

Release Notes:

- N/A
2024-09-20 18:51:34 -06:00
Max Brunsfeld
743feb98bc
Add the ability to propose changes to a set of buffers (#18170)
This PR introduces functionality for creating *branches* of buffers that
can be used to preview and edit change sets that haven't yet been
applied to the buffers themselves.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
Co-authored-by: Marshall <marshall@zed.dev>
2024-09-20 18:28:50 -04:00
Thorsten Ball
90a12f5564
ssh remoting: Do not double-register LspAdapters (#18132)
This fixes the bug with hover tooltips appearing multiple times.

Turns out everytime we receive the `CreateLanguageServer` message we'd
add a new adapter but only have a single server running for all of them.

And we send a `CreateLanguageServer` message everytime you open a
buffer.

What this does is to only add a new adapter if it hasn't already been
registered, which is also what we do locally.


Release Notes:

- N/A
2024-09-20 14:35:45 +02:00
Thorsten Ball
ace4d5185d
settings: Show notification when user/project settings fail to parse (#18122)
Closes #16876

We only ever showed parsing errors, but not if something failed to
deserialize.

Basically, if you had a stray `,` somewhere, we'd show a notification
for user errors, but only squiggly lines if you had a `[]` instead of a
`{}`.

The squiggly lines would only show up when there were schema errors.

In the case of `formatter` settings, for example, if someone put in a
`{}` instead of `[]`, we'd never show anything.

With this change we always show a notification if parsing user or
project settings fails.

(Right now, the error message might still be bad, but that's a separate
change)


Release Notes:

- Added a notification to warn users if their user settings or
project-local settings failed to deserialize.

Demo:


https://github.com/user-attachments/assets/e5c48165-f2f7-4b5c-9c6d-6ea74f678683
2024-09-20 10:53:06 +02:00
Stanislav Alekseev
8103ac12bf
ssh-remoting: Tidy up the code a bit after #18094 (#18102)
Some checks are pending
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 / (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
2024-09-19 21:36:50 -06:00
Conrad Irwin
fbbf0393cb
ssh-remoting: Fix go to definition out of worktree (#18094)
Release Notes:

- ssh-remoting: Fixed go to definition outside of worktree

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2024-09-19 14:04:46 -06:00
Marshall Bowers
1fc391f696
Make Buffer::apply_ops infallible (#18089)
This PR makes the `Buffer::apply_ops` method infallible for
`text::Buffer` and `language::Buffer`.

We discovered that `text::Buffer::apply_ops` was only fallible due to
`apply_undo`, which didn't actually need to be fallible.

Release Notes:

- N/A
2024-09-19 13:14:15 -04:00