zed-industries / zed

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
https://zed.dev
Other
47.29k stars 2.74k forks source link

Prettier not honoring plugins #8841

Closed affanshahid closed 6 months ago

affanshahid commented 6 months ago

Check for existing issues

Describe the bug / provide steps to reproduce it

Using Zed with a project that uses Prettier with some plugins. It seems to ignore the plugins when formatting files. The prettier config:

{
  "singleQuote": true,
  "trailingComma": "all",
  "plugins": ["prettier-plugin-organize-imports"]
}

Prettier LSP logs:

stderr: Resolved config: {"singleQuote":true,"trailingComma":"all","plugins":["prettier-plugin-organize-imports"]}, will format file '/Users/affan/Development/fhs-website/app/(portal)/resident/payments/page.tsx' with options: {"singleQuote":true,"trailingComma":"all","plugins":[],"parser":"typescript","path":"/Users/affan/Development/fhs-website/app/(portal)/resident/payments/page.tsx"}
stderr: Resolved config: {"singleQuote":true,"trailingComma":"all","plugins":["prettier-plugin-organize-imports"]}, will format file '/Users/affan/Development/fhs-website/app/(portal)/resident/payments/page.tsx' with options: {"singleQuote":true,"trailingComma":"all","plugins":[],"parser":"typescript","path":"/Users/affan/Development/fhs-website/app/(portal)/resident/payments/page.tsx"}
stderr: Resolved config: {"singleQuote":true,"trailingComma":"all","plugins":["prettier-plugin-organize-imports"]}, will format file '/Users/affan/Development/fhs-website/app/(portal)/resident/payments/page.tsx' with options: {"singleQuote":true,"trailingComma":"all","plugins":[],"parser":"typescript","path":"/Users/affan/Development/fhs-website/app/(portal)/resident/payments/page.tsx"}

Environment

Zed: v0.125.1 (Zed Preview) OS: macOS 14.2.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.

If you only need the most recent lines, you can run the zed: open log command palette action to see the last 1000.

Zed.log

mrnugget commented 6 months ago

I'm 99% sure this was fixed by https://github.com/zed-industries/zed/commit/9c6a0d98eda255ec934cff1855f5ad1353eb0c86 which ended up in 0.126.0. Can you try that version and see if the problem still shows up?

timcole commented 6 months ago

Hey @mrnugget, I'm on Zed Preview 0.126.1 and @trivago/prettier-plugin-sort-imports plugin still doesn't work.

stderr: Resolved config: {"semi":true,"trailingComma":"all","singleQuote":true,"printWidth":80,"tabWidth":2,"importOrder":["^@type/(.*)$","^@generated/(.*)$","^@lib/(.*)$","^react-use/(.*)$","^@hooks/(.*)$","^@components/(.*)$","^@email/(.*)$","^@(server|trpc)/(.*)$","^[./]","^simple-icons$","^@/icons/(.*)$"],"importOrderSeparation":true,"plugins":["@trivago/prettier-plugin-sort-imports"]}, will format file '/Users/tim/projects/socialblade/socialblade.com/server/routers/admin/index.ts' with options: {"semi":true,"trailingComma":"all","singleQuote":true,"printWidth":80,"tabWidth":2,"importOrder":["^@type/(.*)$","^@generated/(.*)$","^@lib/(.*)$","^react-use/(.*)$","^@hooks/(.*)$","^@components/(.*)$","^@email/(.*)$","^@(server|trpc)/(.*)$","^[./]","^simple-icons$","^@/icons/(.*)$"],"importOrderSeparation":true,"plugins":[],"parser":"typescript","path":"/Users/tim/projects/socialblade/socialblade.com/server/routers/admin/index.ts"}
RemcoSmitsDev commented 6 months ago

@timcole I have created a pull request to fix this issue, so sit tight😀.

mrnugget commented 6 months ago

This was fixed by #9193 which will go out in the next preview.