Skip to content
| Marketplace
Sign in
Visual Studio>Tools>AI Studio - Code Assistant
AI Studio - Code Assistant

AI Studio - Code Assistant

GeekSuper

|
1,531 installs
| (4) | Free
AI-powered coding assistant for Visual Studio. Integrates OpenAI, Anthropic, and Google AI to help with code analysis, optimization, and generation. Features customizable context menu, real-time responses, and secure local processing.
Download

AI Studio for Visual Studio

Chinese

English | 中文

AI Studio 是一款强大的 Visual Studio AI 助手扩展,为开发者提供智能的代码分析、优化和解释功能。通过集成多个主流 AI 服务,它能够帮助开发者更高效地编写、理解和改进代码。

✨ 主要特性

🤖 多 AI 服务支持

  • 支持 OpenAI、Anthropic、Google AI 等主流 AI 服务
  • 灵活的 API 配置,支持自定义端点
  • 完整的代理支持,确保全球可访问
  • 统一的对话接口,无缝切换不同服务 menu1.png

💻 智能编码辅助

  • 智能代码分析和上下文理解
  • 自动代码块识别和选择
  • 实时流式对话响应
  • 多种代码输出模式

🎯 高度自定义的右键菜单

  • 完全可自定义的菜单项配置
  • 灵活的提示词模板系统
  • 丰富的输出选项:
    • 直接插入代码
    • 注释并插入新代码
    • 插入为注释
    • 替换选中内容
    • 发送到聊天窗口
    • 差异窗口对比
  • 精确的输出位置控制:
    • 选中内容上方
    • 选中内容下方
    • 选中内容开头
    • 选中内容结尾 menu2__1.png

🎨 现代化界面

  • 符合 Visual Studio 设计风格
  • 支持明暗主题自动切换
  • 可停靠的聊天窗口
  • 清晰的对话历史记录

4. 使用聊天窗口

  1. 打开聊天窗口

    • 通过 工具 > AI Studio Chat 打开
  2. 界面布局

    • 顶部工具栏:新建对话、清空对话、历史记录、设置
    • 中间对话区:显示对话内容,支持 Markdown 和代码块
    • 底部输入框:输入消息,按 Ctrl+Enter 发送
  3. 主要功能

    • 实时对话:支持流式响应,实时显示 AI 回复
    • 消息操作:每条消息可以复制、重新生成、删除
    • 历史记录:查看和管理历史对话
    • 参数设置:
      • AI 提供商和模型选择
      • Temperature(创造性)
      • Top P(词汇多样性)
      • Frequency Penalty(重复度控制)
      • Presence Penalty(话题控制)
      • 系统提示词
      • 上下文消息数量
  4. 使用技巧

    • 代码相关问题优先使用右键菜单功能
    • 复杂问题或需要多轮交互时使用聊天窗口
    • 可以从右键菜单将代码发送到聊天窗口继续讨论
    • 调整 Temperature 参数来控制回答的创造性
    • 使用系统提示词来设定 AI 的角色和行为

chat.gif

💡 使用技巧

代码分析

  1. 选中代码(或将光标放在代码块内)
  2. 右键点击,选择相应的 AI 功能
  3. 等待 AI 分析结果

示例菜单项配置:

名称:解释代码
提示词:请解释以下代码的功能和实现原理:\n{code}
输出模式:插入为注释
输出位置:代码上方

explaincode.gif

代码优化

  1. 选中需要优化的代码
  2. 右键选择"优化代码"
  3. AI 会分析并提供优化建议

示例菜单项配置:

名称:优化代码
提示词:请帮我优化以下代码,提高其性能和可读性:\n{code}
输出模式:注释并插入新代码
输出位置:代码下方

optimizecode.gif

智能代码生成

  1. 选中相关代码或注释
  2. 右键选择"生成代码"
  3. AI 会根据上下文生成相应代码

示例菜单项配置:

名称:生成单元测试
提示词:请为以下代码生成单元测试:\n{code}
输出模式:插入代码
输出位置:代码下方

⚙️ 高级配置

代理设置

如果需要使用代理访问 AI 服务:

  1. 打开选项页面
  2. 配置代理类型(HTTP/SOCKS5)
  3. 设置代理服务器地址和端口
  4. 如需要,配置代理认证信息

proxy.png

自定义 API 端点

对于自托管的 AI 服务:

  1. 在选项页面中找到相应服务
  2. 修改 API Base URL
  3. 配置所需的认证信息

日志设置

可以配置日志级别来帮助诊断问题:

  • Simple:仅记录基本操作信息

log.png

  • Detailed:记录详细的请求和响应信息

