Integrated AI Extension for Visual Studio 2022

Seamlessly bridge your code editor with web AI chats, no API keys needed! Refactor, debug, and generate code with a fluid, integrated workflow right inside Visual Studio. This extension is meant for those who want full control of the coding process, rather than vibe coding with agentic code editors, and don't want to mess with API keys, token costs, and limits.
❌ The Old Workflow
Tired of the endless cycle of Ctrl+C, Alt+Tab, Ctrl+V? Manually copying code between your editor and a browser tab is slow, error-prone, and breaks your focus. You get:
- ❌ Disjointed context switching that kills productivity.
- ❌ Manually finding and replacing code blocks from the AI's response.
- ❌ No easy way to compare the AI's suggestion with your original code.
- ❌ Forgetting to back up your work before making significant AI-suggested changes.
✅ With Integrated AI
Integrated AI brings the power of web AI chats directly into your IDE, creating a frictionless development experience.
- ✅ Stay in the Zone: A dedicated, dockable web window with multiple AI chat sites to choose from.
- ✅ One-Click Context: Send selected code, the current function, or the entire file to the AI in a single click with built-in context.
- ✅ Intelligent Code Merging: Review AI suggestions in a familiar diff view before applying them.
- ✅ Automatic Safety Net: Your solution is automatically backed up when you accept changes, so you can experiment with confidence.
You can use this extension with your favorite AI chat, for free or with a subscription that you already have, along with all the features you're already used to such as projects and memory. With Integrated AI, you don't have to give up control and your creative vision to vibe coding, and you also don't have to deal with the old way of copying and pasting code blocks.
🤖 Included AI chat sites:
- Google AI Studio
- Grok
- Claude
- ChatGPT
- Gemini
- Deepseek

