From the course: GitHub Copilot Cert Prep by Microsoft Press
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Trigger GitHub Copilot when suggestions are absent or suboptimal - Github Copilot Tutorial
From the course: GitHub Copilot Cert Prep by Microsoft Press
Trigger GitHub Copilot when suggestions are absent or suboptimal
- [Instructor] In other words, how to make Copilot respond. One bit of guidance from GitHub is to preface your code with descriptive comments. We could actually use Copilot with /explain to generate the comment to begin with, but by lacing our code with our own descriptive comments, you're providing more semantic context for Copilot to help you. Another thing you could do is write function stubs even with pseudo code, in order to guide Copilot. That's actually a quite a good example. In terms of being faced with refactoring larger code blocks, remember my guidance to break complex logic into smaller and not overwhelm the AI. Have it understand the big picture, and maybe even teach it back to you so you understand the big picture, but then zoom in and focus on one thing at a time. Cycle through suggestions is a callback to in VS Code. You can use a key bind when you're in the editor in the code, and there's more than one suggestion that's come back from the AI, and again, the standard…