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

相关推荐
小龙报2 小时前
《算法通关指南数据结构和算法篇(4)--- 队列和queue》
c语言·开发语言·数据结构·c++·创业创新·学习方法·visual studio
whm27775 小时前
Visual Basic 手工制作工具栏
开发语言·visual studio
满天星830357721 小时前
【C++】智能指针
c语言·开发语言·c++·visual studio
小龙报1 天前
《C语言疑难点 --- C语内存函数专题》
c语言·开发语言·c++·创业创新·学习方法·业界资讯·visual studio
双河子思3 天前
Visual Studio 编程工程设置
ide·windows·visual studio
ol木子李lo3 天前
Doxygen入门指南:从注释到自动文档
c语言·c++·windows·编辑器·visual studio code·visual studio·doxygen
持梦远方4 天前
【C++日志库】启程者团队开源:轻量级高性能VoyLog日志库完全指南
开发语言·c++·visual studio
一匹电信狗4 天前
【C++】红黑树详解(2w字详解)
服务器·c++·算法·leetcode·小程序·stl·visual studio
whm27774 天前
Visual Basic 菜单编辑器
开发语言·visual studio
dvlinker4 天前
使用Visual Studio中的数据断点快速定位内存越界问题的实战案例分享
c++·visual studio·memset·内存越界·栈内存越界·堆内存越界·数据断点