🚀 Core Features
- Integrated AI Chat Window: Open an AI chat web interface in a dockable Visual Studio tool window.
- 🎯 Smart VS-to-AI Transfer: Use the right-click
Send to AI commands to instantly send code to the prompt text area (you can also set up keyboard shortcuts). Choose from three powerful modes:
- Snippet: Send only the code you've highlighted.
- Function: Right-click a function name to send the whole function.
- File: Send the complete content of the active document.
- Multiple Files: Select and send several files at once from your solution.
- ⚠️ Error to AI: From the error list, right click after selecting errors/warnings and click "Send to AI chat". It will send the error description(s) and the line with code that has the error.
- ✨ Intelligent AI-to-VS Diffing: Move code from the AI back to your editor with the "AI -> VS" button commands. You have full control of what gets replaced, with options similar to the Send to AI commands. The extension can also intelligently analyze the AI's response to find the corresponding function or snippet in your file (turn on Auto Diff in the options). It then presents a rich diff view, allowing you to review changes line-by-line and accept, decline, or manually choose a different replacement.
- 🔒 Automatic Backups: Never lose work. When you accept a diff, the extension automatically creates a zip backup of your entire solution, giving you a restore point. There is also a manual backup button.
- Note: All files such as backups, saved chat URLs, and restore info is saved locally on your PC.
🛠️ Installation
- Open Visual Studio 2022.
- Navigate to
Extensions > Manage Extensions.
- In the
Browse tab, search for "Integrated AI".
- Click Install and follow the instructions.
- Restart Visual Studio.
💡 How to Use: A Quick Start Guide
- Open the Chat Window: In the Visual Studio top bar, go to
Tools > Open AI Chat Window to open the chat tool window which can be docked or moved. Select your desired chat site from the dropdown within the chat window (default is Google AI Studio).
- Chat with the AI: Your code will appear in the prompt along with your message. Write your request (e.g., "Refactor this to be more efficient" or "Add exception handling").
- Send Code: Open a code file. Then right-click and select a
Send to AI command. You can send multiple code blocks or even multiple files, since each send command is sent in its own context block.
- Review the Diff: Once the AI provides a response, highlight the text in the chat window and click an "AI -> VS" command. A diff view will appear, showing the proposed changes. You can also use the artifact "copy" buttons on the response code blocks for more automated diffing (see "Configuration" for more info).
- Accept or Decline: If you like the changes, click "Accept" in the diff view. A backup of your solution will be created automatically by default, and the document will be saved with the new changes.
🎬 Feature Deep Dive
"VS to AI" Transfers
Code is sent from VS to the AI chat with the Send to AI commands from the document right-click menu. The available commands show depending on what is right-clicked:
- File/Multiple Files to AI: anywhere in the document
- Snippet to AI: on highlighted text
- Function to AI: on a function name, where the function definition is within that same document
Code blocks get a context header so the AI knows useful info such as filepath and type. Sites that allow markdown in prompts, such as AI Studio, have collapsible code blocks using ```code tags.
Note: The function commands only work with files that are native to Visual Studio, such as C#, VB, C++, and F#. Files such as XAML and Javascript will still work > with snippets and full file transfers.
Tip: To use keyboard shortcuts for any command, go to Tools > Options > Environment/Keyboard and search for the command to add a key combination.
Set the scope to Text Editor to avoid conflicts with existing shortcuts.




You can send errors or warnings from the VS error list by right-clicking on one or multiple errors and selecting "Send to AI chat". It will paste the error description, line number, and contents of the line into the prompt if it's just one error, and also navigate to that error in your code, even if a file is closed. Multiple errors/warnings selected will send just the descriptions, all in one click. To select multiple errors/warnings use ctrl+click or shift+click before right clicking on one of them.


Intelligent "AI to VS" Diffing
The "-> VS" commands are used to send highlighted or copied code from the AI chat to your editor. First it will check for highlighted text within the chat window, and if nothing is highlighted it will use whatever is in the clipboard. The code is merged into your existing file automatically, showing a diff view before applying changes. If a different code block to replace is needed, you can use the "Replace Different Code" button. There is also a new file option that will create one with the AI code and add it to the project.
If "Auto Diff" in the options is turned on, you don't even need to use button commands! This only woks with the artifact copy buttons. It works best with C# and VB code. For other file types, such as XAML, it will fallback to a full file replace or, if there is text selected in the code editor, a snippet replace.
For the "Function -> VS" command, auto matching attempts to find the function to replace by name, or adds it below the last existing function as a new function. If matching can't find anything, a window comes up which lets you choose which function to replace.

Automatic Backups and Restore Window
After accepting a diff, a backup is created of the previous solution state (this can be disabled in the options). The AI code that was used for that diff and the chat page is also saved to allow for easy searching later. There is also a manual save button so your solution can be backed up at any time.
For restores a separate window opens with different options. There is a list of restores showing the AI code that was accepted right after that restore point. If you highlight some AI code in the chat window, the restore window will open to that restore point if it exists. You can also use "Go To Chat" to navigate there. Compare will show multiple diff views with each changed file, and you can restore that backup or close the diff views from there.
Note: After a restore it's best to clean > rebuild for the solution.


⚙️ Configuration
You can configure the extension's behavior by clicking the gear icon at the top right of the chat window.
- Theme: Set all windows to light or dark mode.
- Auto Diff Compare: Toggle automatic code analysis for artifact
Copy Code button clicks during code replacement/diff view creation.
- Create Restore on Accept: Toggle creation of restore point every time a diff is accepted.
- Reset URLs: URLs to chat pages are saved to make switching chats easy. The last-used URL is also saved when closing VS. This button can be used in case a chat page is incorrect.
- Show Log Window: Used for error reporting and debugging.
🚨 Troubleshooting
- The AI window is blank or shows an incorrect page?
- Try refreshing the window with Ctrl-R (or right-click the window and select "Refresh") or choosing a different chat page. You can also use the "Reset URLs" button in the options.
- AI chat page logged me out?
- This is an automatic security feature of some chat pages which happens in a normal browser as well, the only fix is to just log back in.
- The "Auto Diff" didn't find the right code for replacement?
- This feature is experimental for now. The diff logic works best when the AI provides a complete function, file, or a clearly defined snippet. If the AI's response is heavily modified or partial, the logic may struggle. Try asking the AI to provide the complete function, file, or snippet in its response.
For any other issues, please report them on the GitHub page.
🤝 Connect & Contribute
This is a tool for developers, by a developer. Your feedback is invaluable!
📝 Changelog
- 1.2.3 Fix duplicate files showing in file list, add file filtering options, improve auto-diff code analysis
- 1.2.2 Add "Multiple Files to AI" command, improve file list in file selection window, re-fix indent issues with code sent to AI
- 1.2.1 Fixes: Readd file to AI existing file check, fix commands not showing for xaml files, improve backup deleting, remove "auto function match" toggle
- 1.2.0 Add "Send To AI" context menu commands and remove the "-> AI" splitbutton.
- 1.1.6 Add multiple error selection for Error to AI, add ability to delete selected backups, cleanup StringUtil, fix extra newline when using To VS commands
- 1.1.5 Small compatibility and Grok fixes
- 1.1.4 Small fixes: Fix Function to VS issues, fix use restore button, fix indent issues with Snippet to AI
- 1.1.3 Add Deepseek, small fixes for web navigation, compare views, theme switching, restore message box conflict, new file creation, and indent issues
- 1.1.2 Add markdown code block insertion for sites that support it, optimize new file creation, add status messages for longer operations like file comparing
- 1.1.1 Fix error "cancellation token disposed" when clicking
Replace Different Code button.
- 1.1.0 Add gemini.google.com to the included chat sites, add "Error to AI" command when right-clicking an error or warning in the VS error list, change new file creation to be on background thread, prevent diff view showing when "new file" is cancelled.
- 1.0.2 Fix theme not setting correctly sometimes on the main chat page, fix URL saving, add
Reset URLs button
- 1.0.1 Fix README links
- 1.0.0 Initial release
📄 License
This project is licensed under the GNU General Public License v3.0. This means it is free and open source, and any modifications or distributions must also be licensed under the same terms.
See the LICENSE file for the full license text.
| |