用户名
Email
论坛
潜水/灌水快乐,沉淀知识,认识更多同行。
ToB圈子
加入IT圈,遇到更多同好之人。
朋友圈
看朋友圈动态,了解ToB世界。
ToB门户
了解全球最新的ToB事件
博客
Blog
排行榜
Ranklist
文库
业界最专业的IT文库,上传资料也可以赚钱
下载
分享
Share
导读
Guide
相册
Album
记录
Doing
帖子
本版
文章
帖子
ToB圈子
用户
免费入驻
产品入驻
解决方案入驻
公司入驻
案例入驻
登录
·
注册
只需一步,快速开始
账号登录
立即注册
找回密码
用户名
自动登录
找回密码
密码
登录
立即注册
首页
找靠谱产品
找解决方案
找靠谱公司
找案例
找对的人
专家智库
悬赏任务
圈子
SAAS
IT评测·应用市场-qidao123.com
»
论坛
›
人工智能
›
人工智能
›
QT6开发高性能企业视频会议-8 利用VSCode+Copilot AI开 ...
QT6开发高性能企业视频会议-8 利用VSCode+Copilot AI开发
愛在花開的季節
论坛元老
|
2025-3-10 18:25:35
|
显示全部楼层
|
阅读模式
楼主
主题
1002
|
帖子
1002
|
积分
3006
Github Copilot是Github和OpenAI推出的AI编程辅助工具,之前版本的Github Copilot只有简朴的代码自动补全,根据注释生成一些代码等辅助功能。
近期Copilot有了一次大的升级,加入了Agent模式,可以实现自然语言对话讨论和最紧张的,根据指定的上下文直接按指令生成或者修改项目代码,做到了雷同Cursor的体验,而且基础版是免费利用的。
付费版Copilot可以指定更多的AI模子,包括最新的Claude 3.7等,而且能利用无限次的token。
本文简朴先容怎样在Visual Studio Code中集成和利用Github Copilot,以下步调都需要科学上网。
在Visual Studio Code中集成Copilot插件
首先需要登录Github账号并启用Github Copilot。
Sign in to GitHub · GitHub
然后我们需要为Visual Studio Code安装Github Copilot插件
安装完成后,左侧工具栏会出现Copilot Chat的图标。
利用Chat模式
在Chat模式中,Copilot会自动把当前正在编辑的代码文件代入Chat上下文,我们也可以右键点击某个项目中的文件,在Copilot菜单中把它加入Chat上下文。同时Copilot还支持上传图片,选中代码片断甚至某个GIt Change作为上下文。
之后我们和Copilot的对话中Copilot会自动关联这些上下文的内容做出回应。
这里是一个通过笔墨描述生成一个QML窗口的例子:
import QtQuick 2.15
import QtQuick.Controls 2.15
ApplicationWindow {
visible: true
width: 400
height: 300
title: "User Login"
Column {
anchors.centerIn: parent
spacing: 20
Text {
text: "Login"
font.pixelSize: 24
horizontalAlignment: Text.AlignHCenter
anchors.horizontalCenter: parent.horizontalCenter
}
TextField {
id: usernameField
placeholderText: "Username"
width: parent.width * 0.8
anchors.horizontalCenter: parent.horizontalCenter
}
TextField {
id: passwordField
placeholderText: "Password"
echoMode: TextInput.Password
width: parent.width * 0.8
anchors.horizontalCenter: parent.horizontalCenter
}
Button {
text: "Login"
width: parent.width * 0.8
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
// Handle login logic here
console.log("Username: " + usernameField.text)
console.log("Password: " + passwordField.text)
}
}
}
}
复制代码
生成之后可以让Copilot帮忙修改
import QtQuick 2.15
import QtQuick.Controls 2.15
ApplicationWindow {
visible: true
width: 800
height: 400
title: "User Login"
Row {
anchors.centerIn: parent
spacing: 20
Image {
source: "qrc:/images/left_image.png" // Replace with the path to your image
width: 300
height: 300
fillMode: Image.PreserveAspectFit
}
Column {
spacing: 20
width: 300
Text {
text: "Login"
font.pixelSize: 24
horizontalAlignment: Text.AlignHCenter
anchors.horizontalCenter: parent.horizontalCenter
}
TextField {
id: usernameField
placeholderText: "Username"
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
}
TextField {
id: passwordField
placeholderText: "Password"
echoMode: TextInput.Password
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
}
Button {
text: "Login"
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
// Handle login logic here
console.log("Username: " + usernameField.text)
console.log("Password: " + passwordField.text)
}
}
}
}
}
复制代码
Chat模式除了可以用自然语言进行交换,还可以利用一些关联到Visual Studio Code的预制指令,具体可以在Chat窗口中输入/查看
利用Edit模式
假如希望Copilot直接帮我们修改项目中的文件,可以利用Copilot的编辑模式。
在编写代码时,按下Ctrl+Shift+I,右侧会弹出Edit窗口,利用方式和Chat根本一样,不同的地方是Edit模式会直接把结果更改到你的代码文件中,在保存修改之前会弹出Diff窗口让我们确认Accept或者Discard。
神旗视讯 -- 开源高性能的音视频体系
开源地址: https://gitee.com/sqmeeting
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
本帖子中包含更多资源
您需要
登录
才可以下载或查看,没有账号?
立即注册
x
回复
举报
0 个回复
正序浏览
返回列表
快速回复
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
or
立即注册
本版积分规则
发表回复
回帖并转播
发新帖
回复
愛在花開的季節
论坛元老
这个人很懒什么都没写!
楼主热帖
【网络进阶】网络问题排查实例集锦(实 ...
流批一体开源项目ChunJun技术公开课— ...
Socket的长连接和短连接
走好数据中台最后一公里,为什么说数据 ...
Redis 原理 - Hash
Flink 作业提交流程
数据库设计的步骤
一次服务器被入侵的处理过程分享 ...
RadonDB MySQL Kubernetes 2.2.0 发布 ...
HA启动Advanced SSH & Web Terminal 提 ...
标签云
运维
CIO
存储
服务器
快速回复
返回顶部
返回列表