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

🐛 editor.formatOnSave only works if set in language-specific configuration blocks #401

Closed
1 of 3 tasks
hood opened this issue Oct 16, 2024 · 1 comment
Closed
1 of 3 tasks
Labels

Comments

@hood
Copy link

hood commented Oct 16, 2024

VS Code version

1.95.0-insider

Extension version

v2024.10.131712 (pre-release)

Biome version

1.9.3

Operating system

  • Windows
  • macOS
  • Linux

Description

The following configuration, setting biome as a project-wide formatted, won’t work.

{
  "editor.formatOnSave": true,
  "editor.formatOnSaveMode": "file",
  "biome.enabled": true,
  "editor.defaultFormatter": "biomejs.biome"
}

If set on a per-language basis, Biome will actually start formatting files automatically.

(Example)

{
  "editor.formatOnSave": true,
  "editor.formatOnSaveMode": "file",
  "biome.enabled": true,
  "[typescriptreact]": {
    "editor.defaultFormatter": "biomejs.biome"
  },
  "[typescript]": {
    "editor.defaultFormatter": "biomejs.biome"
  },
}

Steps to reproduce

{
  "editor.formatOnSave": true,
  "editor.formatOnSaveMode": "file",
  "biome.enabled": true,
  "editor.defaultFormatter": "biomejs.biome"
}

Expected behavior

Should automatically format files when configured to do so.

Does this issue occur when using the CLI directly?

Not sure / Not applicable

Link to a minimal reproduction

No response

Logs

No response

@hood hood added the Triage label Oct 16, 2024
@ematipico
Copy link
Member

Unfortunately this isn't something we can fix. The formatting signal is sent by the client (VSCode).

Probably your environment has some settings that override the generic formatter.

I suggest looking at this PR #374, there's a tweet from Colin that explains a possible bug.

While your expectations are correct, we can only suggest possible workarounds

@ematipico ematipico closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants