Open gustaferiksson opened 9 months ago
Can you share the output of biome rage --daemon-logs
?
Check the logs first, make sure there's no sensitive information you don't want to share.
Also, does that mean Biome works as expected when you don't do a live share of the project?
I will get back to you during the day with the logs
Yes biome works as expected when I don't have a liveshare active, it also seems to work when a liveshare is started and no one has joined yet.
@ematipico here is the logs
I was able to reproduce the issue.
When both you and the remote participant are connected to the live share session, the host saving the file does not apply the unsafe fixes, as expected. However, as soon as the guest participant saves the file, now both participants will trigger unsafe fixes when saving.
Terminating the liveshare session stops the issue from happening.
Comparing the trace output between a standard session and a liveshare session shows that liveshare session use context.triggerKind = 1
, while standard session use context.triggerKind = 2
. Not exactly sure what it means at this point, but I'll dig in.
From the LSP docs:
/**
* The reason why code actions were requested.
*
* @since 3.17.0
*/
export namespace [CodeActionTriggerKind](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeActionTriggerKind) {
/**
* Code actions were explicitly requested by the user or by an extension.
*/
export const Invoked: 1 = 1;
/**
* Code actions were requested automatically.
*
* This typically happens when current selection in a file changes, but can
* also be triggered when file content changes.
*/
export const Automatic: 2 = 2;
}
export type [CodeActionTriggerKind](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#codeActionTriggerKind) = 1 | 2;
It seems that biome applies unsafe fixes when working in virtual workspaces, at least when working inside liveshares.
Here is a reproducible example. https://github.com/gustaferiksson/biome-unsafe
If I start a liveshare in that repo and share it with myself (in a new vscode window), and save
index.ts
, biome will apply the unsafe fixes.My vscode settings has the following related to biome
Here is the Output from the Biome Trace that applies the unsafe fixes