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

相关推荐
JQLvopkk1 天前
C# 实践AI :Visual Studio + VSCode 组合方案
人工智能·c#·visual studio
踏过山河,踏过海1 天前
【qt-查看对应的依赖的一种方法】
qt·visual studio
承渊政道1 天前
C++学习之旅【C++中模板进阶内容介绍】
c语言·c++·笔记·学习·visual studio
dzj20212 天前
Visual Studio2022中好用的AI编码工具介绍——Windsurf(Codeium)
ide·ai·visual studio·code
JQLvopkk2 天前
C# 实践AI 编码:Visual Studio + VSCode 组合方案
人工智能·c#·visual studio
zho_uzhou3 天前
c++ imgui implot绘图使用示例 visual studio
开发语言·c++·visual studio
是店小二呀3 天前
Visual Studio C++ 工程架构深度解析:从 .vcxproj 到 Qt MOC 的文件管理实录
c++·qt·visual studio
MyBFuture3 天前
编程实战:相机连接与参数设置指南
windows·c#·visual studio·vision pro·联合编程
zzh_my4 天前
Visual Studio 2022介绍
ide·visual studio
mancy_1212124 天前
复古C语言代码复活!——以121+hello.c为例摘要
c语言·vscode·gitee·visual studio·新人首发·turbo c