AI Studio enhances your coding workflow with ChatGPT-powered features like unit test generation, code refactoring, documentation, and more - accessible via right-click context menu.
Get it from Visual Studio Marketplace
-
Obtain API Key: Create your API key at OpenAI Platform
-
Configure Extension: Navigate to Tools/Options/AI Studio and enter your key
-
Format Changed Text: Enable to automatically format refactored code
-
Language Model: Choose between:
- ChatGPTTurbo
- GPT4_Turbo
- GPT4
- GPT4o
- GPT4_32k_Context
-
Custom Models: Optionally specify custom models
- Select code or click on a line
- Right-click → "AI Studio / Code It"
- Get AI-generated implementation
- Select code
- Right-click → "AI Studio / Add Comments"
- Receive commented code
- Select method
- Right-click → "AI Studio / Refactor"
- Get optimized code
- Select method or method header
- Right-click → "AI Studio / Add Summary"
- Receive detailed documentation
- Select code
- Right-click → "AI Studio / Explain"
- View code explanation popup
- Select code
- Right-click → "AI Studio / Security Check"
- Review security suggestions
- Navigate to Tools/Options/AI Studio/Commands
- Modify command behaviors with custom instructions
- Select method
- Right-click → "AI Studio / Add Unit Tests"
- Get generated tests
Configure test generation at Tools/Options/AI Studio/Unit Test:
-
Unit Testing:
-
Isolation Frameworks:
-
Test Data:
-
Assertion Libraries:
-
Custom Instructions: Add specific requirements for test generation