Skip to content

Copilot Basics

General Tips

  • Use comments as instruction to auto generate next functions
  • Use Tab to use autogenerated Text
  • Use separate chat window to use copilot as regular chat bot or understand existing code
  • If you want to work with specific part of code, always select that code first before writing any prompt
  • Try to keep your task simple
  • the more code copiot write at once, the more chance of hallucinations
  • Simple trick is use simple keyword in your task description
  • Also breakdown your main task in to multiple smaller task
  • Working with multiple files/class/modules
  • If you're writing code which also depend on different or class then try to keep all related files open in separate tabs
  • By default copilot don't know which files are relevent to your task
  • Use @workspace agent so copilot can look into active project files and give suggestions specific to that
  • Use Slash commands during prompt
  • Fix To solve error
  • Explain option to figure out issue
  • doc to generate documentation
  • optimize to improve running code time or reduce line of code without changing it's final output

Visual Studio Code

  • CTRL + I to use inline Chat, this is good option to generate new code or modify existing code
  • CTRL + Enter to view alternative suggestion in separate chat window

Visual Studio

  • ALT + / to use inline chat
  • ALT + , or . to cycle through suggestions