Plastic Trash

I had a go with GitHub Copilot

I was very excited last week when I finally got access to the GitHub Copilot, I had signed up for it many months ago and was on a waitinglist. I think for many developers are interested in learning what an AI solution can do for them and to make code suggestions.

I been using GitHub Copilot with Visual Studio 2022, using Copilot in Visual Studio is straight forward you signing to Copilot from your Visual Studio environment, and when you start to write or edit code, Copilot solution start making suggestions as you type, suggesting the code Copilot thinks that you might want. It can suggest whole lines or entire functions based on the context of the written code. 

PHP Codeigniter Suggestion

Getting started

To get started you’ll need to sign up for the waitlist to get access to the GitHub Copilot before installing the Visual Studio 2022 extension.

Once you have received an email from GitHub confirming you have access, in Visual Studio 2022 go to Extensions > Manage Extensions and search for GitHub Copilot.

Press download and, when asked, close Visual Studio. You will now be prompted to install the GitHub Copilot extension. Select Modify to begin the installation.

Once it successfully completes, re-open Visual Studio 2022. You will then be prompted to authorize Visual Studio with the GitHub Copilot service.

This will pop up a browser window. Hit Ctrl-V to paste the authorization code in, hit Continue and then Authorize GitHub Copilot Plugin.

Using GitHub Copilot

As you type, GitHub Copilot will automatically suggest the code that it thinks you might want. You can press the tab key to accept or you can simply keep typing to ignore and GitHub Copilot will make more suggestions based on what it thinks you are doing. You can press Esc to clear a suggestion completely if it’s getting in your way.

PHP Function Codeigniter

While GitHub Copilot will always show its best recommendation, you can use Ctrl+Alt+] and Ctrl+Alt+[ to navigate the alternatives from the multiple suggestions it will have generated.

You can adjust the settings for GitHub Copilot at any time by clicking on the GitHub Copilot icon at the bottom of your editor window. That allows you to control when the extension is enabled, including the ability to enable or disable it for particular solutions and programming languages.

Wrap it up

I have tried Copilot with PHP, CSS, TypeScript, Ionic and Python, it always gives me suggestions, I find it very easy to use and it is useful in the programming I do for various projects. What I understand on how it works, is that GitHub people has used the public open source projects on GitHub and feed the code from these public Github repositories into an AI that is being trained overtime that then offer the suggestions while we work in Visual Studio, it is more complex than I have made it to be, it is still a very useful tool to all of us programmers.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *