Code Monkey home page Code Monkey logo

biome-zed's People

Contributors

chungweileong94 avatar ematipico avatar luckydye avatar maxdeviant avatar nhedger avatar tyleralbee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

biome-zed's Issues

Extension runs in every project?

Thanks su much for building an extension for Biome โค๏ธ That's really awesome of you, both Biome and Zed are so new, I didn't expect an extension would even exist!

One thing I noticed is that I'm getting Biome annotations in projects that don't use Biome, I didn't even know Biome can run without a config file.

I don't know Rust, but ChatGPT tells me that the extension script installs Biome if one isn't found in the depenedencies? Can we configure the extension to only run if the configuration file is found, or/and only if the extension exists in the dependencies?

Thanks!

Disable Biome LSP if `biome.json` or `@biomejs/biome` package is not found.

Currently, if a project doesn't have a biome.json or does have a @biomejs/biome package installed, the extension will download a separate biome binary instead. However, it's not friendly for projects that are yet to migrate to the biome.

It would be good if the biome LSP enable when either biome.json or @biomejs/biome is found (or maybe both).

Does not work well with TSX files

Not sure if this is a Zed language server bug, All the TSX files in the project don't seem to work properly. I ran biome check ., it's all good.

image

Can't get Biome to organize imports on save

These are my current language settings but I've tried a bunch of variations:

  "languages": {
    "TypeScript": {
      "language_servers": [
        "!typescript-language-server",
        "!eslint",
        "vtsls",
        "biome"
      ],
      "preferred_line_length": 88,
      "wrap_guides": [88],
      "format_on_save": "on",
      "formatter": {
        "language_server": {
          "name": "biome"
        }
      },
      "code_actions_on_format": {
        "source.fixAll.biome": true,
        "source.organizeImports.biome": true
      }
    }
  }

I've tried on Zed Preview 0.146.1 and also Zed 0.145.1.

I can trigger the code action inside the editor so I believe the LSP is set up properly:
CleanShot 2024-07-29 at 21 59 38

Also formatting seems to work. Any suggestions would be appreciated.

File-specific biome.json file

I'm not sure if this is an extension or Zed issue, but we'd like the errors for a given file to only show the relevant errors of the nearest biome.json file.

We have the following file structure:
๐Ÿ“‚ biome.json
โžก๏ธ ๐Ÿ“‚ API biome.json (extends parent - allows import type because NestJS)
โžก๏ธ ๐Ÿ“‚ client biome.json (extends parent - requires import type)

Currently, it seems like the errors shown for a given file only show based upon the setting of the parent biome.js. I'd prefer not to open up the API and client folders in different instances of Zed if at all possible. Thanks!

Add CSS language support

The upcoming version of Biome (1.8) will introduce support for CSS.

We should prepare a PR to add support for the CSS language to the extension

Extension ignoring biome.json

Issue: Biome Extension Overwrites Custom Formatting with Default Biome Formatting

Description:
When running npx @biomejs/biome format --write src to format biome files, the operation completes successfully and applies the custom formatting as expected. However, when utilizing the biome extension, it overrides the custom formatting with the default biome formatting.

Steps to Reproduce:

Run npx @biomejs/biome format --write src to format biome files with custom formatting.
Confirm that the custom formatting is applied correctly.
Enable the biome extension in the project.
Trigger biome formatting via the extension.
Expected Behavior:
The biome extension should respect and maintain the custom formatting applied to biome files when formatting them. It should not overwrite custom formatting with default biome formatting.

Actual Behavior:
Despite successful custom formatting using the CLI command, the biome extension disregards the custom formatting and applies default biome formatting when triggered.

Impact:
This issue disrupts the workflow of users who rely on custom formatting for biome files. It leads to inconsistencies and frustration as the extension overrides user preferences without regard for existing formatting choices.

Proposed Solution:
Update the biome extension to preserve custom formatting when formatting biome files. Ensure that the extension respects the formatting applied via CLI commands and does not overwrite it with default biome formatting.

Additional Information:

Extension Version: 0.0.6
Operating System: Mac OS 14.4.1

This issue significantly affects the usability and effectiveness of the biome extension for users who rely on consistent formatting practices. Prompt resolution or guidance on how to preserve custom formatting would be greatly appreciated.

Ranking Biome vs. ESLint

Is there any configuration needed to make sure Zed is prefering Biome over native ESLint?

