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

Version 0.1.0 failed to locate biome language server #33

Closed
chungweileong94 opened this issue Jul 25, 2024 · 10 comments · Fixed by #34
Closed

Version 0.1.0 failed to locate biome language server #33

chungweileong94 opened this issue Jul 25, 2024 · 10 comments · Fixed by #34

Comments

@chungweileong94
Copy link
Contributor

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"]
    }
  }
}
@chungweileong94
Copy link
Contributor Author

So I installed biome via pnpm, and based on my understanding, biome will download the binary via postinstall script, which pnpm will put them under node_modules/.pnpm/@biomejs+biome@1.7.3/node_modules/@biomejs/cli-xxx-xxx. Which mean we have to do more than just node_modules/@biomejs/cli-xxx-xxx if we want to run it without Node.

@ematipico
Copy link
Member

pnpm creates a symbolic link though, so node_modules/@biomejs/cli-xxx-xxx is still valid. Just need to follow the symbolic link, correct?

@chungweileong94
Copy link
Contributor Author

pnpm creates a symbolic link though

Yes, but apparently pnpm don't create symlink in node_modules/@biomejs/cli-xxx-xxx🫤. I think pnpm won't includes any at the root of node_modules that is not directly consumed by the user (dependencies in package.json). Unless we configure the hoist pattern https://pnpm.io/npmrc#hoist-pattern

@luckydye
Copy link
Collaborator

Yeah... I guess we need to fallback to the node script.

@luckydye
Copy link
Collaborator

luckydye commented Jul 25, 2024

I'm trying to use oxc_resolver, but it just resolves to "/node_modules/@biomejs/cli-darwin-arm64/biome" :/ which is wrong.
(https://github.com/biomejs/biome-zed/tree/fix/resolve-binary)

@ematipico
Copy link
Member

I believe we need to do it ourselves, I think. Check if the binary is a symbolic link and follow it

@luckydye
Copy link
Collaborator

luckydye commented Jul 25, 2024

So the node_modules look like this:

image

"optionalDependencies" are not linked directly under node_modules, which means we don't really have a link to follow.. :/

@ematipico
Copy link
Member

Ah, what a bummer :/

@nhedger
Copy link
Member

nhedger commented Jul 25, 2024

For the VS Code extension, I had to resolve the cli packages in the context of the @biomejs/biome packages. I wonder if it's possible with oxc_resolver.

https://github.com/biomejs/biome-vscode/blob/45a46c4414e1a4b396c0fa427319a041c1701358/src/main.ts#L436-L466

@chungweileong94
Copy link
Contributor Author

I checked the VSCode extension, it reminds me of yarn pnp, which I think this extension doesn't work OOB, but I think that can be fixed separately.

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