Skip to main content

Getting started with GitHub Copilot

이 문서의 내용

You can start using GitHub Copilot by installing the extension in your preferred environment.

GitHub Copilot은(는) GitHub Copilot Individual을(를) 사용하여 개인 계정 또는 GitHub Copilot Business을(를) 사용하는 조직 계정으로 관리할 수 있습니다.

GitHub Copilot은 인기 있는 오픈 소스 프로젝트의 검증된 학생, 교사 및 유지 관리자가 무료로 사용할 수 있습니다. 인기 있는 오픈 소스 프로젝트의 학생, 교사나 유지 관리자가 아닌 경우 GitHub Copilot을 1회에 한해 무료로 30일 동안 사용해 볼 수 있습니다. 평가판이 끝난 후에 계속 사용하려면 유료로 구독해야 합니다. 자세한 내용은 "GitHub Copilot 청구 정보"을 참조하세요.

GitHub Copilot 을(를) 사용해 보세요.

About GitHub Copilot and JetBrains IDEs

GitHub Copilot은 코딩할 때 AI 쌍 프로그래머의 자동 완성 스타일 제안을 제공합니다. 자세한 내용은 "GitHub Copilot Individual 정보"을(를) 참조하세요.

If you use a JetBrains IDE, you can view and incorporate suggestions from GitHub Copilot directly within the editor. This guide demonstrates how to use GitHub Copilot within a JetBrains IDE for macOS, Windows, or Linux.

Prerequisites

  • GitHub Copilot을(를) 사용하려면 활성 GitHub Copilot 구독이 필요합니다. 자세한 내용은 "GitHub Copilot 청구 정보"을 참조하세요.

  • To use GitHub Copilot in JetBrains, you must have a compatible JetBrains IDE installed. GitHub Copilot is compatible with the following IDEs:

    • IntelliJ IDEA (Ultimate, Community, Educational)
    • Android Studio
    • AppCode
    • CLion
    • Code With Me Guest
    • DataGrip
    • DataSpell
    • GoLand
    • JetBrains Client
    • MPS
    • PhpStorm
    • PyCharm (Professional, Community, Educational)
    • Rider
    • RubyMine
    • RustRover
    • WebStorm

    For more information, see the JetBrains IDEs tool finder.

Installing the GitHub Copilot plugin in your JetBrains IDE

To use GitHub Copilot in a JetBrains IDE, you must install the GitHub Copilot extension. The following procedure will guide you through installation of the GitHub Copilot plugin in IntelliJ IDEA. Steps to install the plugin in another supported IDE may differ.

  1. In your JetBrains IDE, under the File menu for Windows, or under the name of your IDE for Mac (for example, PyCharm or IntelliJ), click Settings.

  2. In the left-side menu of the Settings dialog box, click Plugins.

  3. At the top of the Settings dialog box, click Marketplace. In the search bar, search for copilot, then click Install.

    Screenshot of the "Settings" window. A tab labeled "Marketplace" is highlighted with an orange outline. In a list of search results, the installed "GitHub Copilot" plugin is marked by a selected checkbox.

  4. After GitHub Copilot is installed, click Restart IDE.

  5. After your JetBrains IDE has restarted, click the Tools menu. Click GitHub Copilot, then click Login to GitHub.

    Screenshot of the expanded "Tools" menu and "GitHub Copilot" sub-menu. The "Login to GitHub" option is highlighted in blue.

  6. In the "Sign in to GitHub" dialog box, to copy the device code and open the device activation window, click Copy and Open.

    Screenshot of the "Sign in to GitHub" dialog. A device code is displayed above a button labeled "Copy and Open".

  7. A device activation window will open in your browser. Paste the device code, then click Continue.

  8. GitHub will request the necessary permissions for GitHub Copilot. To approve these permissions, click Authorize GitHub Copilot Plugin.

  9. After the permissions have been approved, your JetBrains IDE will show a confirmation. To begin using GitHub Copilot, click OK.

Seeing your first suggestion

참고: GitHub Copilot에 대해 중복 검색을 사용하도록 설정한 경우 제공된 코드 예제를 사용할 때 제안이 제한되거나 제안되지 않을 수 있습니다. 또는 사용자 고유의 코드를 입력하여 GitHub Copilot의 제안을 볼 수 있습니다. 중복 검색에 대한 자세한 내용은 "GitHub.com에서 GitHub Copilot 설정 구성"을 참조하세요.

