jonlabelle/SublimeJsPrettier

Sublime freezes whan I try to format large css file.

maxonik opened this issue · 4 comments

Please try to format this file http://silentcode.org/bitrix/cache/css/s1/main/template_6fb3afcdea0e0b842910d8990e319c2a/template_6fb3afcdea0e0b842910d8990e319c2a.css?148381411788539 and see what happen.
My Sublime freezes
Its ok if I format online here https://prettier.io/playground/
And works fine in Visual studio code

thanks for help!

I actually noticed this also, freezing of minified (one line files) and or larger files. However, when I ran the same file(s) directly against prettier, same result... nodejs just churned and churned as it did in ST.

I think i tracked it down to cursor offset getting hung up somewhere - not being able to calculate the proper position.

May @kaste can take a look and see if he can reproduce (ala PR #120); and we send it off to Prettier as defect to investigate.

kaste commented

So the use case here is basically to unuglify built files?

For Sublime, reading or setting the cursor is no problem. Only writing to the Sublime built-in console is super slow and it will in fact freeze Sublime if you for example log file contents or larger diffs to it. So you always have to make sure no debugging logger is attached to the console. (E.g. you have noticable delays even for moderately small files if you run SublimeLinter in debug mode.)

However, if you already managed to reproduce it on the cli then it's seems of course to be a bug on prettier's side.

It's definitely not an issue with Sublime Text (or the JsPrettier plug-in).

I've attached a small demo which reproduces the issue from the CLI. Assuming you're on macOS or Linux; download and extract the zip... then run bash prettier-cli.sh.

lock commented

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.