Ok, I have to start this by saying, that I’m not that kind of person who gets really enthusiastic about new tech stuff. I didn’t have an iPhone 1, I didn’t sell my aunt to get ChatGPT access and I don’t believe that AI will rule this world someday, but.. I do believe in cool things, that can change the world (what iPhone did), or even define what is the new norm (like social media). Copilot Chat will change how we code, it will change how we produce software. It is that great piece of software. I think it is a turbocharger of IDEs. Almost every vehicle nowadays have a turbocharger (-electric vehicles). Turbo increases the engine power and it is must-have companion for a petrol or diesel engine. Your engine feels like half dead if you don’t have it. It just doesn’t have the power and torque.
So what is Copilot Chat. I will copy the part of the introduction from GitHub Copilot page.
GitHub Copilot Chat is a chat interface that lets you interact with GitHub Copilot, to ask and receive answers to coding-related questions from directly within a supported IDE. The chat interface provides access to coding information and support without requiring you to navigate documentation or search online forums
https://docs.github.com/en/copilot/github-copilot-chat/about-github-copilot-chat
It is basically a chat tool that is built inside your favorite IDE (Visual Studio or Visual Studio Code in this case). Well that doesn’t sound very impressive? We did have the Clippy in Office and it didn’t make me a PowerPoint wizard. However in programming you want to stay inside your IDE. Your focus, your work, your energy should all be inside the IDE writing code and making things. Every time you have to jump out of IDE to search for information or scroll through Stack Overflow you lose your focus. Now with Copilot Chat you have almost all the information that internet can provide you, right there inside your IDE. However the cool part is, that now you don’t have to look for answers, the answers will come to you.
That all sounds really good, but let’s next see how the magic really happens.
Installation
We have to start with the boring part. How can I get that magical Copilot Chat? Well first you need to have GitHub Copilot license + your organization needs to have the Chat feature enabled at GitHub Copilot policies.
Then you need to install the IDE extension. For Visual Studio you can find it from Visual Studio Extensions. Note that this extension is different than GitHub Copilot. You will need both of them.
After installing the extensions and restarting Visual Studio we should be good to go. First thing to do is to check the Copilot Chat settings. You can find them from Visual Studio by typing copilot into options search box. I did have Copilot bound at keyboard shortcut F1, so enabling the F1 for Explain skill didn’t do anything for me. If you have it available, then it should work, so tick that setting.
Next I wanted an easy access to Copilot Chat, so I checked the shortcut for it and binded it into F-keys. By default the Chat window is binded into Ctrl+W, Ctrl+I.
Basic Usage
By pressing the shortcut (or clicking Copilot Chat from View menu), we will get a chat window inside our IDE that has some tips. You can write questions into Ask Copilot box and send them forward to Copilot. This isn’t anything fancy or exiting so let’s take a look of something more interesting.
I wrote simple name parsing method that takes name string as parameter, split the name with . and returns the concat string with spaces. I wanted to keep this example simple to avoid extra confusion around the code (+make this blog post shorter). Next I highlighted the code, moved into Copilot Chat window and typed explain
And this is what I got. The Copilot explained the method in plain english AND provided very cool example. If I gave “John.Doe.Smith” into this method, it would return “John Doe Smith“. How cool is that! It even gave me some tips about how to improve this code!
We all have read some horror stories about AI getting basic things wrong. So I wanted to test out the Copilot Chat little bit more. I asked it to do a simple calculation: (77+23)*2 and guess what. It got it right AND it provided example code for it 🤩. Ok it also tried to tell me, that I could remove parentheses to make the code more clear and of course the mathematical world doesn’t work like that. Anyway I think this is the future of coding. Assisted AI inside your IDE will be the new norm.
Summary
Copilot Chat is your turbocharger. It gives an extra horsepower to your old coding engine and it makes you more productive. AI assistance is the new norm. I asked the Copilot Chat to give a short summary of itself and here it is:
I am GitHub Copilot, an AI chatbot that assists software developers with code suggestions and automated generation. My intention is to help you with your programming tasks by providing helpful code suggestions and learning from your code preferences. I am designed to increase your productivity and fill gaps in your knowledge with the vast experience of developers from around the world.
-“give me a summary what you are”
Pingback: Copilot Chat - kooditurboahdin käytössäsi - Adafy
Comments are closed.