3 Quick Tips to Jumpstart Your Journey with GitHub Copilot
The more mature the career of software development becomes, the more it converges with other skilled trades like mechanic. In many skilled trades the effectiveness of the individual contributor is directly related to their skill with and the quality of their tools. A master tradesman is deeply experienced and highly affective with their tools.
It is quickly becoming apparent that the next killer tool in the Software Developer’s toolkit will be generative AI. The first serious contender on the scene is Github Copilot. Here is a quick guide to getting started with this tool.
Install the GitHub Copilot Extension
To use GitHub Copilot, you’ll need to install the extension on your IDE. The GitHub Copilot extension is available for Visual Studio Code, which is a popular, free, and open-source code editor. Follow these steps to install it:
- Open Visual Studio Code.
- Click on the Extensions view icon, or press
Ctrl+Shift+X
to open the Extensions tab. - In the search bar, type “GitHub Copilot” and press Enter.
- Click on the GitHub Copilot extension and then click the Install button.
- Once installed, you will be prompted to sign in to your GitHub account or create one if you haven’t already.
Understand How to Use GitHub Copilot’s Autocomplete Feature
GitHub Copilot is designed to provide context-aware code suggestions while you’re coding. Here’s how to make the most of its autocomplete feature:
- Start typing your code as you normally would.
- GitHub Copilot will automatically suggest relevant code completions as you type. These suggestions will appear as light gray text inline with your cursor.
- Press
Tab
orEnter
to accept the suggested code completion. - If you want to explore alternative suggestions, press
Ctrl+Space
(orCmd+Space
on macOS) to open the suggestion list. - Navigate through the list using the arrow keys and press
Enter
to select the desired suggestion.
Request Specific Code Examples and Functions
GitHub Copilot can also generate specific code examples or functions based on your comments or code. Here’s how:
- Write a comment describing the code or function you’d like GitHub Copilot to generate. Make sure to provide enough context and be clear about your requirements.
- Press
Enter
to start a new line of code after the comment. - GitHub Copilot will provide a code suggestion based on your comment. If the suggestion meets your requirements, press
Tab
orEnter
to accept it. - If the initial suggestion doesn’t match your requirements, press
Ctrl+Space
(orCmd+Space
on macOS) to explore alternative suggestions. You can cycle through the list and pick the one that best suits your needs.
After getting the hang of the basic functionality, the more you use Copilot, like any other tool, the more effective you become with it.