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

Extension ignoring biome.json #12

Open
lcsvcn opened this issue Apr 26, 2024 · 5 comments
Open

Extension ignoring biome.json #12

lcsvcn opened this issue Apr 26, 2024 · 5 comments

Comments

@lcsvcn
Copy link

lcsvcn commented Apr 26, 2024

Issue: Biome Extension Overwrites Custom Formatting with Default Biome Formatting

Description:
When running npx @biomejs/biome format --write src to format biome files, the operation completes successfully and applies the custom formatting as expected. However, when utilizing the biome extension, it overrides the custom formatting with the default biome formatting.

Steps to Reproduce:

Run npx @biomejs/biome format --write src to format biome files with custom formatting.
Confirm that the custom formatting is applied correctly.
Enable the biome extension in the project.
Trigger biome formatting via the extension.
Expected Behavior:
The biome extension should respect and maintain the custom formatting applied to biome files when formatting them. It should not overwrite custom formatting with default biome formatting.

Actual Behavior:
Despite successful custom formatting using the CLI command, the biome extension disregards the custom formatting and applies default biome formatting when triggered.

Impact:
This issue disrupts the workflow of users who rely on custom formatting for biome files. It leads to inconsistencies and frustration as the extension overrides user preferences without regard for existing formatting choices.

Proposed Solution:
Update the biome extension to preserve custom formatting when formatting biome files. Ensure that the extension respects the formatting applied via CLI commands and does not overwrite it with default biome formatting.

Additional Information:

Extension Version: 0.0.6
Operating System: Mac OS 14.4.1

This issue significantly affects the usability and effectiveness of the biome extension for users who rely on consistent formatting practices. Prompt resolution or guidance on how to preserve custom formatting would be greatly appreciated.

@luckydye
Copy link
Collaborator

What are your zed settings for formatting? This default you are referring to might be the default prettier settings applied by builtin zed prettier.

@Marcisbee
Copy link

Marcisbee commented Apr 29, 2024

I have exactly the same issue with this. Either conflicting with default formatter or doesn't seem to respect biome.json config.

I have a public repo that has this issue for reproduction: https://github.com/Marcisbee/exome-devtools

In zed global settings file I have this:

{
  // ...
  "show_copilot_suggestions": false,
  "code_actions_on_format": {
    "source.fixAll": true,
    "source.organizeImports.biome": true
  },
  "formatter": "language_server"
}

Versions:

  • Zed 0.132.3 (3518c939cbcde8f729a146e4dc7de9001a57e593)
  • Extension 0.0.6
  • Biome 1.7.1

@luckydye
Copy link
Collaborator

The formatting over LSP is currently broken, see #5 for status.

Does this issue also apply to the diagnostic output in the editor?

@chungweileong94
Copy link
Contributor

Instead of using the LSP as formatter, you could do custom formatted for now.

"formatter": {
    "external": {
      "command": "./node_modules/@biomejs/biome/bin/biome",
      "arguments": ["format", "--write", "--stdin-file-path", "{buffer_path}"]
    }
}

As far as I know, prettier LSP is being treated differently, meaning it won't enable unless you have a prettier setup in the codebase.

@sporto
Copy link

sporto commented May 17, 2024

Does this issue also apply to the diagnostic output in the editor?

Yes, I have a biome.js in the project with linting rules set to warn or off.
In the cli they don't produce errors.
But in zed I see error squiggly lines all over.

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

No branches or pull requests

5 participants