-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a "Format Selection As ..." command? #131814
Comments
This comment was marked as spam.
This comment was marked as spam.
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 |
ⅰ. I'd really like to see this implemented as well. Similar to what others have mentioned here and in #27073, I'm not interested in syntax-highlighting which requires VSCode to programmatically conjecture the parsing, and final language designation, selected from a set of more than one language, to each element of the result, i.e. any functionality which enhances or generalizes VSCode's ability to highlight syntax of all correctly-formatted¹ code in a file, where ────────────────────────────────────────────────────────────
──────────────────────────────────────────────────────────── ⅱ. Also, I just wanted to note that @bkmeneguello's comment from May 16ᵗʰ doesn't seem like spam. I'm not sure if it was automatically flagged for some reason, but I may also be missing something. |
Related on Stack Overflow: Formatting contents of a Markdown code fences in VS Code (or other embedded language code). For that question, #14447 was also related. |
Here is another related item (#183466), this time referring to JavaScript and a missing "Format Selection With..." command, which would also solve this problem, and is apparently available in other contexts within VS Code. |
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.
The text was updated successfully, but these errors were encountered: