You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We try to keep VS Code lean and we think the functionality you're asking for is great for a VS Code extension. Maybe you can already find one that suits you in the VS Code Marketplace. Just in case, in a few simple steps you can get started writing your own extension. See also our issue reporting guidelines.
That would be a great idea, but without access to all the installed format providers, there is no way to actually do this. The only method that works is to create a new document, set its format, format document, and copy that text back to the originating document (or apply TextEdits to selection). That creates a very poor user experience.
I wrote an extension to do this for myself, and it really is ugly. I'll gladly share the code if you want to see for yourself @jrieken .
Ideally, vscode.executeFormatRangeProvider would include as an option which format provider to use. Of course, without being able to get a list of the format providers, that isn't very helpful. So, without some basic programmatic API help here, there is no way to elegantly make an extensions to do this.
Also, making use of Language Server Protocol isn't really an option either as it would require anticipating all the languages one would want to format.
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
What I really want to do is just select that code, choose "Format Selection With..." and choose Prettier and let it format the JavaScript.
The text was updated successfully, but these errors were encountered: