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

Zed's formatting, assumed to be Prettier, doesn't respect ignore patterns #11115

Closed
1 task done
silvenon opened this issue Apr 28, 2024 · 1 comment · Fixed by #21297
Closed
1 task done

Zed's formatting, assumed to be Prettier, doesn't respect ignore patterns #11115

silvenon opened this issue Apr 28, 2024 · 1 comment · Fixed by #21297
Labels
bug [core label] prettier Prettier tooling support setting Feedback for preferences, configuration, etc tooling An umbrella label for language tools, linters, formatters, etc

Comments

@silvenon
Copy link

silvenon commented Apr 28, 2024

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Here is a minimal repro: https://github.com/silvenon/repro/tree/zed-prettier-ignroe

It has a local Zed config that enables formatting everywhere. The documentation leads me to believe that Prettier should be added as a separate formatting command, but based on the source code it's my understanding that Zed is using Prettier.

The linked example shows an ignored package.json via .prettierignore which Zed formats anyway. package.json shouldn't be formatted because package managers format it differently, so that's why I often like to ignore it in Prettier's ignore file.

What I previously did is something like this:

"format_on_save": {
  "external": {
    "command": "./node_modules/.bin/prettier",
    "arguments": [
      "--ignore-unknown",
      "--stdin-filepath",
      "{buffer_path}"
    ]
  }
}

which worked, but it would be nice if I can use Zed's own Prettier integration.

Environment

Zed: v0.132.3 (Zed)
OS: macOS 14.4.1
Memory: 16 GiB
Architecture: aarch64

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your ~/Library/Logs/Zed/Zed.log file to this issue.

No response

@silvenon silvenon added admin read bug [core label] labels Apr 28, 2024
@Moshyfawn Moshyfawn added setting Feedback for preferences, configuration, etc prettier Prettier tooling support tooling An umbrella label for language tools, linters, formatters, etc and removed triage labels Apr 29, 2024
@silvenon
Copy link
Author

Gah, this is driving me crazy 😅 Unfortunately it's not upvoted, but I hope it will be fixed some time soon… 🤞 In the meantime I forgot I have an escape hatch 😌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] prettier Prettier tooling support setting Feedback for preferences, configuration, etc tooling An umbrella label for language tools, linters, formatters, etc
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants