在 Visual Studio 上体验腾讯云 AI 代码助手

​本文以以 Visual Studio 2022 为例。

第一步 安装[腾讯云 AI 代码助手]

打开以 Visual Studio 2022,依次点击工具栏中的-** 扩展 - ** 管理扩展 ,在扩展管理器 中搜索**[腾讯云 AI 代码助手]**,点击安装,然后重启VS

第二步 重启Visual Studio

重启VS,会提示安装[腾讯云 AI 代码助手]插件,等待插件安装完成,安装插件过程中需要关闭打开的所有VS项目



第三步 代码测试

腾讯云 AI 代码助手\]不在扩展中,需要在工具栏的**\[工具\]**中可以看到\[腾讯云 AI 代码助手\],打开\[腾讯云 AI 代码助手\]的快捷键为\*\* ALT + T\*\* ![](https://img2024.cnblogs.com/blog/1665523/202502/1665523-20250227114312009-1621057689.png) ##### 1、输入问题 比如写一个冒泡排序,在左下方可以切换混元和deepseek。 ##### 2、给出答案 ```csharp using System; class Program { static void BubbleSort(int[] arr) { int n = arr.Length; for (int i = n - 1; i > 0; i--) { bool swapped = false; for (int j = 0; j < i; j++) { if (arr[j] > arr[j + 1]) { // 交换 arr[j] 和 arr[j + 1] int temp = arr[j]; arr[j] = arr[j + 1]; arr[j + 1] = temp; swapped = true; } } // 如果没有发生交换,说明数组已经有序,提前退出 if (!swapped) break; } } static void Main(string[] args) { int[] data = { 64, 34, 25, 12, 22, 11, 90 }; Console.WriteLine("排序前的数组:"); foreach (int num in data) { Console.Write(num + " "); } Console.WriteLine(); BubbleSort(data); Console.WriteLine("排序后的数组:"); foreach (int num in data) { Console.Write(num + " "); } } } ``` ##### 3、执行代码 代码复制到类文件中调整下位置,运行代码,正确输出,没什么问题,代码内容测试只写一个这一个提问,其他大同小异 ![](https://img2024.cnblogs.com/blog/1665523/202502/1665523-20250227114813717-998309872.png) ## 使用上的建议: ① 在没指定开发语言的情况下,默认给出了Python的代码,这里最好在适配VS中可以默认回答代码语言为C#,这样使用体验上比较友好 ② 代码给出后,可以像在网页版一样复制代码,这里还有一个优化建议,比如代码插入功能,鼠标选中指定区域,点击代码回答下方的代码插入功能可以直接将代码插入到指定区域,也是在使用体验上更加友好些 ③ 像其他AI代码助手安装后会显示在工具栏的 \*\* \[扩展\] **中,而\[腾讯云 AI 代码助手\]显示在工具栏的**\[工具\]\*\*中。这是有点不一样的地方,快捷键激活对话还是很方便的。

相关推荐
无限进步_7 小时前
面试题 02.02. 返回倒数第 k 个节点 - 题解与详细分析
c语言·开发语言·数据结构·git·链表·github·visual studio
MyBFuture9 小时前
C#数组详解:一维二维与交错数组
开发语言·windows·c#·visual studio·vision pro
HAPPY酷9 小时前
构建即自由:一份为创造者设计的 Windows C++ 自动化构建指南
开发语言·c++·ide·windows·python·策略模式·visual studio
Light6012 小时前
Visual Studio 2026深度体验:AI原生IDE如何重塑开发工作流
性能优化·visual studio·github copilot·智能编程·ai原生ide·2026·fluent ui
CSDN_RTKLIB1 天前
Visual Studio不改变文件编码情况下解决C2001
c++·ide·visual studio
楼田莉子1 天前
C++现代特性学习:C++14
开发语言·c++·学习·visual studio
HAPPY酷1 天前
为啥双击 .sln 文件即可在 Visual Studio 中加载整个解决方案
ide·visual studio
千谦阙听1 天前
数据结构入门:栈与队列
数据结构·学习·visual studio
CSDN_RTKLIB1 天前
MSVC单独配置源字符集、执行字符集
c++·visual studio
MyBFuture1 天前
C# 关于联合编程基础
开发语言·c#·visual studio·vision pro