question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there a "Format Selection As ..." command?

See original GitHub issue

I 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:open
  • Created 2 years ago
  • Reactions:38
  • Comments:5

github_iconTop GitHub Comments

8reactions
vscode-triage-botcommented, Oct 20, 2021

🙂 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!

2reactions
ADTCcommented, Aug 18, 2022

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 🙂

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found