From the course: Refactoring with GitHub Copilot

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Chatting with Copilot

Chatting with Copilot

Copilot Chat is a powerful feature for code explanation, generation, and insights. It allows you to harness Copilot in places external to the codebase. The first example I like to do is highlight a section of code and open the chat, which is this button right here, and I'll ask Copilot to write a comment for this function. Write a comment for the highlighted code. This output is probably more verbose than something I would write as a comment, and skimming, it seems completely accurate. I highly encourage you to double-check the work of Copilot everywhere. Also note, there's an option here to copy to your clipboard. Another prompt you can pass to Copilot as a request to explain. So I'll ask it to explain the highlighted code. I want to pause for a moment. This function was generated by Copilot. A moment ago, Copilot created the DocBlock and now it's explaining how this function works. I frequently search the internet for simple things, problems I've solved before, but I don't quite…

Contents