When I install the extension (v0.0.2) in Zed Preview (v0.131.4), it creates a different formatting output in JS files vs. the Biome CLI. It seems like it is doing something when saving (adjusting spaces or so), but that seems to be more the output from ESLint or some other language server.
Actually running bunx biome format index.js --write however reformats the whole file (replaces spaces with tabs, which also seems to be the default) - which would be the intended way.

Is there any other way to debug or improve this?

This is in settings.json:

"format_on_save": "on",
"code_actions_on_format": {
    "source.fixAll": true,
    "source.organizeImports.biome": true
},
"formatter": "language_server"

Adding a biome.json with some arbitrary values like formatter.indentWidth: 16 also shows that it doesn't get picked up, while the CLI replaces that.

Format on save doesn't work

biome.json

{
  "$schema": "https://biomejs.dev/schemas/1.7.1/schema.json",
  "formatter": {
    "enabled": true,
    "formatWithErrors": false,
    "indentStyle": "space",
    "indentWidth": 2,
    "lineEnding": "lf",
    "lineWidth": 80,
    "attributePosition": "auto"
  },
	"javascript": {
		"formatter": {
      "enabled": true,
			"quoteStyle": "single"
		}
	},
  "organizeImports": { "enabled": true },
  "linter": {
    "enabled": true,
    "rules": { "recommended": true }
  }
}

package.json script for formatting: "format": "biome format --write \"src/**/*.ts\" \"test/**/*.ts\"",

zed settings.json

{
  "format_on_save": "on",
  "code_actions_on_format": {
    "source.fixAll": true,
    "source.organizeImports.biome": true
  },
  "formatter": "language_server"
}

When I'm trying to save any file, biome doesn't format it. But I see that biome is work, because in vscode it works fine.

json language conflict with jsonc

So zed has no specific language for .jsonc files, all json files are interpreted as jsonc under "JSON".
Now that the biome extensions uses "json" to interpret json files, we get this stuff:

image

We should probably use jsonc for all json files. Though not sure who is right here.

Version 0.1.0 failed to locate biome language server

In version 0.1.0, the extension doesn't able to locate the biome language server, which likely due to this change be0e886.

My current workaround is to customize the lsp binary in settings

"lsp": {
  "biome": {
    "binary": {
      "path": "node_modules/@biomejs/biome/bin/biome",
      "arguments": ["lsp-proxy"]
    }
  }
}

Formatting inconsistencies

There still are differences in formatting in zed vs cli after updating to 0.146.3. I am not sure if this is zed issue or biome issue.

Here's a simple reproduction for this: https://github.com/Marcisbee/zed-biome-reproduction-1

Have I configured something wrong or is there a bug somewhere?


Also can try adding this to index.ts file:

const something
  = 123;

Cli says it's an error, but running formatter from zed, does nothing with this.

Biome: 1.8.3
Zed: 0.146.3 (also happens in Zed Preview 0.147.0)

settings.json

{
  ...
  "lsp": {
    "biome": {
      "settings": {
        "require_config_file": true,
        "config_path": "<path>/biome.json"
      }
    }
  },
  "formatter": {
    "language_server": {
      "name": "biome"
    }
  },
  "code_actions_on_format": {
    "source.organizeImports.biome": true,
    "source.fixAll.biome": true
  }
}

Biome making code actions freeze

I did not figure it out what is triggering this bug, but the code actions is simply not showing up after a random period of time after the IDE is open. Most of the times this bug happens within a minute or two after the IDE is open. The only way to make code actions work again is by restarting the IDE or disabling the Biome extension.

By freezing I mean that when I press cmd + . to trigger the code actions menu, nothing happens.

Typescript auto completion doesn't work if Biome is running

I have a mid-sized TypeScript project where I've recently switched from ESLint/Prettier to Biome. After installing this extension, I have the following issues:

  • Open project in Zed
  • Open an arbitrary TSX file
  • Zed does not show Biome errors or warnings, but TypeScript auto-completion works fine
  • Open Zed's commando palette and run "restart language server"
  • Biomes errors and warnings are now visible, but TypeScript auto-completion doesn't work anymore

Any ideas how to fix this? :-)

support setting `config-path` in zed settings

i'd like to configure the command line --config-path arg via my settings json as I commonly work in a monorepo that has a single node package within a larger project <root>/js (or similar). So i'd like to configure my <root>/.zed/settings.json to always point to <root>/js/biome.json instead of having to open zed with js as the root.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.