madskristensen/JavaScriptPrettier

Feature Request: Execute on save

scottadamsmith opened this issue · 11 comments

Description

In some other editors (i.e. VS Code), Prettier can be configured to format on save. It would be great to have this functionality in Visual Studio as well.

I am not sure how feasible this is as it is likely largely dependent on the capabilities of a VS extensions. Can anyone provide any insight into the level of difficulty for something like this? I am happy to look into it myself and potentially in attempt a contribution for it if the effort is realistic.

Thanks!

This would be the perfection.

I’m all for it. If someone wants to help out with this feature it would be awesome. (You need to be able to turn it on and off)

I'm working on this right now, but it's proving difficult. The IVsRunningDocTableEvents3 is all Sync methods when all the current NodeProcess stuff is async.

I may have to make a sync version of the methods in there unless @madskristensen or @jesperbjensen have any better ideas.

Also need to figure out how to make it load at startup/opening of a solution

I figured out a hacked way. PR incoming

So this feature should be available in the CI build: http://vsixgallery.com/extension/J1da7ad9e-85b3-4a0c-8e45-b2ae59a575a7/

Thanks to @tommck for implementing the feature. 👍🎉

Do we have plans for a release any time soon? Just curious

@tommck, I can publish any time. Did you test the CI build @jesperbjensen linked to?

uhh.. .lemme try that now :)

Yep, it's working fine. You were OK with the hacked up way I did that, @madskristensen ?

Yes I am

Wait, don't publish this if you haven't already

UPDATE: Never mind.. local change issue :)

UPDATE 2: NOT a local change issue. Don't publish this. The extension crashes every time you save on a non-supported file type. I will fix that