Beyond Auto-Completion: Mastering GitHub Copilot and Copilot Chat in VS Code
Overview of AI-Driven Development
Modern software development moves at a breakneck pace. We often feel flooded by new tools, yet
Prerequisites
To follow along, you need
Key Libraries & Tools
- GitHub Copilot: An AI programmer that provides autocomplete-style suggestions.
- GitHub Copilot Chat: A conversational interface insideVS Codefor complex queries.
- Taipy: An open-sourcePythonlibrary used to build data-driven web applications rapidly.
- Pytest: A framework for writing and running unit tests.
Code Walkthrough: From Logic to Tests
from dataclasses import dataclass
@dataclass
class Person:
name: str
age: int
ssn: str
def print_info(self):
print(f"{self.name} is {self.age} years old.")
While writing this, the AI suggests the print_info method body automatically. Once your logic is set, you can generate unit tests in a separate file. Start by typing test_person and let the AI fill in the assertions. However, stay sharp. AI sometimes adds too many assertions in a single test, which violates the best practice of testing one specific behavior per function.
Syntax Notes and Shortcuts
Efficiency comes from knowing the keybindings. Press Tab to accept a suggestion or Esc to reject it. If the first suggestion doesn't fit, use Option + ] (Mac) or Alt + ] (Windows) to cycle through alternatives. To see multiple solutions at once, Ctrl + Enter opens a dedicated panel with various code snippets.
Practical Examples
Tips & Gotchas
AI makes mistakes. It might make private members public or fail to finish a complex block of code. Always review the logic. A great tip is to disable settings.json if it becomes too intrusive during creative writing or configuration tasks.

Fancy watching it?
Watch the full video and context