在 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 代码助手\]显示在工具栏的**\[工具\]\*\*中。这是有点不一样的地方,快捷键激活对话还是很方便的。

相关推荐
进击的阿尔法猿8 小时前
visual studio生成动态库DLL
ide·visual studio
Qian丶Xi10 小时前
Visual Studio旧版直链
ide·visual studio
珊瑚里的鱼1 天前
第九讲 | 模板进阶
开发语言·c++·笔记·visualstudio·学习方法·visual studio
慢一点会很快2 天前
【FFmpeg】介绍+安装+VisualStudio配置FFMpeg库
ide·ffmpeg·visual studio
程序猿多布2 天前
使用Visual Studio将C#程序发布为.exe文件
c#·visual studio
半青年3 天前
华为鸿蒙电脑能否作为开发机?开发非鸿蒙应用?
ide·华为·编辑器·电脑·idea·harmonyos·visual studio
battlestar4 天前
Visual studio 打包方法
ide·visual studio
算法歌者4 天前
Visual Studio 项目 .gitignore 文件指南
git·visual studio
伐尘4 天前
【Qt】编译 Qt 5.15.x For Windows 基础教程 Visual Studio 2019 MSVC142 x64
windows·qt·visual studio
jiunian_cn4 天前
【c++】异常详解
java·开发语言·数据结构·c++·算法·visual studio