-
-
Notifications
You must be signed in to change notification settings - Fork 476
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
🐛 VS Code extension: Poor support for multi-folder workspaces #1630
Comments
Our LSP doesn't support workspaces yet. We have a task to implement and support them: #1573 |
Thank you for opening the issue, I had the same problem. |
Hi, for the time being, could you describe this limitation in https://biomejs.dev/reference/vscode/ (under "Troubleshooting")? I wasted an hour trying to get my Am I right that it's simply impossible to do this for now, and all I can do is set up isolated VSCode workspaces for each my Biome-enabled folder? |
Apologies, @smikitky, for the time you wasted. Would you like to send a PR yourself? |
@ematipico I made a PR, hope it helps. |
Hi @ematipico, Is the documentation added in #2297 still accurate after adding LSP support (#1573)? |
I am not really sure, to be honest. When I developed the feature, used the Workspace project feature inside VSCode and it worked really well. Is there a different way to set up workspaces in VSCode that I am not aware about? If so, then it makes sense to call it out. |
@ematipico as of today with biome v1.8.3 and biome-vscode v2.3.0:
Not sure what you mean by "worked really well", but yes, it works, just not with the configuration I'm expecting. |
Well, the second scenario isn't a LSP workspace, am I right? Nested configuration files aren't supported as you would expect. And it's a problem unrelated to the LSP workspaces. We might be able to solve these kinds of scenarios here: |
Next version (v3) of the VS Code extension will have support for multi-root workspaces. Independent LSP sessions will be created for every workspace folder, and the configuration file at the root of each workspace folder will be taken into account, respectively. |
Question: is it possible / would it be possible to configure folders for biome independently from the workspace's In our monorepo we don't want to list folders separately in the toplevel setting (because it clutters UI in a few places, and finding files by copypasting the full repo-relative path doesn't work, etc). // no highlights from biome extension
"folders": [{ "path": ".", "name": "our-project" }],
// now biome does highlight the errors, but we don't really want to set it for all 20+ workspaces
"folders": [
{ "path": "packages/foobar" },
// ... n more entries
{ "path": ".", "name": "our-project" },
], With eslint & jest plugins it is possible to configure folders separately, e.g. "settings": {
"jestrunner.changeDirectoryToWorkspaceRoot": false,
"jest.virtualFolders": [
{
"rootPath": "packages/foobar",
"name": "foobar tests",
},
// ...
],
// eslint plugin is even better as it allows to use patterns too
"eslint.workingDirectories": [
{ "pattern": "frontend/*", "changeProcessCWD": true },
{ "pattern": "packages/*", "changeProcessCWD": true },
], // edit: unless the answer above means that in the next vesion such a scenario would be supported out of the box? |
The next version supports multi root workspaces as well as monorepos within a single root workspace. It's currently available in the pre-release channel of the extension. Feel free to try it and don't hesitate to give feedback. |
Ah, good catch ! I'll see what we can do about that !
You can disable biome by default by setting Then to enable the extension only for the If the extension still fails to detect Biome, please open the |
I tried following those steps, but Biome still doesn't run and the
It would be helpful if it could log out the path where it's trying to search for the binary. I'm not sure why it can't find it. |
Could you set the log level to Command palette: Then paste the whole output here. |
Hmm, not much more info in
|
I'm also experiencing something similar with a multi folder workspace. If I run Now If I move the biome.json to the root of the project both the plugin and the command respect the config, as is expected. |
Thanks @nhedger! Is there some special config I need to apply? It seems to work same as I described above your answer:
➡️ ❌ no biome errors in editor
➡️ biome errors are visible in editor Note that the I've also tried to set various combinations of
➡️ ❌ no biome errors in editor For additional info, here's our repo structure:
|
Environment information
What happened?
I have several "Folders" in my VS Code "Workspace". Like this:
Some of those "Folders" are projects that use Biome, and some aren't. Biome's VS Code extension doesn't handle this very gracefully. There are several issues:
Bug 1: First "Folder" in the VS Code "Workspace" must be a Biome project for any others to work
If you order the "Folders" in your "Workspace" such that the top-most one doesn't have Biome installed, none of the files you open in the older "Folders" will run through Biome checks. It seems like the top-most "Folder" must be a Biome project for the Biome VS Code extension to do anything and will instead show this warning:
Bug 2: Biome runs on "Folders" that aren't Biome projects
The inverse of Bug 1 also exists, where if the top-most "Folder" is a Biome project, all other "Folders" will get checked by Biome, even if they don't have Biome installed or configured.
Bug 3: Duplicated problems
For every folder with Biome installed, the "Problems" tab shows duplicate Biome errors:
Note how each of those problems is the same problem on the same line & column. It's a duplicate.
Expected result
Expectations listed above in each bug
Code of Conduct
The text was updated successfully, but these errors were encountered: