biomejs / biome-zed

Biome extension for Zed
https://biomejs.dev
MIT License
169 stars 6 forks source link

Extension broken in Zed `0.151.1` #44

Closed shellheim closed 2 months ago

shellheim commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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 commented 2 months ago

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

luckydye commented 2 months ago

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.