Is there a "Format Selection As ..." command?
See original GitHub issueI spend a lot of time writing Markdown with lots of JSON examples. Often my sources of JSON don’t do a good job of formatting the JSON, or I manually write the JSON but make some mistakes in formatting. Would love to be able to select everything within the Markdown code block and say "Format Selection As … " and choose JSON.
Or better yet, have the command detect the format option from the fenced code block (```json in this case).
Current work around is to copy/paste to a JSON doc. Format Document. Copy/Paste back to markdown doc.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:38
- Comments:5
Top Results From Across the Web
Black does not support "Format Selection" command
It sounds like your keybindings are set to run "Format Selection" instead of "Format Document"; Black only ...
Read more >gracefully handle the fact that Black does not support "Format ...
I've re-oriented this to provide some feedback somehow that Black purposefully doesn't support "Format Selection".
Read more >Using Format commands to change output view - PowerShell
You can use Format-List to format and display all or selected properties of an object as a list (Format-List -Property *).
Read more >Basic Editing in Visual Studio Code
Format Selection (Ctrl+K Ctrl+F) - Format the selected text. You can invoke these from the Command Palette (Ctrl+Shift+P) or the editor context menu....
Read more >Format selection list commands - IBM
These topics describe the commands you can use on a Format Selection List panel: Locating format names · Renaming a format · Sorting...
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 FreeTop 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
Top GitHub Comments
🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
I’m glad this issue is in the backlog, and I hope there can be some progress made on it. I wish to have this feature too.
In my current case, I work with Shopify themes which can have several different formats in the same file: CSS, JavaScript, JSON, HTML, Liquid, etc. So it will be useful to highlight parts of the file, issue a “Format Selection As” command and choose a certain language to format that selection alone.
Noting here also that this was asked before #27073 but was closed in the issue grooming exercise then.
@michaelgwelch another workaround: You can temporarily rename the markdown file extension to
.md.json
, format your JSON code blocks, then rename it back to.md
🙂