-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
fix: only watch lock files in workspace root #91
Conversation
I'm wondering if instead we shouldn't just watch lockfiles in the root of the workspace folder. |
@nhedger but then there could be the risk that lockfiles in a multi-root vscode workspace - will not trigger a reload. just a mind of though because i personally work with multi-root workspaces. but im no expert in how vscode works |
At this time we do not support multiple workspace folders. We're hoping to add support soon though. That being said, nothing would prevent us from creating a watcher per workspace folder if we needed to. The reason I proposed this is because currently the extension will use biome from the dependencies declared at the root of your project anyway, so watching lock files deeper in the hierarchy is basically useless. |
I've tested the code, and unfortunately, it looks like VS Code's There is an open issue about it here: microsoft/vscode#169724 In the meantime, I think changing the glob pattern to only watch for lock files in the root of the workspace folder is the way to go. |
@nhedger the PR always fails because in our codebase the "source.organizeImports.biome" does not work like it is described in biome's docs - we need the additional "source.organizeImports" to be enabled too. {
"editor.codeActionsOnSave": {
"source.organizeImports": "explicit",
"source.organizeImports.biome": "explicit",
}
} With this codebase there is a race condition, so i have to disable the "source.organizeImports" rule and it works. But then our codebase stops working - do you maybe have any insights in why this is happening? |
Gotcha, would you mind filing an issue for this problem? |
// Best way to determine package updates. Will work for npm, yarn, pnpm and bun. (Might work for more files also). | ||
// It is not possible to listen node_modules, because it is usually gitignored. | ||
const watcher = workspace.createFileSystemWatcher( | ||
new RelativePattern(workspace.workspaceFolders[0], "*lock*"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated to a RelativePattern
, because otherwise the watcher won't work as expected. See microsoft/vscode#31602
Thanks for you contribution @ChiefORZ! |
Closes biomejs/biome#1601