Doxide

Xin Yu

View on GitHub →

💭 Inspiration

Documentation is a love letter that you write to your future self ~ Damian Conway

We all know the importance of good documentation and the one hundred and one benefits of writing comments in our code. Yet, we just never do it. Writing documentation can be hard, sometimes writing good comments can be just as hard as writing the code. But what if I told you that writing documentation could be as easy as a click of a button?

✨ What it does

Doxide is a VS Code extension that automates code documentation using OpenAI‑Codex.

Create: Doxide can be used to create function Docstrings

  • this can be done either using the CodeLens (appears above the function signature of Python, JavaScript and TypeScript files)
  • or by selecting the function and running the command on the right click menu or Command Palette (Ctrl + Shift + P)
  • Docstrings will be placed and formatted accordingly (for example, Python Docstrings will be placed within and below the function signature while JavaScript Docstrings are placed above the function signature.

Configure Doxide allows you to decide how you want your Docstrings to look like

  • Do you want to make it look more like JavaDoc/JSDoc style or maybe you want to follow Google's Style Guide?

Customize Doxide provides you with many configuration options for you to customize to your heart's content

  • use the User Settings to customize anything from the CodeLens titles to fine=tuning Open-AI's parameters

🛠 How I built it

  • TypeScript
  • VS Code API
  • Open-AI API

🎯 Challenges I ran into

  • Lack of knowledge and lack of resources: Before this project, I've always learnt everything from resources and tutorials that were extremely beginner-friendly but there are unfortunately not that many resources on building VS Code Extensions that spoon-feed me the information and there was a steep learning curve before I was able to get a hang of it.
  • Time Management: I had to complete this project while balancing a full-time university course, casual work, being an active member of 6 clubs and trying to have a social life (and me being a professional procrastinator definitely didn't help XD )
  • Solo: I usually join hackathons in teams but had to go alone on this one :(

💪 Accomplishments that I'm proud of

  • I'm really proud to have finished this project in the end (unfortunately had to pull one all-nighter though Zzz)
  • I'm really happy with how the project turned out in the end (like, it works! huzzah!) and although I didn't manage to build all of the ideas I had, I think the end product was definitely close enough

📖 What I learned

  • TypeScript: it was my first time using TypeScript (and I don't think I'll be going back to JS)
  • Anything is possible: I really thought that I would not be able to complete this project, especially not alone, just due to the learning curve and lack of motivation ~ but it's done now, yay!
  • Torture feels better when felt together: I really felt the repercussions of doing a project solo - working on this project felt very grueling at times and celebrating victories alone is just did not feel right. I realize now that I don't like doing hackathons (or probably any software project) alone.

⛳️What's next for Doxide?

  • Designing an actual logo
  • Allowing users to define their own Docstring templates
  • Ability to choose between alternative Docstrings
  • Detect if a Docstring is already present and change it in place instead of generating another one
  • Add command to generate all Docstrings in the current file
  • Cleaning up code 🍝

Try it out