zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
39.47k stars 2.06k forks source link

Zed keeps checking for LSP updates (and disabling LSPs irreversibly in the process), Even when offline, And this is really hurting my UX. #9789

Open MinecraftPublisher opened 3 months ago

MinecraftPublisher commented 3 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Title. Sometimes when restarting zed or opening it after a fresh boot, It starts to check for updates for the LSP of ANY file I open, Has no timeout duration and keeps re-checking for updates, All the while the LSP DOES NOT WORK. Seriously, This is extremely frustrating. PLEASE fix this.

Note: This is not related to auto-update as that is also set to FALSE in my config.

Environment

Zed: v0.127.3 (Zed) OS: macOS 13.6.0 Memory: 16 GiB Architecture: x86_64

If applicable, add mockups / screenshots to help explain present your vision of the feature

  1. Check for internet connectivity (ping google.com, or any other website)
  2. If failed, Quit and use the already existing LSP
  3. If succeeded, Download the new LSP.

Or, Easier solution, DO NOT DISABLE THE LSP WHILST CHECKING FOR OR INSTALLING UPDATES. Seriously.

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

jansol commented 3 months ago

Or even better just do not auto-update LSPs on every launch. (Or preferrably at all)

MinecraftPublisher commented 3 months ago

That works too :P

JosephTLyons commented 3 months ago

@MinecraftPublisher - I recently added code that would perform auto-updates on language servers that we obtain through npm, as prior to this, we never updated the language server after the initial install. Not all of our languages are installed via npm, some are through GitHub. Which languages are you running into this on? Just trying to see if this is related to my change or not. We also have had tons of reports in the past of language servers getting stuck in the checking for updates status and never resolving - Im curious which thing this issue might relate to.

JosephTLyons commented 3 months ago
MinecraftPublisher commented 3 months ago

The problem isn't never resolving, It actually works fine with proper internet connection, But the problem arises when I don't have an internet connection, And the code doesn't check for internet connectivity and retries infinitely, Effectively disabling the LSPs for everything until I am back online.

0x2CA commented 3 months ago

Whether or not it should show tasks in progress, including progress cancellations, so that cancellations are allowed when checking for updates.

Similar to android studio image

osiewicz commented 3 months ago

Oddly enough, this does not happen with Rust. We do not go into this endless update loop with Rust files.

MinecraftPublisher commented 3 months ago

could this be because zed uses tree sitter alone for rust? i haven't read the source code so i have no idea, just a wild guess.

jansol commented 3 months ago

Rust-analyzer is used for Rust. Tree-sitter is used for syntax highlighting of all languages.

osiewicz commented 3 months ago

Yeah, tree-sitter has nothing to do with it. All I'm saying is that it might be an issue with our integration with specific language servers, as RA does not have that issue.

MinecraftPublisher commented 3 months ago

Any update on this? I don't think it takes that long to add an "auto_update_lsp" option to the config system

fotonick commented 2 months ago

I came to report the same or related issue for pyright. When offline, on startup, Zed will take something like a minute checking for updates to pyright before timing out with "Auto update failed", then activating the existing version of pyright. During the update check attempt, I get no code analysis.

Version: Zed 0.130.7 e2dbfa7de527500463772167a4736fc48cfbcebd

MinecraftPublisher commented 2 months ago

For me it just doesn't stop, And infinitely checks for updates.

paulmillr commented 1 month ago

To clarify, this can be easily reproduced if network is offline.

yuqiang-yuan commented 3 weeks ago

I'm facing the same situation. If Zed discovers that there is a new version of rust-analyzer, it deletes my local file and tries to download the new version from GitHub. However, the GitHub rate limit is reached, so no file is downloaded. As a result, rust-analyzer is missing.

whereistejas commented 2 weeks ago

A temporary solution to this problem is to copy the rust-analyzer binary from .cargo/bin into the ~/Library/Application Support/languages/rust-analyzer/ folder.

MinecraftPublisher commented 1 week ago

But only for rust. What about other languages?