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.
Enhance debugging with AI-powered suggestions - Github Copilot Tutorial
From the course: GitHub Copilot for Software Developers by Microsoft Press
Enhance debugging with AI-powered suggestions
- Okay, in the last video, we saw how GitHub Copilot can help fix broken code by using things like context and error messages. And in this video, we're going to take things a step further and see how Copilot can provide a little bit more targeted debugging help, right? And this includes things like guidance for stack traces, logic errors, and other subtle bugs like off-by-one issues. And the first thing here is, all right, we already saw that adding comments can kind of prompt GitHub Copilot to help us fix something. But I want to show you another example of this because this is a very popular strategy. So let's take a look at a very common example here. I'll head over to my IDE, and that is, let's take a look at like an off-by-one error in a loop. Now I'm going to use just a regular for loop here. We're going to say function printItems in here, and then we'll just say items. And inside here we'll use one of those ugly for loops, right? So we'll say, and this one does work because it…