-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Downloading language server for ssh host is not supported yet #18724
Comments
You can install LSPs system-wide through your package manager and the remote Zed should pick them up from your PATH on the remote automatically. That is, unless the LSP in question is written in node.js, which is special. |
"Which is special" love that. Gonna test this out and let you know if it works |
Unfortunately I can't seem to find the setting to point zed to the correct language server directory (pyright got installed in Yeah, even after linking pyright to Also adding "binary": {
"path": "/usr/local/bin/pyright",
"args": []
}, to settings.json/lsp/pyright (btw, there should be a paragraph in general lsp documentation saying that this is possible, that code snippet is only shown in the rust section of the language servers zed doc) didn't change anything, as zed still tries to download pyright, and errors out on saying it can't do that on remote. |
Pyright is unfortunately one of the aforementioned node.js cases. |
Hi, I am using Zed remote for Rust development, and I have rust-analyzer installed, but Zed won't pick it up: Remote machine env: $ uname -a
Linux fedora 6.10.9-100.fc39.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Sep 9 02:28:01 UTC 2024 x86_64 GNU/Linux
$ which rust-analyzer
~/.cargo/bin/rust-analyzer
$ zed --version
Zed 0.155.2 – /home/steve/.local/zed.app/libexec/zed-editor Local machine env: $ sw_vers
ProductName: macOS
ProductVersion: 15.0.1
BuildVersion: 24A348
$ uname -a
Darwin Steves-MacBook-Air.local 24.0.0 Darwin Kernel Version 24.0.0: Tue Sep 24 23:36:26 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T8103 arm64
$ zed --version
Zed 0.152.4 – /Applications/Zed.app |
Do you have an explicit path for rust-analyzer configured on the local machine? I had to remove the path from my clangd config on the client in order to make the remote clangd work due to #18618 . |
Hi, thanks for the reply. I didn't configure the path to RA on my local machine, IIRC, Zed automatically downloaded RA and used it, the RA installed by me remains untouched. |
The reason it's not mentioned in the pyright section of the docs is probably because it's not supported for pyright. It's unfortunately not a setting that is universally available for all LSPs.
You could try adding something like this to your config on the local machine "lsp": {
"rust-analyzer": {
"binary": {
}
}
} That's essentially what I have for clangd. Or you can simply wait for the remote LSP situation to get fixed properly. |
So it's not supported at all? Or just requires extra work to set up? |
My understanding is that it's not supported at all at the moment. |
I see, how about taplo? I think I managed to get rust-analyzer to fire up, but now I get an error about taplo, and still it doesn't seem like r-a is giving any signs of life I added this to both my local settings.json, and the settings.json on the remote machine (both executables exist, are on path, and can be used by the current user, the locations are the same on both the remote and local machine): "lsp": {
"rust-analyzer": {
"binary": {
"path": "$HOME/.cargo/bin/rust-analyzer"
}
},
"taplo": {
"binary": {
"path": "/usr/local/bin/taplo"
}
}
}, |
Yeah, I did not get those two to show up in some cursory testing either :( Guess we'll just have to wait for SSH remoting to get fleshed out more. |
I got the new update and tried it, but now there's just no error at all, and LSP stuff still doesn't show up. I removed my custom configs too. The patch notes even explicitly mention pyright too. |
This should be fixed by v0.157 preview (for builtin languages - extensions are not yet supported). |
I tried:
And it seems that both won't work for Rust. 👀 |
@SteveLauC Are you using the new remoting? |
Hi, I just upgraded to the lastest version, are there any extra components I need to install or upgrade? |
As long as you're on v0.158.x or later it should just work |
Still not working for me sadly |
I upgraded zed stable to 0.158.2, and it does not work. Manually restarting the lsp from the cmd prompt does nothing, opening the lsp log gives me an empty file |
Just tried |
Extensions should hopefully land in 0.162, but it should already work for builtin languages. Which language server are you expecting to run, and is there anything in the Zed log ( |
Rust-analyzer
It simply says: failed to spawn the LSP process
|
Very odd. If you manually run If you have time, I'd love to debug this with you, can you send a time that works to [email protected] (I'm in US Mountain Time). |
A more robust solution would be to install rust-analyzer in your PATH on the server I think? Presumably you have rustup installed there already so you can do |
Thanks for figuring it out! I've fixed a couple of other bugs recently where we download directly in place which causes exactly this if your download is interrupted. Let me see if we can update the way we install language servers to not have this problem too. |
Actually, I did have RA installed via |
As of recent Zeds we should prefer the rust-analyzer you have in the path. That said, we found that (at least for the Zed team) the rust-analyzer installed by |
I've noticed the same, usually the error I get is something like
And it would seem that when the toolchain version of the project one tries to start So if Zed redownloads the whole rustup & rust toolchain, chances are it will either break the user's rust installation or get overwritten by the system rustup installation the next time the user runs a cargo command from outside Zed. (and on NixOS it of course won't work to begin with because the NixOS rustup is modified to patch the downloaded binaries on the fly so they work with the nix-provided glibc) Hence why I suggested that Zed should try going through the system rustup if that exists. |
Makes sense. I don't feel super comfortable messing with the global state (it seems easy to mess something up), but it might help on NixOS. |
I don't think there is that much global state to mess with in this case? Rustup's binary cache is user-specific and the only case where what is in the cache actually has any practical effect is if the user's default toolchain is an alias like "stable" or "beta". And in that case the next cargo invocation would update it anyway if I've understood the rustup wrapper's behavior correctly. For projects like Zed that have a |
Check for existing issues
Describe the bug / provide steps to reproduce it
So we know that zed can't download them on its own. That's okay. But can I download it manually or force zed (via an ssh terminal) to download it just like it would if it was being ran from that remote machine? I see that remote zed is just normal zed that feeds some information back to my local zed. And that means it should be generally capable of downloading language servers, right? Even if not, then maybe I can fully manually download the language server and put it in
$HOME/.local/share/zed/languages
?Environment
Zed: v0.155.2 (Zed)
OS: Linux Wayland ubuntu 24.04
Memory: 14.3 GiB
Architecture: x86_64
GPU: AMD Radeon Graphics (RADV GFX1103_R1) || radv || Mesa 24.0.9-0ubuntu0.1
If applicable, add mockups / screenshots to help explain present your vision of the feature
Footnote
In #5347, I've seen someone complain about not having their LSP run as fast on remote as it would on local, so going by that it seems that having an LSP on a remote machine is possible?
The text was updated successfully, but these errors were encountered: