Allow formatting unsaved files
See original GitHub issueWould it be possible to allow formatting code that hasn’t been saved to a file yet?
I’m using JSON Reindent in Sublime to for example quickly open a new file, paste in a bunch of JSON, and format it to make it easier to read. Would be great if I could use JsPrettier for this instead, especially since it supports other stuff as well, like HTML.
I get the “JsPrettier: Format Code” option in the command palette, but I’m prompted with “File must be Saved.” Could that requirement be avoided somehow? Do it in memory somehow? Or if a file is needed to pass to the prettier
executable, could JsPrettier for example use a tmp file behind the scenes or something?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How can I format documents that are not saved in visual studio ...
If i Shift + Alt + F (or use the command from the palette) on a Untitled tab on vscode the following command...
Read more >Windows unsaved files - Microsoft Q&A
Try File > Open > Recover Unsaved Documents. Note that automatic saves are only supported with OneDrive. Comment. Comment
Read more >How to recover an unsaved file in Word using ... - YouTube
Lots of panic attacks at work or school are caused by unsaved Word files. So, in this video, we are going to learn...
Read more >How to Recover Unsaved Excel Files [All Options + Precautions]
Enable AutoSave and AutoRecover · Click the 'File' tab · Click on 'Options' · In the Excel Options dialog box, click on Save...
Read more >How do I format all files in a Visual Studio Code project?
Select and open the folder with files to format on VSCode. Press Ctrl+Shift+P to open command palette.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I would use this often to format a snippet of code (instead of going to https://prettier.io/ and posting it there)
Hi @Svish. Great suggestion, but implementing such a feature now would take quite a bit of effort to re-work parser detect/set logic - and this is first time such a request has come up.
However, if more people show interest… we can definitely re-visit the topic.