Skip to content
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

Extension broken in Zed 0.151.1 #44

Closed
shellheim opened this issue Sep 5, 2024 · 7 comments · Fixed by #45
Closed

Extension broken in Zed 0.151.1 #44

shellheim opened this issue Sep 5, 2024 · 7 comments · Fixed by #45

Comments

@shellheim
Copy link

My settings.json for biome

 // Biome
  "lsp": {
    "biome": {
      "settings": {
        "config_path": "~/Code/biome.json",
        "require_config_file": false
      }
    }
  },
  "formatter": {
    "language_server": {
      "name": "biome"
    }
  }

This extension used to work two versions before this, so maybe it's a zed thing? After installing the extension, it simply doesn't start. It works fine in neovim but nothing happens in zed buffers.

@luckydye
Copy link
Collaborator

luckydye commented Sep 5, 2024

Im actually not having any problems, but I see some werid behaviour too.
Like sometimes I get a "Error: biome binary not found", but the Server starts anyways. But it appears very inconsistently.

Can you provide more detailed replication steps? :)

@shellheim
Copy link
Author

Thanks for the reply. I decided to completely reinstall zed to see it's a quirk of zed and gets fixed. Here are the steps:

  1. Install zed
  2. Press Ctrl + Shift + X to go to the extensions tab and search for biome, click install.
  3. Press Ctrl + , to edit settings.json and add this :
 // biome
  "lsp": {
    "biome": {
      "settings": {
        "require_config_file": false
      }
    }
  },
  "formatter": {
    "language_server": {
      "name": "biome"
    }
  },
  "code_actions_on_format": {
    "source.fixAll.biome": true,
    "source.organizeImports.biome": true
  }

I am not using a biome.json because previously it would work on every js file without needing that in the root of the project, though I have it deep in my nvim config.

Now,

  1. Open a .js file with a known problem, like using forEach instead of a for...of loop.
    Now you should observe that biome doesn't start.

Same file using biome in :

Nvim Zed
nvim_lint zed_lint

@lcdss
Copy link

lcdss commented Sep 6, 2024

For me Biome extension is showing the linter errors but nothing I do can make it to fix those errors automatically. Running manually editor:format doesn't work either and it only fix the errors when I click on the flash icon at a line that has an error and select fix all auto-fixable issues or other specific rule action. I'm using the same settings as @shellheim.

@luckydye
Copy link
Collaborator

luckydye commented Sep 7, 2024

For me Biome extension is showing the linter errors but nothing I do can make it to fix those errors automatically. Running manually editor:format doesn't work either and it only fix the errors when I click on the flash icon at a line that has an error and select fix all auto-fixable issues or other specific rule action. I'm using the same settings as @shellheim.

The format command is not supposed to fix your lint errors. Linting and formatting are not seen as the same thing by biome. Tho I agree the "code_actions_on_format" stopped working some time ago. Which is likely a Zed issue.

@lcdss
Copy link

lcdss commented Sep 7, 2024

Just by updating the dependencies of this extension made it all work for me. One think I noticed is that after a lint fix (useSortedClasses) the text cursor moves to the start of the next line, which is a little strange and different from what happens on vscode, where the cursor keeps at the same position.

@Aleksion
Copy link

Aleksion commented Sep 9, 2024

I'm getting the biome warnings and errors, but formatting doesn't seem to work?

@luckydye
Copy link
Collaborator

luckydye commented Sep 9, 2024

I'm getting the biome warnings and errors, but formatting doesn't seem to work?

Open a new issue please, if you think something is wrong. :) Check https://github.com/biomejs/biome-zed?tab=readme-ov-file#configuration before though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants