vscode-erb-beautify icon indicating copy to clipboard operation
vscode-erb-beautify copied to clipboard

Speed up formatting

Open vfonic opened this issue 9 months ago • 2 comments

Thanks for the great extension!

I noticed that the formatting is quite slow and it's not practical to wait 3-5 seconds for the formatting to complete. I figured out that the majority of the time is spent on the start of htmlbeautifier command. The actual formatting is quite fast, after the booting is done.

In order to speed up the formatting, I modified the extension so that it always has an htmlbeautifier process started and waiting for input. When the format is called, the running htmlbeautifier process is passed the input and, after the output is returned and process exits, a new htmlbeautifier process is started.

vfonic avatar Oct 06 '23 15:10 vfonic