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
49.76k stars 3.06k forks source link

Biome/code actions freezing #10786

Open showme032 opened 6 months ago

showme032 commented 6 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Sometimes after Biome has made a styling/formatting suggestion, it freezes completely, and code actions become unresponsive, even after the suggestion is fixed. Restarting the editor fixes the issue until the next occurrence.

Environment

Zed: v0.132.0 (Zed Preview) OS: macOS 14.4.1 Memory: 16 GiB Architecture: aarch64

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

https://github.com/zed-industries/zed/assets/8236625/62a6bc6e-f037-454a-856e-3efc72a4435a

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

log.log

JosephTLyons commented 6 months ago

I'm wondering if this has anything to do with multiple language servers running at once. cc @maxbrunsfeld?

showme032 commented 6 months ago

I thought that might be one of the reasons, but if I understand correctly, atm, eslint can't be disabled?

maxdeviant commented 6 months ago

I thought that might be one of the reasons, but if I understand correctly, atm, eslint can't be disabled?

@showme032 If you're comfortable building Zed from source, you could try commenting out these lines:

https://github.com/zed-industries/zed/blob/2ee257a5621d3c2714945e117d958383c14ae513/crates/languages/src/lib.rs#L196-L246

That will disable the built-in TypeScript and ESLint support.

Then run a debug build of Zed using the Biome extension to see if the that addresses the issue.

showme032 commented 6 months ago

Thanks for the reply. I'll give it a go and try it out, once I get some time in the following days.

maxdeviant commented 6 months ago

Thanks for the reply. I'll give it a go and try it out, once I get some time in the following days.

In the current Zed Preview (v0.133.2) you can try disabling the built-in ESLint language server to see if that fixes the problem.

Add this to your settings and then restart the language servers (or restart Zed entirely, to be on the safe side):

{
  "languages": {
      "JavaScript": {
        "language_servers": ["biome", "!eslint", "..."]
      }
    }
}
chungweileong94 commented 6 months ago

Thanks for the reply. I'll give it a go and try it out, once I get some time in the following days.

In the current Zed Preview (v0.133.2) you can try disabling the built-in ESLint language server to see if that fixes the problem.

Add this to your settings and then restart the language servers (or restart Zed entirely, to be on the safe side):

{
  "languages": {
      "JavaScript": {
        "language_servers": ["biome", "!eslint", "..."]
      }
    }
}

For some reason, the eslint LSP always running even with the settings. image

[Update] My bad, I forgot about the TSX language.

chungweileong94 commented 6 months ago

After coding without eslint enabled for a while, and this is what I found:

Unfortunately, I wasn't able to capture log at the time. Will do so next time.

christian-gama commented 6 months ago

With Biome extension enabled, my code actions freezes too. The only way to make it work again is by restarting the whole IDE. I couldn't figure it out what triggers the freezing, but I noticed it freezes in a short period of time after initializing the IDE. Disabling the extension avoid the code actions of freezing.

Here is what I have in my settings.json for TypeScript.

{
  "language_overrides": {
    "TypeScript": {
      "language_servers": ["biome", "!eslint", "!prettier", "..."],
      "formatter": {
        "external": {
          "command": "./node_modules/.bin/biome",
          "arguments": ["check", "--apply-unsafe", "--stdin-file-path={buffer_path}"]
        }
      }
    }
  }
}
chungweileong94 commented 6 months ago

I recorded a screen recording a while ago that showcases how to reproduce the problem, and I figure it will be easy to reference it here, https://github.com/biomejs/biome-zed/issues/14#issuecomment-2094061529.

Basically, I can consistently reproduce the problem by performing "Go to definitions" multiple times, and at some point, Zed will start to malfunction, like code formatting/code action stop working.

kevinfaveri commented 5 months ago

Hey guys, any news on this? TS/JS development seems to happen a lot, so not only Biome seems affected... Really a dealbreaker to migrate off to Zed

cmjoseph07 commented 4 months ago

Agreed with @kevinfaveri, deal breaker to migrate over. Should be something that is higher priority due to number of TS/JS devs currently.

luckydye commented 4 months ago

This may already be fixed, have u tried the latest preview builds? At least I am not seeing this anymore..

chungweileong94 commented 4 months ago

This may already be fixed, have u tried the latest preview builds? At least I am not seeing this anymore..

I got the same conclusion, haven't seen it for the past few months.

cmjoseph07 commented 4 months ago

@luckydye

Seems to be corrected on latest, thanks for letting me know!