码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • vscode结合GitHub Copilot编码


    已集成工具

    • Azure Data Studio
    • JetBrains IDEs
    • Vim/Neovim
    • Visual Studio
    • Visual Studio Code

    目录

    • GitHub Copilot & Visual Studio Code

    • 前提条件

    • Getting code suggestions

    • Showing alternative suggestions

    • Showing multiple suggestions in a new tab

    • Accepting partial suggestions

    • Next steps

    支持试用一个月

    GitHub Copilot & Visual Studio Code

    在vscode中利用github copilot支持 Python, JavaScript, TypeScript, Ruby, Go, C# and C++等多种语言, GitHub Copilot 支持sql语句生成,框架使用,api建议等

    前提条件

    • 订阅Copilot. 参见 "About GitHub Copilot."

    • 安装Visual Studio Code. 参见 Visual Studio Code download page.

    • 安装Copilot 插件. 参见 "Set up GitHub Copilot in Visual Studio Code" .

    GitHub Copilot offers coding suggestions as you type. For example, type this function header in a JavaScript file:

    JavaScript

    1. function calculateDaysBetweenDates(begin, end) {

    GitHub Copilot will automatically suggest the rest of the function. To accept the suggestion, press Tab.

    You can also describe something you want to do using natural language within a comment, and Copilot will suggest the code to accomplish your goal. For example, type this comment in a JavaScript file:

    JavaScript

    1. // write a function to
    2. // find all images without alternate text
    3. // and give them a red border

    GitHub Copilot will automatically suggest code. To accept the suggestion, press Tab.

    Tip

    If you receive limited or no suggestions from Copilot, you may have duplication detection enabled. For more information about duplication detection, see "Managing Copilot policies as an individual subscriber."

    Showing alternative suggestions

    For any given input, GitHub Copilot may offer multiple suggestions. You can select which suggestion to use, or reject all suggestions.

    For example, type this function header in a JavaScript file, and press Enter:

    JavaScript

    1. function calculateDaysBetweenDates(begin, end) {

    GitHub Copilot will show you a suggestion.

    Now hover over the suggestion to show the GitHub Copilot control for choosing suggestions. To display next or previous suggestions, click the forward or back arrow button in the control.

    You can also use keyboard shortcuts to show alternative suggestions:

    OSSee next suggestionSee previous suggestion
    macOSOption (⌥) or Alt+]Option (⌥) or Alt+[
    Windows or LinuxAlt+]Alt+[

    To accept a suggestion, click "Accept" in the Copilot command palette, or press Tab. To reject all suggestions, press Esc.

    Showing multiple suggestions in a new tab

    If you don't want to use any of the initial suggestions GitHub Copilot offers, you can show multiple suggestions in a new tab.

    For example, type this function header in a JavaScript file, and press Enter:

    JavaScript

    1. function calculateDaysBetweenDates(begin, end) {

    GitHub Copilot will show you a suggestion. Now press Ctrl+Enter to open a new tab with multiple additional options.

    To accept a suggestion, below the suggestion, click Accept suggestion NUMBER. To reject all suggestions, close the tab.

    Accepting partial suggestions

    If you don't want to accept an entire suggestion from GitHub Copilot, you can accept the next word or the next line of a suggestion.

    For example, type this function header in a JavaScript file, and press Enter:

    JavaScript

    1. function calculateDaysBetweenDates(begin, end) {

    GitHub Copilot will automatically suggest an entire function body in grayed text. The exact suggestion may vary.

    Now hover over the suggestion to show the GitHub Copilot control for choosing suggestions. To accept only the next word of the suggestion, click Accept Word in the control.

    Alternatively, you can use a keyboard shortcut to accept the next word of a suggestion:

    OSAccept Next Word
    macOSCommand+→
    Windows or LinuxControl+→

    If you want to accept the next line of a suggestion, you will need to set a custom keyboard shortcut for the command editor.action.inlineSuggest.acceptNextLine. For more information on setting custom keyboard shortcuts, see "Configuring GitHub Copilot in your environment."

  • 相关阅读:
    新学期,新FLAG | 尽人事,听天命,守得云开见月明
    数据结构——栈的详细介绍
    系统安全及应用
    HTML5期末考核大作业,网站——青岛民俗 7页。 美丽家乡 学生旅行 游玩 主题住宿网页
    mysql
    【c++20】‘std::allocator<char>::allocate‘: function does not take 2 arguments
    【golang】error parsing regexp: invalid or unsupported Perl syntax (正则表达式校验密码)
    ChatkBQA:一个基于大语言模型的知识库问题生成-检索框架11.13
    哪些 GPTs 应用让我眼前一亮?你又该如何找到它们?
    城市燃气价格体系及计量、计费
  • 原文地址:https://blog.csdn.net/u012273398/article/details/139839637
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号