Supercharge your Visual Studio workflow with AI-powered tools like code generation, refactoring, commenting, unit test creation, and more, right from the right-click menu.
Supercharge your Visual Studio workflow with AI-powered tools like code generation, refactoring, commenting, unit test creation, and more, right from the right-click menu.
Get Your API Key
Sign in to OpenAI to create your API key.
Configure AI Studio
Go to Tools → Options → AI Studio and paste in your API key.
⚙️ Configuration Options
Format Changed Text: Automatically formats AI-generated/refactored code.
Language Model: Switch between models or use a custom one for your endpoint.
✨ Features
🔧 Code It
Generate code for stubs or comments:
Select code or place cursor on a line
Right-click → AI Studio → Code It
View AI-generated implementation
Result:
💬 Add Comments
Select code
Right-click → AI Studio → Add Comments
Receive clean, inline comments
🔁 Refactor
Select a method
Right-click → AI Studio → Refactor
View optimized code
📝 Add Summary
Select a method or its header
Right-click → AI Studio → Add Summary
Generate XML-style documentation
📖 Explain
Select code
Right-click → AI Studio → Explain
See code explanation in a popup
🔐 Security Check
Select code
Right-click → AI Studio → Security Check
View potential vulnerabilities and suggestions
🧪 Unit Test Generation
Select a method
Right-click → AI Studio → Add Unit Tests
Instantly generate unit tests
Test Configuration
Configure test behaviors via: Tools → Options → AI Studio → Unit Test
Custom Instructions
Add special rules or constraints for your unit test generation.
🧩 Advanced Customization
✏️ Command Customization
Modify AI Studio behaviors using your own instructions:
Go to Tools → Options → AI Studio → Commands
Customize each action with your own prompt/instructions
Example Result:
📌 Summary
AI Studio makes AI assistance a seamless part of your development workflow in Visual Studio. Whether you're generating code, documenting, testing, or refactoring—it’s all just a right-click away.