Skip to content

πŸ› Doesn't seem to work with 2.0.0 yet #97

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

Open
1 of 3 tasks
radiosilence opened this issue Apr 9, 2025 · 11 comments
Open
1 of 3 tasks

πŸ› Doesn't seem to work with 2.0.0 yet #97

radiosilence opened this issue Apr 9, 2025 · 11 comments
Labels
bug confirmed Something isn't working

Comments

@radiosilence
Copy link

Zed version

Zed 0.180.4 – /Applications/Zed.app

Extension version

0.1.5

Biome version

2.0.0-beta

Operating system

  • Windows
  • macOS
  • Linux

Description

https://biomejs.dev/blog/biome-v2-0-beta/

Steps to reproduce

  1. Install biome 2.0.0 in project
  2. Things don't seem to work

Expected behavior

  1. It works as normal

Does this issue occur when using the CLI directly?

No

Link to a minimal reproduction

No response

@radiosilence radiosilence added the needs triage Issue needs to be triaged label Apr 9, 2025
@dyc3 dyc3 added the needs reproduction Requires a reproduction label Apr 9, 2025
Copy link

github-actions bot commented Apr 9, 2025

Hello @radiosilence, please provide a minimal reproduction. You can use one of the following options:

  • Provide a link to our playground, if it's applicable.
  • Provide a link to GitHub repository. To easily create a reproduction, you can use our interactive CLI via npm create @biomejs/biome-reproduction

Issues marked with S-Needs repro will be closed if they have no activity within 3 days.

@github-actions github-actions bot removed the needs triage Issue needs to be triaged label Apr 9, 2025
@radiosilence
Copy link
Author

radiosilence commented Apr 9, 2025

Hello @radiosilence, please provide a minimal reproduction. You can use one of the following options:

  • Provide a link to our playground, if it's applicable.
  • Provide a link to GitHub repository. To easily create a reproduction, you can use our interactive CLI via npm create @biomejs/biome-reproduction

Issues marked with S-Needs repro will be closed if they have no activity within 3 days.

@dyc3 I can't do this because it's a problem with the zed extension in zed which doesn't exist in the playground

@ematipico
Copy link
Member

@radiosilence

The automated message gives you two options. It's obvious that for your use case, you want to provide a repository, with zed settings included.

@radiosilence
Copy link
Author

radiosilence commented Apr 9, 2025

Ah ok I'll try to replicate when home. Is the expected behaviour that the current extension version will work with biome 2 beta?

@ematipico
Copy link
Member

Yeah it should work!

@radiosilence
Copy link
Author

@ematipico ematipico added needs triage Issue needs to be triaged and removed needs reproduction Requires a reproduction labels Apr 10, 2025
@Stanislav-Lapata
Copy link

Stanislav-Lapata commented Apr 11, 2025

I get this error

Language server error: biome

server shut down
-- stderr--
Error: `--config-path` is not expected in this context

some debug info

$ node_modules/@biomejs/biome/bin/biome --version
# Version: 2.0.0-beta.1

$ node_modules/@biomejs/biome/bin/biome lsp-proxy --config-path biome.json
# Error: --config-path is not expected in this context

edited

I think it has connection with caching
When I checked folder ~/Library/Application\ Support/Zed/extensions/work/biome/node_modules/@biomejs/cli-darwin-x64, I found package.json that contained

{
  "name": "@biomejs/cli-darwin-x64",
  "version": "1.9.4",
  "license": "MIT OR Apache-2.0",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/biomejs/biome.git",
    "directory": "packages/@biomejs/biome"
  },
  "engines": {
    "node": ">=14.21.3"
  },
  "homepage": "https://biomejs.dev",
  "os": [
    "darwin"
  ],
  "cpu": [
    "x64"
  ]
}

and biome

~/Library/Application\ Support/Zed/extensions/work/biome/node_modules/@biomejs/cli-darwin-x64/biome --version
# Version: 1.9.4

I removed them and and open zed with zed . command after that it works

Image

@ematipico
Copy link
Member

--config-path was removed in v2 in favour of workspace configurations, which means that you have to specify the configuration path in the Biome settings of your settings.json

{
	"lsp": {
		"biome": {
			"configuration_path": ""
		}
	}
}

@radiosilence
Copy link
Author

radiosilence commented Apr 11, 2025

My zed settings.json now has

  "lsp": {
    "biome": {
      "settings": {
        "require_config_file": true,
        "configuration_path": "./biome.json"
      }
    }
  }

And on my demo project, on opening getting:

Language server error: biome

server shut down
-- stderr--
Error: `--config-path` is not expected in this context

I've tried running:

rm -rf ~/Library/Application\ Support/Zed/extensions/work/biome/

Still get the error

@ematipico
Copy link
Member

ematipico commented Apr 11, 2025

Found the issue, however, debugging in Zed is awful. I'm keen to make a breaking change, and make 0.2.0 compatible only with the beta onward.

@ematipico ematipico added bug confirmed Something isn't working and removed needs triage Issue needs to be triaged labels Apr 11, 2025
@ematipico
Copy link
Member

ematipico commented Apr 15, 2025

The problem is caused by

biome-zed/src/biome.rs

Lines 127 to 130 in 90eff9b

zed::npm_package_installed_version(PACKAGE_NAME)
.ok()
.flatten()
.is_some_and(|version| version.starts_with("1."))

The value returned is always true, even though the reproduction doesn't use v1, and as result --config-path is always appended. I can't the debug the value returned by zed::npm_package_installed_version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug confirmed Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants