fsouza / prettierd

prettier, as a daemon, for improved formatting speed.
ISC License
779 stars 21 forks source link

1488 #694

Open GooseOb opened 6 months ago

GooseOb commented 6 months ago

Worked fine until the moment when it started to produce in random places. On every save it adds �� to the same place (start of the 1488 line).

Using lazy.nvim with null-ls. Plugin is installed via Mason. FIle encoding is utf-8. Using cyrillic characters. Working on WSL2 Ubuntu. Isn't reproducing with prettier.

image

image

fsouza commented 5 months ago

Can you reproduce when running prettierd on the command line?

GooseOb commented 5 months ago

Yes cat src/dict/index.ts | prettierd src/dict/index.ts: image

I forgot to mention, this file is in .prettierignore. But excluding it from there does not help (formats, but produces ).

fsouza commented 5 months ago

can you run prettierd --debug-info src/dict/index.ts?

Also is that code open source? If so, can you link it? If not, can you share a snippet of it with the cyrillic characters? I'll try to repro

GooseOb commented 5 months ago

Yes, it's open source, here's the repo

GooseOb commented 5 months ago
$ prettierd --debug-info src/dict/index.ts

prettierd 0.25.2
prettier version: 3.1.1
  Loaded from: /home/gooseob/projects/taraskevizer/node_modules/prettier/index.cjs
jakubreron commented 5 months ago

It's the same situation for Japanese characters, can reproduce with prettierd, but cannot reproduce with prettier

fsouza commented 5 months ago

Thanks for the added details. Can you try the latest release?

jakubreron commented 5 months ago

Unfortunately, after upgrading to 0.25.3 the issue still exists for me :(

Prettier version in mason: image

Diff after running prettierd formatting image

fsouza commented 5 months ago

Thanks for confirming! I'll keep digging into it.

GooseOb commented 4 months ago

The bug seems similar to GooseOb/taraskevizer#5. So there might be a problem with node. I tried with bun and it works fine, so I opened nodejs/node#52944

GooseOb commented 4 months ago

Oh, I see you changed the implementation of get-stdin and I do not see the bug now. Seems like it helped

GooseOb commented 4 months ago

No, it didn't, I still get this characters :)

exzolink commented 3 weeks ago

Any fix?