From the course: GitHub Copilot for Software Developers by Microsoft Press

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Use Copilot to detect and fix errors

Use Copilot to detect and fix errors

- All right, so in this first video we're going to see how you can use GitHub Copilot to help detect and fix errors in your code by doing things like leveraging context error messages, and in some cases targeted prompts. So one of the simplest ways to start, you know, a debugging interaction with Copilot is to highlight the code that's not working. Or to also, you know, you can also leave a comment indicating that something is broken. So let me give you an example here. Let's say that we're working in JavaScript, right? I had this, you know, Fibonacci sequence up here. So let me just create a new file and we'll call this something like debugging.js here. All right? And let's say that we've created a function called, and I'm just going to type this out real quick here and also zoom in a bit. There we go. So let's say that we've created a function called like getUserName. And this takes a user object and returns some sort of like fairly deeply nested property, right? So maybe we say…

Contents