
01
上节我们在vs2022安装了deepseek,但是个人使用了一段时间以后,发现代码注释、一种代码转为另一种代码的能力较差,所以本节我们来认识一下国内还不错的CodeGeeX工具。
Visual Studio已更新为17.14+集成deepseek实现高效编程 |
|---|
02
CodeGeeX 智能编程助手






03
CodeGeeX支持哪些编程语言?
CodeGeeX支持Python、Java、C++、JavaScript、Go等数十种常见编程语言。
CodeGeeX是免费的吗?
CodeGeeX插件对个人用户完全免费。
CodeGeeX是可以私有化部署?
面向企业提供CodeGeeX私有化部署服务。
了解更多:https://codegeex.cn/downloadGuide#visualstudio
04
VS2022安装
点击【扩展】-【管理扩展】-【浏览】-codegeex 安装。提示关闭vs2022

安装

开始

重新打开vs
如果觉得代码自动补全比较烦人,可以打开-【工具】-【选项】-找到这里关闭off

05
AI写代码演示
先用deepseek工具的gpt指令生成快速排序
#pragma onceclass codeX{// gpt 让这个类实现快速排序void quickSort(int* arr, int low, int high) {if (low < high) {int pi = partition(arr, low, high);quickSort(arr, low, pi - 1);quickSort(arr, pi + 1, high); } }int partition(int* arr, int low, int high) {int pivot = arr[high];int i = (low - 1);for (int j = low; j <= high - 1; j++) {if (arr[j] < pivot) { i++;swap(&arr[i], &arr[j]); } }swap(&arr[i + 1], &arr[high]);return (i + 1); }void swap(int* a, int* b) {int temp = *a; *a = *b; *b = temp; }};再使用codegeex

再生成注释过程中,保持不动,他会自动插入到文件
#pragma onceclass codeX{// gpt 让这个类实现快速排序// 快速排序函数void quickSort(int* arr, int low, int high) {if (low < high) {int pi = partition(arr, low, high);quickSort(arr, low, pi - 1);quickSort(arr, pi + 1, high); } }// 分区函数int partition(int* arr, int low, int high) {int pivot = arr[high];int i = (low - 1);for (int j = low; j <= high - 1; j++) {if (arr[j] < pivot) { i++;swap(&arr[i], &arr[j]); } }swap(&arr[i + 1], &arr[high]);return (i + 1); }// 交换函数void swap(int* a, int* b) {int temp = *a; *a = *b; *b = temp; }};06
这里我们将刚才的C++代码转为C#看看 ,适用场景例如SDK
#pragma once// C++class codeX{// gpt 让这个类实现快速排序// 快速排序函数void quickSort(int* arr, int low, int high) {if (low < high) {int pi = partition(arr, low, high); quickSort(arr, low, pi - 1); quickSort(arr, pi + 1, high); } }// 分区函数int partition(int* arr, int low, int high) {int pivot = arr[high];int i = (low - 1);for (int j = low; j <= high - 1; j++) {if (arr[j] < pivot) { i++; swap(&arr[i], &arr[j]); } } swap(&arr[i + 1], &arr[high]);return (i + 1); }// 交换函数void swap(int* a, int* b) {int temp = *a; *a = *b; *b = temp; }};// C#using System;public class CodeX{ // 快速排序函数 public void QuickSort(int[] arr, int low, int high) { if (low < high) { int pi = Partition(arr, low, high); QuickSort(arr, low, pi - 1); QuickSort(arr, pi + 1, high); } } // 分区函数 private int Partition(int[] arr, int low, int high) { int pivot = arr[high]; int i = (low - 1); for (int j = low; j <= high - 1; j++) { if (arr[j] < pivot) { i++; Swap(ref arr[i], ref arr[j]); } } Swap(ref arr[i + 1], ref arr[high]); return (i + 1); } // 交换函数 private void Swap(ref int a, ref int b) { int temp = a; a = b; b = temp; }}09
好的,故事就到这里,有新发现再同你分享。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。