From the course: Software Testing Assistance with GitHub Copilot AI

Unlock the full course today

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

Copilot for code completion

Copilot for code completion

- [Instructor] Code completion is where you will interact with CoPilot the most. Once installed, CoPilot will start suggesting code immediately. Code completion can mean a lot of things. There are times where CoPilot will understand you returning a bull and complete a conditional for you. Other times you can type a comment and CoPilot will attempt to infer your meaning and provide code for that. Here's a simple example in PHP. I'll start a function and give it a simple name, alphabetize by last name and I'll type hint it as an array of names. There are a ton of ways to solve this problem. You can probably think of two or three, along with questions about the data format in the array. For now, we'll take co-pilot's approach. Another approach to prompt and co-pilot is to write a comment. I'll add a comment here. Validate the string is an email address. The ghost text shows a suggestion of a function, but I can be more explicit in my comment and suggest I want to reg exit. Being AI…

Contents