Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Smart Refactor AINew to Visual Studio Code? Get it now.
Smart Refactor AI

Smart Refactor AI

kamruj-akash

|
43 installs
| (0) | Free
An AI-powered assistant to refactor and improve your code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Smart Refactor AI 🤖⚡️

Version Installs License: MIT

Your personal AI-powered pair programmer for intelligent code refactoring, right inside VS Code. Powered by Google's Gemini AI.

Manually refactoring code is time-consuming and requires deep concentration. Smart Refactor AI automates this process by using artificial intelligence to understand your code's intent and restructure it based on modern best practices.


✨ Current Feature: Promise to Async/Await

The initial version of Smart Refactor AI focuses on one of the most common refactoring tasks in modern JavaScript: converting promise .then() chains into clean and readable async/await syntax.

Demo GIF showing the refactoring in action (Note: You need to create and upload this demo.gif to your repository)


⚙️ Setup & Configuration

This extension requires a Google Gemini API Key to function.

  1. Get your API Key: Visit Google AI Studio to create your free API key.
  2. Add the Key in VS Code:
    • Open VS Code Settings (Ctrl+, or ⌘+,).
    • Search for Smart Refactor AI.
    • Find the "Smart Refactor AI: Api Key" field and paste your key there.

🚀 How to Use

  1. Open a JavaScript or TypeScript file.
  2. Select the entire function containing the .then() and .catch() promise chain.
  3. Open the Command Palette (Ctrl+Shift+P on Windows/Linux or ⌘+Shift+P on Mac).
  4. Type Smart Refactor: Convert .then() to async/await and press Enter.
  5. Watch as your selected code is instantly replaced with the clean, refactored version!

👨‍💻 About the Author

This extension is developed and maintained by Kamruj Akash. I'm a passionate web developer focused on creating tools that improve developer productivity and workflow.

Connect with me:

  • Website
  • GitHub
  • LinkedIn
  • Email

🛣️ Future Roadmap

This is just the beginning! Future versions aim to include more smart refactoring capabilities:

  • [ ] Function Extractor: Breaking down large functions into smaller, reusable ones.
  • [ ] Logic Simplification: Simplifying complex if/else chains.
  • [ ] Loop Optimization: Converting for loops to more functional methods like map or reduce where appropriate.

🤝 Contributing

Found a bug or have a feature request? Please open an issue on the GitHub Repository.


  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft