A simple tool that will take your selected/highlighted code snippet from within VS Code, format it for Reddit or Discord markdown before placing it on your system's clipboard, ready to paste in either program.
The goal of this extension is to provide a utility that helps users always have nicely formatted code blocks when asking for help within various help/support servers and subreddits.
Right-click and Select Copy for Discord/New Reddit or Copy for Old Reddit
Paste the selected and now formatted code within a Reddit post or comment, or Discord chat box.
Example
Disclaimer and Notes:
You can use the "Copy for Discord/New Reddit" or "Copy for Old Reddit" when copying to New Reddit, but you must be in markdown mode. Fancy Pants editor seems to cause weird issues when pasting
When using the "Copy for Discord/New Reddit" button, it will include the language for proper syntax highlighting (ex: ```lang {code} ```)
When copying functions or code that is indented away from the left margin, be sure to highlight all the way to the margin before copying so that it knows how to properly handle formatting the code under the first line
It's only been tested with Python, JS/TS, and JSON. It might work with other languages, but I can't guarantee its success.