log-detail.png

🔒 隐私和安全

  • 所有 API 密钥都安全存储在本地
  • 代码分析在本地完成
  • AI 请求可通过代理发送
  • 可控的日志记录级别
  • 不会收集或上传用户代码

🤝 支持与反馈

如有问题或建议,请通过以下方式联系:

  • 邮件:summergeeksuper@gmail.com

📄 许可证

本项目采用 MIT 许可证。详见 LICENSE 文件。


English

English | 中文

AI Studio is a powerful Visual Studio AI assistant extension that provides intelligent code analysis, optimization, and explanation features. By integrating multiple mainstream AI services, it helps developers write, understand, and improve code more efficiently.

✨ Key Features

🤖 Multiple AI Services Support

  • Support for OpenAI, Anthropic, Google AI and other mainstream AI services
  • Flexible API configuration with custom endpoint support
  • Complete proxy support for global access
  • Unified dialogue interface for seamless service switching menu1.png

💻 Intelligent Coding Assistant

  • Smart code analysis and context understanding
  • Automatic code block recognition and selection
  • Real-time streaming dialogue response
  • Multiple code output modes

🎯 Highly Customizable Context Menu

  • Fully customizable menu items configuration
  • Flexible prompt template system
  • Rich output options:
    • Direct code insertion
    • Comment and insert new code
    • Insert as comments
    • Replace selected content
    • Send to chat window
    • Diff window comparison
  • Precise output position control:
    • Above selected content
    • Below selected content
    • Start of selection
    • End of selection

menu2__1.png

🎨 Modern Interface

  • Visual Studio design style compliant
  • Automatic light/dark theme support
  • Dockable chat window
  • Clear conversation history

4. Using Chat Window

  1. Open Chat Window

    • Go to Tools > AI Studio Chat
    • Or use shortcut Ctrl+Shift+A
  2. Interface Layout

    • Top Toolbar: New Chat, Clear Chat, History, Settings
    • Middle Chat Area: Shows conversations with Markdown and code block support
    • Bottom Input Box: Enter message, press Ctrl+Enter to send
  3. Main Features

    • Real-time Chat: Streaming response support
    • Message Operations: Copy, regenerate, delete for each message
    • Chat History: View and manage conversation history
    • Parameter Settings:
      • AI Provider and Model selection
      • Temperature (Creativity)
      • Top P (Vocabulary diversity)
      • Frequency Penalty (Repetition control)
      • Presence Penalty (Topic control)
      • System prompt
      • Context message count
  4. Usage Tips

    • Use context menu for code-related questions
    • Use chat window for complex issues or multi-turn interactions
    • Send code from context menu to chat window for further discussion
    • Adjust Temperature to control response creativity
    • Use system prompt to set AI role and behavior

chat.gif

💡 Usage Tips

Code Analysis

  1. Select code (or place cursor in code block)
  2. Right-click, select AI function
  3. Wait for AI analysis

Example menu item configuration:

Name: Explain Code
Prompt: Please explain the functionality and implementation of this code:\n{code}
Output Mode: Insert as Comments
Output Position: Above Code

explaincode.gif

Code Optimization

  1. Select code to optimize
  2. Right-click "Optimize Code"
  3. AI will analyze and suggest improvements

Example menu item configuration:

Name: Optimize Code
Prompt: Please optimize this code for better performance and readability:\n{code}
Output Mode: Comment and Insert Below
Output Position: Below Code

optimizecode.gif

Smart Code Generation

  1. Select relevant code or comments
  2. Right-click "Generate Code"
  3. AI will generate code based on context

Example menu item configuration:

Name: Generate Unit Test
Prompt: Please generate unit tests for this code:\n{code}
Output Mode: Insert Code
Output Position: Below Code

⚙️ Advanced Configuration

Proxy Settings

For accessing AI services through proxy:

  1. Open options page
  2. Configure proxy type (HTTP/SOCKS5)
  3. Set proxy server address and port
  4. Configure proxy authentication if needed

proxy.png

Custom API Endpoints

For self-hosted AI services:

  1. Find the service in options page
  2. Modify API Base URL
  3. Configure required authentication

Logging Settings

Configure log level for diagnostics:

  • Simple: Basic operation logs only log.png
  • Detailed: Detailed request and response logs log-detail.png

🔒 Privacy and Security

  • All API keys securely stored locally
  • Code analysis performed locally
  • AI requests can be proxied
  • Controllable logging levels
  • No user code collection or upload

🤝 Support and Feedback

For questions or suggestions, please contact:

  • Email: summergeeksuper@gmail.com

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

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