AI helps you write code - Copilot experience

AI helps you write code - Copilot experience

Introduction

Github Copilot

English class

  • pilot pronunciation [ˈpaɪlət]pilot
  • copilot pronunciation [ˈkoˌpaɪlət]aircraft co-pilot

co-Prefix com-, a variant of prefix, indicates auxiliary, common, complementary, and similar words include:

  • operation operation
  • cooperation, cooperation

Github Copilot

copilot.github.com/

Your AI pair programmer, your AI programming partner. Suggestions for entire lines or complete functions are available in the editor.

Trained on billions of lines of open source code to put the knowledge you need at your fingertips, saving you time and helping you stay focused.

Powered by OpenAI

OpenAI is a non-profit artificial intelligence (AI) research organization whose purpose is to promote and develop friendly artificial intelligence for the benefit of humanity as a whole. Founded in late 2015 and headquartered in San Francisco, OpenAI aims to open patents and research results to the public through "free collaboration" with other institutions and researchers. Founders Elon Musk and Sam Altman were motivated by concerns about the potential risks of strong AI.

As of 2018, OpenAI was headquartered in the Mission District of San Francisco, in the same office building as Elon Musk's other company, Neuralink. [8]

On July 22, 2019, Microsoft invested $1 billion in OpenAI , and the two parties will work together to develop artificial intelligence technology for Azure cloud platform services. The GPT-3 language model was announced on June 11, 2020, and Microsoft licensed it exclusively on September 22, 2020 .

Features:

  • Editor, ide extension plug-in
  • Know almost all programming languages ​​and frameworks
  • You are the driver, copilot offers advice and sticks to your code style

features

Complete code based on function name

I type

const bubbleSort
复制代码

Complete code based on comments

I type

// 邮箱正则

// 检查邮箱
复制代码

generate code

// 邮箱正则
var email_reg = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;

// 检查邮箱
function check_email(email) {
    if (!email_reg.test(email)) {
        return false;
    }
    return true;
}
复制代码

I type

/**
 * once a week
 */
复制代码

autocompletion

/**
 * once a week
 */
export const onceAWeek = (key: string, callback: () => void) => {
  const now = new Date().getTime();
  const last = localStorage.getItem(key);
  if (last) {
    const lastTime = Number(last);
    if (now - lastTime < 7 * 24 * 60 * 60 * 1000) {
      return;
    }
  }
  localStorage.setItem(key, now.toString());
  callback();
}
复制代码

Complete code line by line based on context

A request interface is required in a Service class, which refers to my other code and completes what I want to write line by line

Just guess what the next line of code is

Inside a utilsfile , constafter I typed , it guessed my next code

How it works

Frequently asked questions

copilot.github.com/#faq-will-m…

Will my private code be shared with other users?

No. We use telemetry data, including information about which suggestions users accept or reject, to improve the model. Your private code is not used as suggested code for other users of GitHub Copilot.

Won't. We use telemetry data, including information about which suggestions users accept or reject, to improve the model. Your private code will not be used as suggested code by other users of GitHub Copilot.

Privacy and data security related copilot.github.com/#faq-privac…

summary

In general, GitHub Copilot is a very useful code generation tool, suitable for generating high-frequency code for common tool code, leetcode algorithm, unit testing and other scenarios. . The business code may not be accurate enough, and there may be data security risks. You can try it early, it is currently in the testing stage and has not yet been released.

Guess you like

Origin juejin.im/post/7086795615488720909