GitHub Copilot은 다양한 언어와 광범위한 프레임워크에 대한 제안을 제공하지만 Python, JavaScript, TypeScript, Ruby, Go, C# 및 C++에서 특히 잘 작동합니다. GitHub Copilot은(는) 데이터베이스에 대한 쿼리 생성에도 도움이 될 수 있습니다. The following samples are in Java, but other languages will work similarly.

  1. JetBrains IDE에서 새 Java(*.java) 파일을 만듭니다.

  2. In the Java file, create a class by typing class Test. GitHub Copilot will automatically suggest a class body in grayed text. The exact suggestion may vary.

  3. 제안을 수락하려면 Tab 키를 누릅니다.

  4. To prompt GitHub Copilot to suggest a function body, type the following line below the bracket of the main function. The exact suggestion may vary.

    Java
    int calculateDaysBetweenDates(
    
  5. 제안을 수락하려면 Tab 키를 누릅니다.

GitHub Copilot will attempt to match the context and style of your code. You can always edit the suggested code.

Seeing alternative suggestions

GitHub Copilot이 특정 입력에 대해 여러 제안을 제공할 수 있습니다. 사용할 제안을 선택하거나 모든 제안을 거부할 수 있습니다.

  1. JetBrains IDE에서 새 Java(*.java) 파일을 만듭니다.

  2. To prompt GitHub Copilot to show you a suggestion, type the following line in the Java file.

    Java
    int calculateDaysBetweenDates(
    
    1. 필요에 따라 대체 제안을 볼 수 있습니다(사용할 수 있는 경우).
    OSSee next suggestionSee previous suggestion
    macOSOption+]Option+[
    WindowsAlt+]Alt+[
    LinuxAlt+]Alt+[
  3. 제안을 수락하려면 Tab 키를 누릅니다. 모든 제안을 거부하려면 Esc 키를 누릅니다.

Partially accepting suggestions

You may not want to accept an entire suggestion from GitHub Copilot. You can use keyboard shortcuts to accept either the next word of a suggestion, or the next line.

  1. JetBrains IDE에서 새 Java(*.java) 파일을 만듭니다.

  2. To prompt GitHub Copilot to show you a suggestion, type the following line in the Java file.

    Java
    int calculateDaysBetweenDates(
    
  3. To accept a part of the suggestion, use one of the following keyboard shortcuts.

    OSAccept Next WordAccept Next Line
    macOSCommand+Command+Control+
    WindowsControl+Control+Alt+
    LinuxControl+Control+Alt+
  4. Alternatively, you can hover over the suggestion to see the GitHub Copilot command palette for choosing suggestions.

Seeing multiple suggestions in a new tab

초기 제안 GitHub Copilot의 제안 내용을 원하지 않을 수 있습니다. 바로 가기 키를 사용하여 GitHub Copilot에서 새 탭에 여러 제안 사항을 표시하도록 지정할 수 있습니다.

  1. JetBrains IDE에서 새 Java(*.java) 파일을 만듭니다.

  2. To prompt GitHub Copilot to show you a suggestion, type the following line in the Java file.

    Java
    int calculateDaysBetweenDates(
    
  3. Open a new tab with multiple additional suggestions.

    • On macOS, press Command+Shift+A, then click Open GitHub Copilot, or press Command+Shift+</kbd> to open the new tab immediately.
    • On Windows or Linux, press Ctrl+Enter, then click Open GitHub Copilot.
  4. To accept a suggestion, above the suggestion, click Accept Solution. To reject all suggestions, close the tab.

Generating code suggestions from comments

주석 내에서 자연어를 사용하여 수행할 작업을 설명할 수 있으며, GitHub Copilot은 목표를 달성하기 위한 코드를 제안합니다.

  1. JetBrains IDE에서 새 Java(*.java) 파일을 만듭니다.

  2. To prompt GitHub Copilot to suggest an implementation of a function in the Java file, type the following lines.

    Java
    // find all images without alternate text
    // and give them a red border
    void process () {
    

Enabling and disabling GitHub Copilot

You can enable or disable GitHub Copilot for all languages, or for individual languages. The GitHub Copilot status icon in the bottom panel of your JetBrains IDE window indicates whether GitHub Copilot is enabled or disabled. When enabled, the icon is highlighted. When disabled, the icon is grayed out.

  1. To enable or disable GitHub Copilot, click the status icon in the bottom panel of the JetBrains window.

    Screenshot of the IntelliJ IDEA toolbar. The GitHub Copilot logo is highlighted with an orange outline.

  2. If you are disabling GitHub Copilot, you will be asked whether you want to disable it globally, or for the language of the file you are currently editing.

    • To disable suggestions from GitHub Copilot globally, click Disable Completions.
    • To disable suggestions from GitHub Copilot for the specified language, click Disable Completions for LANGUAGE.

    Screenshot of option to disable GitHub Copilot globally or for the current language.

About GitHub Copilot and Visual Studio

GitHub Copilot은 코딩할 때 AI 쌍 프로그래머의 자동 완성 스타일 제안을 제공합니다. 자세한 내용은 "GitHub Copilot Individual 정보"을(를) 참조하세요.

If you use Visual Studio, you can view and incorporate suggestions from GitHub Copilot directly within the editor. This guide demonstrates how to use GitHub Copilot within Visual Studio for Windows.

Prerequisites

  • GitHub Copilot을(를) 사용하려면 활성 GitHub Copilot 구독이 필요합니다. 자세한 내용은 "GitHub Copilot 청구 정보"을 참조하세요.

  • To use GitHub Copilot in Visual Studio, you must have Visual Studio 2022 17.6 or later installed. For more information, see the Visual Studio IDE documentation.

참고: GitHub Copilot은 현재 Mac용 Visual Studio를 통해 사용할 수 없습니다.

Installing the GitHub Copilot extension in Visual Studio

To use GitHub Copilot, you must first install the GitHub Copilot extension.

  1. Visual Studio 메뉴 모음에서 확장을 클릭한 다음 확장 관리를 클릭합니다.

    Visual Studio의 메뉴 모음 스크린샷입니다. "익스텐션" 메뉴가 열리고 "확장 관리" 옵션이 주황색 윤곽선으로 하이라이트됩니다.

  2. In the "Manage Extensions" window, click Visual Studio Marketplace, search for the GitHub Copilot extension, then click Download.

    Screenshot of a list of search results. Next to the GitHub Copilot extension, the "Download" button is highlighted with an orange outline.

  3. “확장 관리” 창을 닫은 다음 Visual Studio를 종료하고 다시 시작합니다.

  4. Optionally, to check that GitHub Copilot is installed and enabled, go back to Manage Extensions, click Installed to view your currently installed extensions, then click GitHub Copilot to see status information.

    Screenshot of a list of installed extensions in Visual Studio. The "GitHub Copilot" extension is highlighted with an orange outline.

  5. Open or create a new project in Visual Studio.

  6. To enable GitHub Copilot, ensure you have added your GitHub account to Visual Studio. For more information, see Work with GitHub accounts in Visual Studio in the Microsoft documentation.

Seeing your first suggestion

참고: GitHub Copilot에 대해 중복 검색을 사용하도록 설정한 경우 제공된 코드 예제를 사용할 때 제안이 제한되거나 제안되지 않을 수 있습니다. 또는 사용자 고유의 코드를 입력하여 GitHub Copilot의 제안을 볼 수 있습니다. 중복 검색에 대한 자세한 내용은 "GitHub.com에서 GitHub Copilot 설정 구성"을 참조하세요.

GitHub Copilot은 다양한 언어와 광범위한 프레임워크에 대한 제안을 제공하지만 Python, JavaScript, TypeScript, Ruby, Go, C# 및 C++에서 특히 잘 작동합니다. GitHub Copilot은(는) 데이터베이스에 대한 쿼리 생성에도 도움이 될 수 있습니다. The following samples are in C#, but other languages will work similarly.
  1. Visual Studio에서 새 C#(*.cs) 파일을 만듭니다.

  2. In the C# file, type the following function signature. GitHub Copilot will automatically suggest an entire function body in grayed text, as shown below. The exact suggestion may vary.

    C#
    int CalculateDaysBetweenDates(
    
  3. 제안을 수락하려면 Tab 키를 누릅니다.

Seeing alternative suggestions

GitHub Copilot이 특정 입력에 대해 여러 제안을 제공할 수 있습니다. 사용할 제안을 선택하거나 모든 제안을 거부할 수 있습니다.

  1. Visual Studio에서 새 C#(*.cs) 파일을 만듭니다.

  2. In the C# file, type the following function signature. GitHub Copilot will show you a suggestion.

    C#
    int CalculateDaysBetweenDates(
    
  3. If alternative suggestions are available, you can see these alternatives by pressing Alt+. (or Alt+,).

  4. Optionally, you can hover over the suggestion to see the GitHub Copilot command palette for choosing suggestions.

    1. 제안을 수락하려면 Tab 키를 누릅니다. 모든 제안을 거부하려면 Esc 키를 누릅니다.

Generating code suggestions from comments

주석 내에서 자연어를 사용하여 수행할 작업을 설명할 수 있으며, GitHub Copilot은 목표를 달성하기 위한 코드를 제안합니다.

  1. Visual Studio에서 새 C#(*.cs) 파일을 만듭니다.

  2. In the C# file, type the following comment. GitHub Copilot will suggest an implementation of the function.

    C#
    using System.Xml.Linq;
    
    var doc = XDocument.Load("index.xhml");
    
    // find all images
    
  3. 제안을 수락하려면 Tab 키를 누릅니다.

GitHub Copilot 사용 또는 사용 안 함

Visual Studio 창의 아래쪽 패널에 있는 GitHub Copilot 상태 아이콘은 GitHub Copilot이 사용하도록 설정되었는지 여부를 나타냅니다. 사용하도록 설정하면 아이콘의 배경색이 상태 표시줄의 색과 일치합니다. 사용하지 않도록 설정하면 통과하는 대각선이 표시됩니다.

  1. GitHub Copilot을 사용하거나 사용하지 않도록 설정하려면 Visual Studio 창의 아래쪽 패널에서 GitHub Copilot 아이콘을 클릭합니다.

    GitHub Copilot 아이콘이 강조 표시된 Visual Studio의 편집기 여백 스크린샷입니다.

  2. GitHub Copilot을 사용하지 않도록 설정하는 경우 전역적으로 또는 현재 편집 중인 파일의 언어에 대해 제안을 사용하지 않도록 설정할지 묻는 메시지가 표시됩니다.

    • GitHub Copilot에서 제안을 전역적으로 사용하지 않도록 설정하려면 전역적으로 사용을 클릭합니다.
    • 지정된 언어에 대한 GitHub Copilot에서 제안을 사용하지 않으려면 언어에 대해 사용을 클릭합니다.

About GitHub Copilot and Visual Studio Code

GitHub Copilot은 코딩할 때 AI 쌍 프로그래머의 자동 완성 스타일 제안을 제공합니다. 자세한 내용은 "GitHub Copilot Individual 정보"을(를) 참조하세요.

If you use Visual Studio Code, you can view and incorporate suggestions from GitHub Copilot directly within the editor. This guide demonstrates how to use GitHub Copilot within Visual Studio Code for macOS, Windows, or Linux.

Prerequisites

  • GitHub Copilot을(를) 사용하려면 활성 GitHub Copilot 구독이 필요합니다. 자세한 내용은 "GitHub Copilot 청구 정보"을 참조하세요.

  • To use GitHub Copilot in Visual Studio Code, you must have Visual Studio Code installed. For more information, see the Visual Studio Code download page.

Installing the GitHub Copilot extension in Visual Studio Code

To use GitHub Copilot, you must first install the GitHub Copilot extension.

  1. In the Visual Studio Code Marketplace, go to the GitHub Copilot extension page and click Install.

  2. A popup will appear, asking to open Visual Studio Code. Click Open Visual Studio Code.

  3. In the "Extension: GitHub Copilot" tab in Visual Studio Code, click Install.

  4. If you have not previously authorized Visual Studio Code in your GitHub account, you will be prompted to sign in to GitHub in Visual Studio Code.

    • If you have previously authorized Visual Studio Code for your account on GitHub, GitHub Copilot will be automatically authorized.

    • If you don't get the prompt to authorize, click the bell icon in the bottom panel of the Visual Studio Code window.

      Screenshot of the Visual Studio Code task bar with GitHub Copilot icons. The bell icon is outlined in dark orange.

  5. In your browser, GitHub will request the necessary permissions for GitHub Copilot. To approve these permissions, click Authorize Visual Studio Code.

  6. To confirm the authentication, in Visual Studio Code, in the "Visual Studio Code" dialog box, click Open.

Seeing your first suggestion

참고: GitHub Copilot에 대해 중복 검색을 사용하도록 설정한 경우 제공된 코드 예제를 사용할 때 제안이 제한되거나 제안되지 않을 수 있습니다. 또는 사용자 고유의 코드를 입력하여 GitHub Copilot의 제안을 볼 수 있습니다. 중복 검색에 대한 자세한 내용은 "GitHub.com에서 GitHub Copilot 설정 구성"을 참조하세요.

GitHub Copilot은 다양한 언어와 광범위한 프레임워크에 대한 제안을 제공하지만 Python, JavaScript, TypeScript, Ruby, Go, C# 및 C++에서 특히 잘 작동합니다. GitHub Copilot은(는) 데이터베이스에 대한 쿼리 생성에도 도움이 될 수 있습니다. The following samples are in JavaScript, but other languages will work similarly.

  1. Visual Studio Code에서 새 JavaScript(*.js) 파일을 만듭니다.

  2. In the JavaScript file, type the following function header. GitHub Copilot will automatically suggest an entire function body in grayed text, as shown below. The exact suggestion may vary.

    JavaScript
    function calculateDaysBetweenDates(begin, end) {
    
  3. 제안을 수락하려면 Tab 키를 누릅니다.

Note: If you don't see a suggestion, make sure GitHub Copilot is enabled. You should see the Copilot icon at the bottom right of the Visual Studio Code window.

파일이 GitHub Copilot에 대해 제외된 콘텐츠로 구성된 경우 상태 표시줄의 아이콘에 대각선이 표시됩니다. 아이콘을 마우스로 가리키면 이 제한을 적용한 설정을 알려주는 도구 설명이 표시됩니다.

콘텐츠 제외 도구 설명이 있는 VS Code의 Copilot 아이콘 스크린샷

자세한 내용은 "GitHub Copilot의 콘텐츠 제외 구성"을(를) 참조하세요.

Seeing alternative suggestions

GitHub Copilot이 특정 입력에 대해 여러 제안을 제공할 수 있습니다. 사용할 제안을 선택하거나 모든 제안을 거부할 수 있습니다.

  1. Visual Studio Code에서 새 JavaScript(*.js) 파일을 만듭니다.

  2. In the JavaScript file, type the following function header. GitHub Copilot will show you a suggestion.

    JavaScript
    function calculateDaysBetweenDates(begin, end) {
    
  3. 필요에 따라 대체 제안을 볼 수 있습니다(사용할 수 있는 경우).

    OSSee next suggestionSee previous suggestion
    macOSOption (⌥) or Alt+]Option (⌥) or Alt+[
    WindowsAlt+]Alt+[
    LinuxAlt+]Alt+[
  4. Alternatively, you can hover over the suggestion to see the GitHub Copilot command palette for choosing suggestions.

  5. 제안을 수락하려면 Tab 키를 누릅니다. 모든 제안을 거부하려면 Esc 키를 누릅니다.

Partially accepting suggestions

You may not want to accept an entire suggestion from GitHub Copilot. You can use keyboard shortcuts to accept either the next word of a suggestion, or the next line.

  1. Visual Studio Code에서 새 JavaScript(*.js) 파일을 만듭니다.

  2. In the JavaScript file, type the following function header. GitHub Copilot will automatically suggest an entire function body in grayed text, as shown below. The exact suggestion may vary.

    JavaScript
    function calculateDaysBetweenDates(begin, end) {
    
  3. If you want to accept only the next word of the suggestion, use one of the following keyboard shortcuts.

    OSAccept Next Word
    macOSCommand+
    WindowsControl+
    LinuxControl+
  4. If you want to accept the next line of the 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 "사용자 환경에서 GitHub Copilot 구성하기."

  5. Alternatively, you can hover over the suggestion to see the GitHub Copilot command palette for choosing suggestions.

Seeing multiple suggestions in a new tab

초기 제안 GitHub Copilot의 제안 내용을 원하지 않을 수 있습니다. 바로 가기 키를 사용하여 GitHub Copilot에서 새 탭에 여러 제안 사항을 표시하도록 지정할 수 있습니다.

  1. Visual Studio Code에서 새 JavaScript(*.js) 파일을 만듭니다.

  2. In the JavaScript file, type the following function header. GitHub Copilot will show you a suggestion.

    JavaScript
    function calculateDaysBetweenDates(begin, end) {
    
  3. To open a new tab with multiple additional options, press Ctrl+Enter.

  4. To accept a suggestion, above the suggestion, click Accept Solution. To reject all suggestions, close the tab.

Generating code suggestions from comments

주석 내에서 자연어를 사용하여 수행할 작업을 설명할 수 있으며, GitHub Copilot은 목표를 달성하기 위한 코드를 제안합니다.

  1. Visual Studio Code에서 새 JavaScript(*.js) 파일을 만듭니다.

  2. In the JavaScript file, type the following comment. GitHub Copilot will suggest an implementation of the function.

    JavaScript
    // find all images without alternate text
    // and give them a red border
    function process() {
    

Using a framework

You can also use GitHub Copilot to generate suggestions for APIs and frameworks. The following example uses GitHub Copilot to create a simple Express server that returns the current time.

  1. Visual Studio Code에서 새 JavaScript(*.js) 파일을 만듭니다.

  2. In the JavaScript file, type the following comment and then press Enter. GitHub Copilot will suggest an implementation of the Express app.

    JavaScript
    // Express server on port 3000
    
  3. To accept each line, press Tab, then Enter.

  4. Type the following comment and then press Enter. GitHub Copilot will suggest an implementation for the default handler.

    JavaScript
    // Return the current time
    
  5. To accept each line, press Tab.

GitHub Copilot 사용 또는 사용 안 함

Visual Studio Code에서 GitHub Copilot을 사용하거나 사용하지 않도록 설정할 수 있습니다. Visual Studio Code 창의 아래쪽 패널에 있는 GitHub Copilot 상태 아이콘은 GitHub Copilot이 사용하도록 설정되었는지 여부를 나타냅니다. 사용하도록 설정하면 아이콘의 배경색이 상태 표시줄의 색과 일치합니다. 사용하지 않도록 설정하면 아이콘의 배경색이 상태 표시줄의 색과 대비됩니다.

  1. GitHub Copilot을 사용하거나 사용하지 않도록 설정하려면 Visual Studio Code 창의 아래쪽 패널에서 상태 아이콘을 클릭합니다.

    Visual Studio Code의 하단 패널 스크린샷입니다. GitHub Copilot 아이콘은 진한 주황색으로 표시됩니다.

  2. GitHub Copilot을 사용하지 않도록 설정하는 경우 전역적으로 또는 현재 편집 중인 파일의 언어에 대해 제안을 사용하지 않도록 설정할지 묻는 메시지가 표시됩니다.

    • GitHub Copilot에서 제안을 전역적으로 사용하지 않도록 설정하려면 전역적으로 사용하지 않음을 클릭합니다.
    • 지정된 언어에 대한 GitHub Copilot에서 제안을 사용하지 않으려면 언어에 대해 사용하지 않음을 클릭합니다. 전역적으로 또는 현재 언어에 대해 GitHub Copilot을 사용하지 않도록 설정하는 옵션의 스크린샷입니다.

About GitHub Copilot and Vim/Neovim

GitHub Copilot은 코딩할 때 AI 쌍 프로그래머의 자동 완성 스타일 제안을 제공합니다. 자세한 내용은 "GitHub Copilot Individual 정보"을(를) 참조하세요.

If you use Vim/Neovim, you can view and incorporate suggestions from GitHub Copilot directly within the editor.

Prerequisites

  • GitHub Copilot을(를) 사용하려면 활성 GitHub Copilot 구독이 필요합니다. 자세한 내용은 "GitHub Copilot 청구 정보"을 참조하세요.

  • To use GitHub Copilot in Vim/Neovim you must have Vim version 9.0.0185 / Neovim version 0.6 or above and Node.js version 18 or above installed. For more information, see the Vim / Neovim documentation and the Node.js website.

Installing the GitHub Copilot extension in Vim/Neovim on macOS

  1. GitHub에서는 Vim/Neovim의 기본 제공 플러그 인 관리자를 사용하여 GitHub Copilot 플러그인을 설치하는 것이 좋습니다. 또는 선택한 플러그 인 관리자를 사용하여 github/copilot.vim을(를) 설치할 수 있습니다.
  • To install GitHub Copilot with Vim's built-in plugin manager, enter the following command in Terminal:

    git clone https://github.com/github/copilot.vim \
       ~/.vim/pack/github/start/copilot.vim
    
  • To install GitHub Copilot with Neovim's built-in plugin manager, enter the following command in Terminal:

    git clone https://github.com/github/copilot.vim \
       ~/.config/nvim/pack/github/start/copilot.vim
    
  1. GitHub Copilot을 구성하려면 Vim/Neovim을 열고 다음 명령을 입력합니다.

    :Copilot setup
    
  2. Vim/Neovim 구성 또는 Vim/Neovim 명령을 사용하여 GitHub Copilot을(를) 사용하도록 설정합니다.

    :Copilot enable
    

Installing the GitHub Copilot extension in Vim/Neovim on Windows

  1. GitHub에서는 Vim/Neovim의 기본 제공 플러그 인 관리자를 사용하여 GitHub Copilot 플러그인을 설치하는 것이 좋습니다. 또는 선택한 플러그 인 관리자를 사용하여 github/copilot.vim을(를) 설치할 수 있습니다.
  • To install GitHub Copilot with Vim's built-in plugin manager, enter the following command in Git Bash:

      git clone https://github.com/github/copilot.vim.git \
       $HOME/vimfiles/pack/github/start/copilot.vim
    
  • To install GitHub Copilot with Neovim's built-in plugin manager, enter the following command in Git Bash:

      git clone https://github.com/github/copilot.vim.git \
       $HOME/AppData/Local/nvim/pack/github/start/copilot.vim
    
  1. GitHub Copilot을 구성하려면 Vim/Neovim을 열고 다음 명령을 입력합니다.

    :Copilot setup
    
  2. Vim/Neovim 구성 또는 Vim/Neovim 명령을 사용하여 GitHub Copilot을(를) 사용하도록 설정합니다.

    :Copilot enable
    

Installing the GitHub Copilot extension in Vim/Neovim on Linux

  1. GitHub에서는 Vim/Neovim의 기본 제공 플러그 인 관리자를 사용하여 GitHub Copilot 플러그인을 설치하는 것이 좋습니다. 또는 선택한 플러그 인 관리자를 사용하여 github/copilot.vim을(를) 설치할 수 있습니다.
  • To install GitHub Copilot with Vim's built-in plugin manager, enter the following command:

    git clone https://github.com/github/copilot.vim \
       ~/.vim/pack/github/start/copilot.vim
    
  • To install GitHub Copilot with Neovim's built-in plugin manager, enter the following command:

    git clone https://github.com/github/copilot.vim \
       ~/.config/nvim/pack/github/start/copilot.vim
    
  1. GitHub Copilot을 구성하려면 Vim/Neovim을 열고 다음 명령을 입력합니다.

    :Copilot setup
    
  2. Vim/Neovim 구성 또는 Vim/Neovim 명령을 사용하여 GitHub Copilot을(를) 사용하도록 설정합니다.

    :Copilot enable
    

Learning to use GitHub Copilot in Vim/Neovim

For guidance on using GitHub Copilot in Vim/Neovim, you can view the plugin documentation. To see the documentation, open Vim/Neovim and run the following command:

:help copilot

About GitHub Copilot and Azure Data Studio

GitHub Copilot은 코딩할 때 AI 쌍 프로그래머의 자동 완성 스타일 제안을 제공합니다. 자세한 내용은 "GitHub Copilot Individual 정보"을(를) 참조하세요.

If you use Azure Data Studio, you can view and incorporate suggestions from GitHub Copilot directly within the editor. This guide demonstrates how to use GitHub Copilot within Azure Data Studio for macOS, Windows, or Linux.

Prerequisites

  • GitHub Copilot을(를) 사용하려면 활성 GitHub Copilot 구독이 필요합니다. 자세한 내용은 "GitHub Copilot 청구 정보"을 참조하세요.

  • To use GitHub Copilot in Azure Data Studio, you must have Azure Data Studio version 1.44.0 or later installed. For more information, see the Azure Data Studio download page in the Azure Data Studio documentation.

Installing the GitHub Copilot extension in Azure Data Studio

To use GitHub Copilot, you must first install the GitHub Copilot extension.

  1. In Azure Data Studio, click the Extensions icon in the left-side menu.

    Screenshot of the Azure Data Studio left-side menu. The "Extensions" icon is highlighted with an orange outline.

  2. In the "Extensions" tab, search for GitHub Copilot and then click Install.

  3. If a popup window in Azure Data Studio prompts you to sign in to use GitHub Copilot, click Sign in to GitHub and follow the instructions on screen.

    • If you have previously authorized Azure Data Studio for your account on GitHub, GitHub Copilot will be automatically authorized.
    • If you don't get the prompt to authorize, you can view notifications by clicking the bell icon in the bottom panel of the Azure Data Studio window.
  4. If you are following the authorization steps, in your browser, GitHub will request the necessary permissions for GitHub Copilot. To approve these permissions, click Authorize Azure Data Studio.

Seeing your first suggestion

참고: GitHub Copilot에 대해 중복 검색을 사용하도록 설정한 경우 제공된 코드 예제를 사용할 때 제안이 제한되거나 제안되지 않을 수 있습니다. 또는 사용자 고유의 코드를 입력하여 GitHub Copilot의 제안을 볼 수 있습니다. 중복 검색에 대한 자세한 내용은 "GitHub.com에서 GitHub Copilot 설정 구성"을 참조하세요.

GitHub Copilot can provide you with inline suggestions as you create SQL databases in Azure Data Studio. For example, if you're writing a query that joins two tables, Copilot may suggest the join condition from columns in the open editor, other files in the workspace, and common syntax patterns.

  1. Azure Data Studio에서 새 SQL 파일을 만듭니다.

  2. In the SQL file, type the following query. GitHub Copilot will automatically suggest a join condition in grayed text. The exact suggestion may vary.

    SQL
    SELECT [UserId], [Red], [Orange], [Yellow], [Green], [Blue], [Purple], [Rainbow]
    FROM [Tag].[Scoreboard]
    INNER JOIN
    
  3. 제안을 수락하려면 Tab 키를 누릅니다.

Seeing alternative suggestions

For some suggestions, GitHub Copilot may provide multiple alternatives. You can select which suggestion you want to use, or reject all suggestions.

  1. Azure Data Studio에서 새 SQL 파일을 만듭니다.

  2. In the SQL file, type the following query. GitHub Copilot will show you a suggestion.

    SQL
    SELECT [UserId], [Red], [Orange], [Yellow], [Green], [Blue], [Purple], [Rainbow]
    FROM [Tag].[Scoreboard]
    INNER JOIN
    
  3. Optionally, you can see alternative suggestions, if any are available.

    OSSee next suggestionSee previous suggestion
    WindowsAlt+[Alt+]
    LinuxAlt+[Alt+]
    macOSOption+[Option+]

Partially accepting suggestions

You may not want to accept an entire suggestion from GitHub Copilot. You can use keyboard shortcuts to accept either the next word of a suggestion, or the next line.

  1. Azure Data Studio에서 새 SQL 파일을 만듭니다.

  2. In the SQL file, type the following query. GitHub Copilot will show you a suggestion.

    SQL
    SELECT [UserId], [Red], [Orange], [Yellow], [Green], [Blue], [Purple], [Rainbow]
    FROM [Tag].[Scoreboard]
    INNER JOIN
    
  3. If you want to accept only the next word of the suggestion, use one of the following keyboard shortcuts.

    OSAccept Next Word
    macOSCommand+
    WindowsControl+
    LinuxControl+
  4. If you want to accept the next line of the 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 "Keyboard shortcuts in Azure Data Studio" in the Microsoft documentation.

  5. Alternatively, you can hover over the suggestion to see the GitHub Copilot command palette for choosing suggestions.

Generating code suggestions from comments

주석 내에서 자연어를 사용하여 수행할 작업을 설명할 수 있으며, GitHub Copilot은 목표를 달성하기 위한 코드를 제안합니다.

  1. Azure Data Studio에서 새 SQL 파일을 만듭니다.

  2. In the SQL file, type the following query and comment. GitHub Copilot will suggest an implementation of the query.

    SQL
    SELECT TokenColor, COUNT(UserID) AS UserCount
    FROM Tag.Users
    GROUP BY TokenColor
    -- pivot that query on tokencolor for Purple, Blue, Green, Yellow, Orange, Red
    -- and rename the columns to match the colors
    SELECT [Purple], [Blue], [Green], [Yellow], [Orange], [Red]
    

GitHub Copilot 사용 또는 사용 안 함

Azure Data Studio 내에서 GitHub Copilot을 사용하거나 사용하지 않도록 설정할 수 있습니다. Azure Data Studio 창의 아래쪽 패널에 있는 GitHub Copilot 상태 아이콘은 GitHub Copilot이 사용하도록 설정되었는지 여부를 나타냅니다. 사용하도록 설정하면 아이콘의 배경색이 상태 표시줄의 색과 일치합니다. 사용하지 않도록 설정하면 아이콘의 배경색이 상태 표시줄의 색과 대비됩니다.

  1. GitHub Copilot을 사용하거나 사용하지 않도록 설정하려면 Azure Data Studio 창의 아래쪽 패널에서 상태 아이콘을 클릭합니다.

    Azure Data Studio의 아래쪽 패널 스크린샷 GitHub Copilot 아이콘은 진한 주황색으로 표시됩니다.

  2. GitHub Copilot을 사용하지 않도록 설정하는 경우 전역적으로 또는 현재 편집 중인 파일의 언어에 대해 제안을 사용하지 않도록 설정할지 묻는 메시지가 표시됩니다.

    • GitHub Copilot에서 제안을 전역적으로 사용하지 않도록 설정하려면 전역적으로 사용하지 않음을 클릭합니다.
    • 지정된 언어에 대한 GitHub Copilot의 제안을 사용하지 않으려면 언어에 대해 사용하지 않음을 클릭합니다. 전역적으로 또는 현재 언어에 대해 GitHub Copilot을 사용하지 않도록 설정하는 옵션의 스크린샷

Next steps

GitHub Copilot을 성공적으로 설치하고 첫 번째 제안을 받았지만 아직 시작일 뿐입니다. GitHub Copilot을 사용하여 다음 단계를 수행하는 데 유용한 리소스는 다음과 같습니다.

Further reading