zed icon indicating copy to clipboard operation
zed copied to clipboard

[macOS host + Linux remote] Restoring a remote session doesn't load project-local language server init options properly

Open dljsjr opened this issue 9 months ago • 1 comments

Summary

When Zed is quit with a remote session and then re-launched, it brings up the remote session and language server but seemingly doesn't respect project-local configs that impact the language server behavior.

Description

I've noticed this with both Rust Analyzer, and Lua Language Server. With RA, it doesn't respect my settings in rust-analyzer.initialization_options. In particular, I have analyzerTargetDir set here to be different than the workspace target so that Zed and my CLI don't share the same package lock.

When I quit Zed with the window for the project still open, the next time I launch Zed, it's using <project root>/target instead of the directory I specified the project-local .zed directory. The only way to get it unstuck is:

  1. Close the project but don't completely quit Zed (this implies macOS),
  2. Kill the zed proxy/server on the remote
  3. Open the project from the project selector

With Lua Language Server, it doesn't respect the .luarc.json in the project root. I have to take the same steps to resolve it.

Steps to reproduce:

  1. Set the config "restore_on_startup": "last_session"
  2. Open a remote project
  3. Set a project-local LSP option in the remote project root's .zed directory
  4. Quit Zed without exiting the session
  5. Re-launch Zed

Expected Behavior: Configs should be respected no matter how the project is launched Actual Behavior: Project-local configs are seemingly ignored in this configuration

Zed Version and System Specs

Zed: v0.184.9 (Zed) OS: macOS 15.3.1 Memory: 32 GiB Architecture: x86_64

dljsjr avatar May 02 '25 18:05 dljsjr

Ah! Thank you for looking into it! It was driving me mad!

steeve avatar May 11 '25 21:05 steeve

FYI, i fixed it by adding an empty .editorconfig file at the root of my project and then it just worked

steeve avatar Jun 07 '25 21:06 steeve

It seems I also have to edit/save the .zed/settings.json and it works again

steeve avatar Jul 30 '25 14:07 steeve

What is super weird is that it works sometimes

steeve avatar Sep 18 '25 20:09 steeve

Actually, just saving the remote .zed/settings.json fixes it right away without restart

steeve avatar Sep 18 '25 20:09 steeve

Hi there! 👋 We're working to clean up our issue tracker by closing older bugs that might not be relevant anymore. If you are able to reproduce this issue in the latest version of Zed, please let us know by commenting on this issue, and it will be kept open. If you can't reproduce it, feel free to close the issue yourself. Otherwise, it will close automatically in 14 days. Thanks for your help!

github-actions[bot] avatar Nov 19 '25 11:11 github-actions[bot]

This was enough friction that I had switched back to other IDEs for remote dev for a while, but with the bot's stale prompt, I investigated and this seems resolved. Thanks!

dljsjr avatar Nov 25 '25 16:11 dljsjr