Lesson 1 of 4

Beyond Basic Autocomplete

Advanced Copilot Techniques

Context Awareness

Copilot understands:

  • Open files in your editor
  • Function signatures
  • Variable names and types
  • Comments and documentation
  • Import statements

Tip: Keep relevant files open for better suggestions

Multi-Line Suggestions

Trigger:

  1. Write a comment describing what you want
  2. Press Tab to accept
  3. Continue pressing Tab for more lines

Example:

# Function to validate email address and extract domain

↓ Copilot generates complete function

Pattern Recognition

Copilot learns your patterns:

  • Naming conventions
  • Error handling style
  • Comment style
  • Code structure

Tip: Write consistent code for better suggestions

Keyboard Shortcuts

| Shortcut | Action | |----------|--------| | Tab | Accept suggestion | | Esc | Dismiss | | Alt + ] | Next suggestion | | Alt + [ | Previous suggestion | | Ctrl + Enter | Open panel (10 suggestions) |

Improving Suggestions

Bad Prompt:

function processData(data) {
  // copilot fills this
}

Good Prompt:

// Process user data array, filter inactive users,
// calculate average age, return stats object
function processData(data) {

→ Proceed to Lesson 2: Copilot Chat