Inspiration
Visual Studio Code has been my go-to text editor for the past year now. One of the main reasons why I prefer to use it is its massive amount of extensibility and hackability through the VS Code Extension Marketplace.
Additionally, I have been an avid browser of the social media platform Reddit for a few years. I love this platform due to the huge community it has gained and the personalization that it allows its users in terms of what they wish to view through subreddits tailored to specific topics.
So, all of that being said, I though to myself why not bring the two together?
What it does
With this extension, users of VS Code can browse the "hot" 25 posts of any subreddit that they search for.
Additionally, they can few post specific information (such as the main body of the post)
How I built it
This tool is build using Node and Javascript, as well as the Visual Studio Code API. This extension makes heavy use of the Webview object (essentially an embedded iFrame) that allows for html to be displayed in a VS Code tab. To poll Reddit, I used the npm wrapper snoowrap.
Challenges I ran into
One of the major challenges that I ran into was handling message passing between the Webview and the extension's main Javascript file. I was able to get around this after spending some quality time with the API's documentation. I also ran into the challenge of dealing with multiple nested promise functions in the main Javascript file, something that has troubled me for a while. I was able to put in a little hack that manually waits for the promises to return, however I plan on resolving this issue in a more efficient and less error prone way in the future.
Accomplishments that I'm proud of
I am proud that I was able to learn how VS Code extensions work, as well as now having the knowledge to quickly create one in the future. If VS Code continues to be my go-to text editor, I plan on creating more extensions for it in the future.
Additionally, I am proud that I was able to create this extension without the help of any video tutorials specifically aimed at what I was trying to do (something that I have not been able to do in the past).
What I learned
I learned that VS Code really is as extendable as you want it to be due to their API library and the Extension Marketplace. Additionally, I learned that promise statements, at least for me, are one of the trickiest things to fully understand in Javascript.
What's next for RedVis
Up next, I plan on adding additional features such as:
View comments of specific posts
Upvoting/downvoting posts
Leaving comments on thread(s) within posts
Creating new posts within specific subreddits
Feel free to follow my progress at the Github link below, and keep an eye out on the VS Code Extension Marketplace for RedVis!
Log in or sign up for Devpost to join the conversation.