4 ways to interact with GitHub Copilot

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this lecture we will see four other ways in which we can interact with GitHub copilot other than with the chat and to illustrate this I'm inside an empty directory inside my computer I will create a new file I will call it let's say that I want to create an email parser script or function and I will call this email I called it email parer dopy and this will be a python file and as soon as I open any file any empty file inside my uh workspace if I have GitHub copilot enabled you will see that I will get this uh information press control I to ask itth up copilot chat to do something well as I said we will see four different ways in which we can interact with copilot directly from inside our opened fil open files the first one or the first one which I want to point out is by using using commments and here I'll say this file will maybe say right here will handle and as you can see already as I am typing inside my file inside any file get up copilot will try to understand what exactly I'm doing and this is an important point in which you you need to understand this is something called ghost text as you can see it is something GR it's something that GitHub copilot came with and I have multiple options in which I can accept this suggestion or parts of these suggestions usually I can accept the whole suggestion if I press tab or if I will uh click accept right here or I can accept part of these suggestions words with control if I will have control pressed and then I use the arrows I can simply move on on inside the suggestion I can press Tab and now this text is completed if I will press enter right now G copilot will proceed you know to try to give me some suggestions so you saw the first way in which we can interact by using commments the next way which is also very powerful is by using or by providing function definitions for example here I can say Dev pars email and this if this is a popular use case and many times this will be the use case then GitHub copilot will know what to look for or will try to give me some suggestion this suggestions this suggestion is really strange I don't want it so I will just add right here a file path and uh let's proceed with the implementation at some point in GitHub copilot will know what I want well this is what I want I want first of all to pass a email file from a file path and yes I want this with open file path s f all right then I will want a new message so here I will say as file right here I want a file and here I will say maybe message all right is email message from file this is exactly what I want but I need this import right here so I will add this import from email and then also try to add some headers for example I can say right here access email headers all right as you can see as uh GitHub copilot gets more context about what I want it will try to suggest me an implementation all right yes I want the from I want the the to but not in this format maybe I want also to print right here from like this and then like this all right then it will try to as you can see as I pointed out a way in which I want this to be printed it will offer to do the same in a different way and also maybe the subject yes the subject also appears and uh also let's access the email body already it knows this all right let's see if we get this implementation no maybe if the email is morti part yes this looks all right if the context get context type is text plain I upsc him this else let's just simply print the payload like this let's see if we can uh test this function right here and I will simply try to use this so here I'll say par email and then maybe with an email file email dot in an EML EML file like this the problem with this implementation which I'm currently doing is that I don't have an email. EML file and if I will I can simply created right here next to this email. EML but I don't know how an email file should look like well can GitHub copilot give me some assistance and maybe I will specify right here and now we will see the third way in which we can interact with GitHub copilot by using the GitHub copilot dialogue right here inside the file I will ask right here please add some email content right here let's see what it will do all right that's great this is what exactly what I wanted I wanted to have an nicely formatted EML file to see if I can simply uh execute it it now I can simply try to execute my uh code generated with GitHub copilot and I can simply call Python and my email passer and yes as you can see here I'm getting the email content from a mile file well this is was the way in which I can interact with uh GitHub copilot let me tell let me show you one last way which is also very interesting for example I can uh interact with GitHub copilot directly from vs code so this will be only specific to vs code I can simply select a chunk of code right here maybe this one and I can go to select copilot and do some GitHub co-pilot commands like for example fix this in case I have something not working or explain this or generate docs let's generate some documents for this function I will select it and I will generate some documents all right I will accept this this uh looks all right I have now a professionally looking document documentation for my file so we saw in this lecture how we can interact with gab copilot we saw four ways and how we can use it to write great code
Info
Channel: Concise Developer
Views: 739
Rating: undefined out of 5
Keywords:
Id: Arp1bSQFuzY
Channel Id: undefined
Length: 7min 21sec (441 seconds)
Published: Thu Jan 04 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.