INFO 5001 Application Modeling and Design - Instructions & Guides

GitHub Copilot Setup & Usage Guide

What is GitHub Copilot?

GitHub Copilot is an AI pair programmer that helps you write code faster and with less work. It draws context from comments and code to suggest individual lines and whole functions instantly. GitHub Copilot is powered by OpenAI’s advanced models and is trained on billions of lines of public code.

Benefits for Students


Setup Instructions

Prerequisites

Installation Steps

  1. Open VS Code
  2. Access Extensions

    • Click the Extensions icon in the Activity Bar on the side of the window
    • OR press Ctrl+Shift+X (Windows/Linux) or Cmd+Shift+X (Mac)
  3. Install GitHub Copilot

    • Search for “GitHub Copilot”
    • Click Install on “GitHub Copilot” by GitHub
  4. Sign In to GitHub

    • After installation, you’ll be prompted to sign in to GitHub
    • Follow the authentication flow in your browser
    • Make sure to sign in with the same GitHub account that has the Student Developer Pack
  5. Verify Activation
    • Look for the GitHub Copilot icon in the status bar at the bottom of VS Code
    • It should be active and not showing any warnings

Using GitHub Copilot

Basic Usage

  1. Start Typing Code

    • As you type, Copilot will suggest code completions in gray text
    • Press Tab to accept a suggestion
    • Press Esc to dismiss a suggestion
    • Continue typing to see different suggestions
  2. Generate from Comments

    • Write a comment describing what you want to do
    • Press Enter to start a new line
    • Copilot will suggest code that implements your comment

    Example:

    // Find the maximum value in an array of integers
    
  3. Complete Function Bodies

    • Type a function signature and open curly brace
    • Copilot will suggest the entire function implementation

    Example:

    public int factorial(int n) {
        // Copilot will suggest the factorial implementation
    }
    

Advanced Features

GitHub Copilot Chat (Agent Mode)

Copilot Chat is a more interactive way to use AI assistance for coding tasks.

  1. Access Copilot Chat

    • Press Ctrl+I (Windows/Linux) or Cmd+I (Mac)
    • OR click the Copilot Chat icon in the sidebar
  2. Ask Questions or Request Code

    • “Write a function to convert Celsius to Fahrenheit”
    • “How do I read a CSV file in Java?”
    • “Explain how this algorithm works”
  3. Get Multi-file Assistance

    • “Refactor this class to use the Builder pattern”
    • “Find and fix bugs in my code”
    • “Help me implement a feature across multiple files”

Keyboard Shortcuts

Action Windows/Linux Mac
Accept suggestion Tab Tab
Dismiss suggestion Esc Esc
Show next suggestion Alt+] Option+]
Show previous suggestion Alt+[ Option+[
Open Copilot Chat Ctrl+I Cmd+I
Trigger inline suggestion Alt+\ Option+\

Best Practices for INFO5001

Do’s

Don’ts


Ethical Considerations


Troubleshooting

Common Issues and Solutions


Additional Resources


Remember, GitHub Copilot is a tool to enhance your learning journey, not replace it. Use it wisely and ethically!