Intro to GitHub Copilot in Visual Studio

Microsoft Visual Studio
12 Mar 202415:33

Summary

TLDRThe video script introduces GitHub Copilot and Visual Studio 2022, highlighting their seamless integration and powerful features. It demonstrates the ease of installation, the real-time code suggestions, and the ability to learn new coding patterns. The script also explores advanced functionalities like code optimization, cross-file interaction, and context-aware AI support through Copilot Chat. The video emphasizes the productivity boost and learning opportunities offered by these tools, making coding more efficient and interactive.

Takeaways

  • 🚀 **Easy Installation**: Installing GitHub Copilot and Copilot Chat in Visual Studio 2022 is straightforward, found under the extension menu.
  • 🔍 **Code Suggestion**: As you type, Copilot analyzes your code and provides suggestions, which can be accepted using the Tab key.
  • 📌 **Multiple Suggestions**: Use Alt + . or , to navigate between multiple suggestions for a specific scenario.
  • 📝 **Comment-Based Suggestions**: Generate suggestions using comments, which can be invoked at any time with Alt + /.
  • 🌟 **Inline Documentation**: Use the '/**' command to automatically generate documentation for functions.
  • 🔄 **Code Optimization**: The 'optimize' slash command analyzes and suggests cleaner or more efficient code solutions.
  • 🔗 **Cross-File Interaction**: Reference and interact with code in external files using hashtags and questions.
  • 🔧 **Customizing Copilot**: Enable or disable Copilot globally, for C, or for the current solution through the editor options.
  • 🤖 **Copilot Chat**: Accessible via the view menu, it offers explanations, help, unit testing, profiling, and more.
  • 📊 **File and Project Insight**: Use Copilot Chat to gain insights about open or external files, and to understand project files better.
  • 🛠 **Refactoring Assistance**: Ask Copilot Chat to refactor code into new functions or to change IDE themes and settings.
  • 📚 **Learning Resources**: The script encourages users to explore additional resources for in-depth knowledge of GitHub Copilot in Visual Studio 2022.

Q & A

  • What are the prerequisites for using GitHub Copilot in Visual Studio 2022?

    -To use GitHub Copilot in Visual Studio 2022, you need the latest version of Visual Studio, which can be downloaded from visualstudio.microsoft.com, and a GitHub account.

  • How easy is it to install GitHub Copilot and Copilot Chat in Visual Studio 2022?

    -The installation process is described as 'super super easy'. You go to the extension menu, search for GitHub Copilot and Copilot Chat, and install them. The installation will be triggered upon closing Visual Studio.

  • How does GitHub Copilot assist with coding in Visual Studio?

    -GitHub Copilot analyzes the code as you type and provides suggestions. You can accept suggestions by pressing the Tab key, which not only adds new code but also helps you learn new coding patterns.

  • What is the purpose of the 'alt and Dot' or 'comma' keys in GitHub Copilot?

    -These keys allow you to move forward and backward between multiple suggestions provided by GitHub Copilot for a specific scenario.

  • How can you invoke GitHub Copilot with a specific task or question?

    -You can generate suggestions using comments. For example, if you want to create a function to calculate the year of birth, you can write a comment about the desired function, and Copilot will assist.

  • What are the benefits of using slash commands in GitHub Copilot?

    -Slash commands in GitHub Copilot are self-describing and super useful. They allow you to add documentation, fix code, generate code, and more, depending on the specific command used.

  • How does the 'optimize code' slash command work in GitHub Copilot?

    -The 'optimize code' command analyzes a piece of code and proposes a cleaner or more efficient solution. It can simplify complex functions or smaller pieces of code by removing unnecessary parts.

  • Can GitHub Copilot interact with multiple files in a solution?

    -Yes, GitHub Copilot can use hashtags to reference external files and interact between different files within a solution, allowing for a comprehensive understanding and assistance across the entire project.

  • How can you customize GitHub Copilot's behavior in Visual Studio?

    -You can enable or disable GitHub Copilot globally, for C only, or for the current solution only, depending on your needs. This flexibility allows you to tailor the AI's assistance to your specific coding tasks.

  • What is GitHub Copilot Chat and how does it enhance the coding experience?

    -GitHub Copilot Chat is a feature that provides context-aware AI support. It can explain code, offer help with coding tasks, perform unit testing, profiling, and more. It can also answer questions about external files without the need to open them.

  • How can you switch the theme of Visual Studio using GitHub Copilot Chat?

    -You can use the 'ask Visual Studio' slash command within GitHub Copilot Chat to ask for instructions on how to change the theme. For example, typing 'how can I switch to a dark theme' will provide you with the necessary steps to make the change.

Outlines

00:00

🚀 Getting Started with GitHub Copilot and Visual Studio 2022

This paragraph introduces the setup process for using GitHub Copilot with Visual Studio 2022. It emphasizes the ease of installation through the extension menu and the necessity of having a GitHub account and basic familiarity with Visual Studio. The speaker shares their experience with installing both GitHub Copilot and Copilot Chat, highlighting the straightforward process and the immediate availability of the extensions upon reopening Visual Studio. The paragraph also delves into the functionality of Copilot, which provides code suggestions as you type, allowing for enhanced productivity and learning of new coding patterns.

05:00

🤖 Invoking and Interacting with GitHub Copilot

The second paragraph focuses on the interactive aspects of GitHub Copilot. It explains how to invoke Copilot using keyboard shortcuts and the various ways to receive suggestions, such as using comments or slash commands. The speaker demonstrates how to use slash commands for tasks like adding documentation, fixing code, and optimizing code snippets. The paragraph also touches on the ability to reference external files and interact with them using hashtags, showcasing the versatility of Copilot in understanding and assisting with complex coding tasks across multiple files.

10:00

💬 Exploring GitHub Copilot Chat Features

This paragraph introduces the capabilities of GitHub Copilot Chat, which provides a separate panel for more interactive and context-aware AI support. It outlines the range of features available, such as code explanations, help with coding tasks, unit testing, and profiling. The speaker gives examples of how Copilot Chat can explain the differences between programming constructs, convert code from one format to another, and offer insights into open or external files without the need to read the entire codebase. Additionally, it highlights the use of slash commands within Copilot Chat for various tasks and the ability to ask general questions related to Visual Studio.

15:01

🎨 Customizing GitHub Copilot Experience

The final paragraph discusses the customization options available for GitHub Copilot in Visual Studio 2022. It explains how users can enable or disable Copilot globally, for specific languages, or for individual solutions. The speaker also explores the context-aware AI support provided by Copilot Chat, which can answer questions and provide insights into code files. The paragraph concludes with a mention of the resources available for those interested in learning more about the topics covered in the video script.

Mindmap

Keywords

💡GitHub Copilot

GitHub Copilot is an AI-powered code assistant that helps developers write code more efficiently by providing suggestions and autocomplete options based on the context of the code being written. In the video, it is integrated with Visual Studio 2022, allowing users to enhance their coding experience with intelligent suggestions and code completions.

💡Visual Studio 2022

Visual Studio 2022 is the latest version of the popular integrated development environment (IDE) from Microsoft. It provides a comprehensive set of tools for developers to create, debug, and deploy software. The video emphasizes its compatibility with GitHub Copilot, showcasing how the two work together to streamline the development process.

💡Installation Process

The installation process refers to the steps taken to add a new software, feature, or tool to an existing system. In the context of the video, it details the straightforward steps required to install GitHub Copilot and Copilot Chat extensions within Visual Studio 2022, emphasizing the ease of setup for developers.

💡Code Suggestions

Code suggestions are proposed pieces of code generated by AI that can help developers complete tasks more quickly or solve coding problems. In the video, GitHub Copilot provides code suggestions as the user types, which can be accepted to improve efficiency and learn new coding patterns.

💡Tab Key

In the context of coding and using an IDE like Visual Studio 2022, the Tab key is often used to navigate through the code or to accept suggestions made by AI tools like GitHub Copilot. The video highlights the use of the Tab key to quickly incorporate suggested code into the developer's work.

💡Copilot Chat

Copilot Chat is a feature that extends the functionality of GitHub Copilot, allowing developers to interact with an AI chatbot for various purposes, such as asking for code explanations, help with tasks, or even generating unit tests. It is designed to provide a more conversational interface for developers to engage with AI assistance.

💡Slash Commands

Slash commands are special shortcuts that can be used within the IDE to invoke specific functions or actions provided by an AI tool like GitHub Copilot. These commands typically start with a forward slash (/) and are followed by a command name or a question, allowing developers to interact with the AI in a more direct and efficient manner.

💡Code Optimization

Code optimization refers to the process of improving the efficiency of existing code without changing its functionality. In the context of the video, GitHub Copilot can analyze code and suggest optimizations that make the code cleaner, more efficient, or more maintainable.

💡Documentation

Documentation in software development is the practice of creating and maintaining written descriptions of code, its functionality, and its usage. The video shows how developers can use GitHub Copilot's slash commands to automatically generate documentation for their code, saving time and ensuring clarity.

💡Code Refactoring

Code refactoring is the process of restructuring existing computer code without changing its external behavior. Its purpose is to improve the nonfunctional attributes of the software, making it easier to understand, maintain, and extend. In the video, GitHub Copilot is shown to assist with refactoring by suggesting changes to improve code structure and readability.

💡Context-Aware AI Support

Context-aware AI support refers to artificial intelligence that adapts its assistance based on the specific context or environment in which it is being used. In the video, this concept is exemplified by GitHub Copilot Chat, which provides tailored assistance and insights relevant to the user's current coding task or the specific code file being examined.

Highlights

GitHub Copilot and Visual Studio 2022 offer an integrated development experience.

To get started, you need the latest version of Visual Studio and a GitHub account.

Installation of GitHub Copilot and Copilot Chat in Visual Studio 2022 is straightforward.

Copilot provides real-time suggestions as you type code, enhancing productivity.

Accept suggestions by pressing the Tab key, which also helps in learning new coding patterns.

Multiple suggestions for a specific scenario can be navigated using Alt + Dot or Comma.

Copilot can generate suggestions using comments, aiding in solving specific coding tasks.

Invoke Copilot at any time inside the IDE with Alt + Forward Slash.

Copilot provides insights about the code, such as describing variables and functions.

Slash commands in Copilot, like '/optimize', offer code improvement suggestions.

Reference external files and interact between them using hashtags in Copilot.

Enable or disable Copilot globally, for C, or only for the current solution.

GitHub Copilot Chat offers context-aware AI support, accessible via the View menu.

Copilot Chat can explain code differences, provide help, and even perform unit testing.

Slash commands in Copilot Chat include '/doc' for automatic documentation generation.

Copilot Chat can describe open files or external files without the need to read the entire code.

Use 'ask Visual Studio' slash command in Copilot Chat for general questions related to Visual Studio.

Copilot Chat can refactor code into new functions based on user selection.

Switch themes in Visual Studio using guidance from GitHub Copilot Chat.

Transcripts

play00:00

let's get started with GitHub copilot

play00:02

and visual studio 2022 this is an

play00:05

amazing experience that I want to share

play00:06

with you you just need Visual Studio the

play00:09

latest version you can get this from

play00:11

visual studio. microsoft.com and you

play00:14

also need a GitHub account all of the

play00:17

links all of the necessary information

play00:18

you can find in the main Visual Studio

play00:20

page and I will also advise that you

play00:22

have general knowledge of how to work

play00:25

move around and do stuff inside Visual

play00:27

Studio let's start using giab C pilot

play00:30

and copilot chat in Visual Studio the

play00:32

installation process in Visual Studio

play00:34

2022 it's super super easy so let's take

play00:37

a look in Visual Studio let's go to

play00:39

extension menu and manx extension and

play00:41

here in the extension manager we are

play00:43

going to search for GitHub copilot I'm

play00:45

searching for copilot and I have here

play00:47

copilot and copilot chat this is the CH

play00:50

that we are going to install now let's

play00:52

go for install and we are going to see

play00:54

that hey the installation process is

play00:56

going to be triggered when we close

play00:57

Visual Studio let's do the same with

play00:59

Copilot chat now we can close visual

play01:01

studio and let's see how the

play01:03

installation starts the extension

play01:05

installer is going to ask us to install

play01:06

both of them so let's click modify and

play01:09

wait a couple of seconds the

play01:10

installation is complete now so let's

play01:12

start the game visual

play01:13

studio and compilot is already here if

play01:16

we go to extension and extension and

play01:17

manx extension we are going to see in

play01:20

the installed tab that we have both HIIT

play01:24

have copilot and copilot chat in silen

play01:25

in our machine we can be ready to work

play01:27

now now that we have Visual Studio 2022

play01:30

and gith have copilot let's take a look

play01:32

how it works inside the ID the whole

play01:35

idea is that as you type code copilot is

play01:37

going to analyze your code and you're

play01:39

going to suggestion make a lot of

play01:40

suggestions every time that you have a

play01:42

suggestion you can get and accept the

play01:44

suggestion pressing the Tab Key this is

play01:46

super important let's take a look at the

play01:47

code right now I have a C Class here I

play01:50

have some very simple variable for f

play01:52

name John and when I go to the next line

play01:55

we can see here in gray that we have a

play01:58

suggestion about a you have the first

play02:00

name you may want a last name in this

play02:03

case it's going to be though I am going

play02:05

to say yes let's press the Tab Key and I

play02:07

have my suggestion here this is

play02:09

important because it's not only going to

play02:11

suggest me new code I can even learn new

play02:14

coding pattern and more while I am using

play02:17

co-pilots let's take a look at the next

play02:19

suggestion some AG I like it I will

play02:22

press T and accept this again as you see

play02:25

it's going to analyze my code it's going

play02:26

to detect what I am going to do right

play02:28

now I'm writing very simp Le code about

play02:31

a sample user and it's going to suggest

play02:33

me code for this when you start to work

play02:35

with copilot you are going to see that

play02:37

you have tons of suggestions for your

play02:39

code to solve problems to complete code

play02:42

to work in a lot of different scenarios

play02:44

but there is a cool feature here you can

play02:46

have multiple suggestion for a specific

play02:48

scenario in order to do this you can use

play02:51

the keys alt and Dot or comma to move

play02:54

forward and backward between the

play02:56

suggestions we have a class here a

play02:58

simple class this is a C Class with two

play03:00

variables first name last name and a

play03:02

simple function to get the full name of

play03:04

course this is a simple solution that we

play03:06

can have here with just concatenate the

play03:08

string but let's see what are the

play03:09

copilot suggestions here so I'm going to

play03:11

go inside the the function and we'll see

play03:14

here that hey Co pilot suggest to do an

play03:17

string interpolation here with first

play03:19

name space and last name if I go alt and

play03:22

Dot I will see a different suggestion

play03:24

now I have a scenario where I am

play03:26

concatenating the strings here where I'm

play03:28

going to do first name plus space plus

play03:31

last name let's see if we have a third

play03:33

one we not go back to the first one this

play03:35

is a simple scenario but hey this is a

play03:37

cool way to see the options that we have

play03:40

here for different suggestions copilot

play03:42

is going to be with you all the time

play03:44

making suggestion while you are coding

play03:46

but how about when you want to ask a

play03:48

specific scenario a specific question a

play03:51

specific task to be solved with copilot

play03:54

there are several ways that we can do

play03:55

this one of the most popular one is to

play03:58

generate suggestion using comment let's

play04:00

take a look how this works so we have

play04:02

here A C class this class has a couple

play04:05

of variables string variables first name

play04:07

and last name we also have an age and I

play04:09

want to have right now a function to

play04:11

okay I know the age of a user but what

play04:13

year when he was born so let's create a

play04:16

function for this so let's do something

play04:19

like function to get the year of birth

play04:23

from the as you can see also copilot is

play04:26

helping me suggest here so I am pressing

play04:28

tab tab to do this when I am here we are

play04:31

going to see that the suggestions go

play04:33

here to literally create a function that

play04:36

is going to have as an input the AG as

play04:38

an integer and then it's going to return

play04:40

May a little math here to say hey today

play04:43

minus the AG this is probably the year

play04:45

of born of the user let's press St and

play04:48

accept this I have my function here

play04:51

working with comments for get

play04:53

suggestions copilot is here to help and

play04:56

you can invoke copilot at any time

play04:58

inside the ID he's going to make

play05:00

suggestion you are going to see

play05:01

different suggestion but at any time

play05:03

that you need copilot you can invoke

play05:05

copilot with the keys alt and forward

play05:08

slash the slash that we use in url and

play05:10

more let's take a look how this

play05:11

experience works so inside the ID I am

play05:14

going to have very simple piece of code

play05:16

here in C and am going to press alt

play05:19

slash and I see here the copilot window

play05:22

this is the embedded copilot window in

play05:24

visual studio and I can ask here

play05:26

something like an sample to describe the

play05:28

variables and functions in these codes

play05:30

once I do this copilot will work and we

play05:32

start to analyze my code and give me a

play05:34

super amazing Insight of what is

play05:36

happening here we have three variables

play05:38

here first name last name and age okay

play05:41

this is right it makes sense and we also

play05:43

have two functions here to get the year

play05:45

of birth of based on an age and also to

play05:48

get the full name using the first name

play05:50

and last name this is how you can invol

play05:52

a pilot to do a lot of amazing things at

play05:54

any time inside the idid we can in B

play05:57

pilot to help us code vet SU suggestions

play05:59

and more but we also have the chance to

play06:01

use slash commands which are Super

play06:03

useful and very specific with different

play06:05

scenarios so I am going to B here

play06:08

copilot with alt slash and then if I

play06:11

press a slash again I will see here a

play06:13

set of commands doc to add documentation

play06:16

explain to explain the code fix generate

play06:19

help and more self describing super

play06:22

useful and also is going to give you

play06:24

kind of superpowers if you want to code

play06:27

here like an example I am not a of

play06:29

writing documentation but I can do here

play06:33

slash Doc in this function and it will

play06:36

automatically generate the necessary

play06:39

attribute and documentation for this

play06:40

function so I'm going to accept the

play06:42

changes and we see here the year of

play06:43

birth that I have a summary of the

play06:46

function the par and description and

play06:48

also what is returning this this is

play06:50

super super useful one of the commands

play06:52

that we have available as a SL command

play06:54

in copilot is the optimized code command

play06:57

which is amazing because it's going to

play06:58

analyze a piece of code can be a very

play07:01

big function a very small piece of code

play07:03

is going to analyze code and is going to

play07:06

propose maybe a cleaner version or a

play07:08

different way to solve the program we

play07:10

are going to take a look right now how

play07:11

it works we have here A C function that

play07:16

it's name get full name two parameters

play07:18

first name and last name and the whole

play07:20

idea here is to concatenate the

play07:21

parameters and propose a full name for

play07:25

the user we see here that the code is

play07:27

fine it's working but probably we can do

play07:29

more here so let's select this code

play07:32

let's alt slash to invoke copilot and

play07:35

then do optimize this code let's take a

play07:38

look at the output for this one it's

play07:40

really really straightforward and

play07:42

amazing what he doing here basically

play07:43

said the selected code can be optimized

play07:45

but removing a lot of unnecessary code

play07:48

you can return this string interpolation

play07:51

but first name and last name let's go

play07:53

with this solution let's do a preview

play07:54

it's going to show here the full set of

play07:56

changes that we have and once we have

play07:59

set this we have the first code at the

play08:01

beginning and I'm going to delete the

play08:03

not user code here code optimization

play08:06

really in two clicks I love it when you

play08:09

work in complex Solutions or very big

play08:11

pieces of code you're probably working

play08:12

with different files not only a single

play08:15

file and you can we can use copilot and

play08:17

we can use the hashtags to reference

play08:19

external files and to ask questions and

play08:22

even interact with the between the two

play08:23

files let's take a look we are working

play08:25

here in the main file we also have here

play08:27

in our solution we have a util files

play08:30

that has a couple of function internally

play08:32

so I have a get year of birth get full

play08:36

name get full name from email hey I want

play08:38

to know more about that so I can go here

play08:41

start C pilot and I am going to

play08:44

reference the file utils I want to know

play08:46

more about what is the get full name

play08:48

from email function do and I can start

play08:50

to take a look now and see that hey this

play08:52

get full name from email in the U class

play08:55

extract the first name and last name

play08:57

from the email address and then return

play08:58

return the full name

play08:59

calling internally the full get full

play09:01

name function this is literally what I

play09:03

am looking right now which is kind of an

play09:06

amazing way to see what is happening in

play09:07

other files from my current file copilot

play09:10

is here to help you in Visual Studio

play09:12

2022 but you can also enable a disab

play09:15

copilot dependent on units if we go to

play09:17

our ID we are going to see options in

play09:20

the editor and you have the option to

play09:22

enable copilot globally only for C or

play09:25

even only for this solution so if you

play09:27

have multiple Solutions different type

play09:29

of languages and multiple files you can

play09:32

do a lot of stats here so let's disable

play09:34

go pilot here and we see how the icon

play09:36

Chang it right now there is no more

play09:38

copilot for me I can start to work if I

play09:40

want to enable this again just go back

play09:42

again

play09:43

here I will enable copilot globally and

play09:47

that's it copilot is back online to help

play09:49

me work with while I am coding and if

play09:51

you want to have context aware AI

play09:53

support here we can also use copilot CH

play09:56

we need to go to visual studio and go to

play09:58

view and again we are going to see here

play10:00

GitHub copilot chat you can also have a

play10:02

shortcut here to enable once you click

play10:04

here and enable we going to have a new

play10:06

panel usually on your right of your ID

play10:09

we are going to see different options

play10:11

here let's take a look at new one and

play10:12

there are a couple of things that we can

play10:13

do with copilot chat we can ask for code

play10:16

explanations code help code Prof find me

play10:19

we can even do some unit testing

play10:20

profiling and the booking here I have a

play10:22

little sample to show here we have five

play10:24

lines of code which basically create an

play10:26

array of integer numbers and then fill

play10:28

our array

play10:29

with random numbers this is kind of cool

play10:31

and it works but I want to know more I

play10:33

want to know in example copilot chat I

play10:35

am going to ask copilot chat to explain

play10:37

me the difference between arise and list

play10:39

which is always super useful to know

play10:41

when you are coding so I'm going to

play10:42

enable copilot chat I have it here and

play10:44

I'm going to ask the question what's the

play10:46

difference between a list and an array

play10:48

so calot chat is basically explain

play10:50

explaining everything that I need to

play10:52

know here about the size of an array

play10:56

which is difference between arrays and

play10:58

list performance functionality and it's

play11:00

also giving me some examples in C about

play11:03

how we can use arise and how we can use

play11:05

list this is an amazing and I can even

play11:07

do more I can ask copilot to convert my

play11:09

code to use list instead of andrise this

play11:12

is interesting is not going to this

play11:15

doesn't know what is my code right now

play11:17

so I'm going to say that convert the

play11:20

code in my file to use

play11:25

list and here I have my code that I can

play11:28

use I can change it to use a list here

play11:30

of integers instead of an array and

play11:32

there we have the new code interesting

play11:34

we use copilot here to reference the

play11:35

current file and more to see how we are

play11:38

working this is really amazing and we

play11:40

can use copilot chat to ask for

play11:41

descriptions or get more insights of an

play11:44

open file or an external file without

play11:46

reading all the code let's take a look

play11:48

at this in copilot I am going to ask and

play11:50

I'm going to say describe the file and

play11:52

then using the hashtags I'm going to

play11:54

select the file I have several files

play11:56

here and I have two program CS files and

play11:59

I want to know more about the Ubuntu one

play12:02

I want to see what the wuntu one is

play12:04

doing so I'm going to select again the

play12:06

program wuntu and I'm going to ask for

play12:08

describe the

play12:09

file and hey this is amazing after a

play12:11

couple of seconds I have the full

play12:13

description of the file I know that it

play12:15

create an instant of the C custom chat

play12:18

completion service then we have some URL

play12:21

it's using a large language model Lama

play12:23

for this it us a semantic Kel and build

play12:25

a builder it's analyze and give me all

play12:28

the piece of codes and it even

play12:30

understand that this code is wrapped in

play12:33

a copyright notice here under the MIT

play12:35

license and it's also giving insights

play12:37

here this is a super useful way to know

play12:40

more about the file without the need to

play12:42

open the file and dig into the code and

play12:44

hey like when we are coding and we have

play12:47

the slash commands we also have a slash

play12:49

commands inside the copilot chat but

play12:51

there are a few new ones here that we

play12:53

can probably take want to take a look

play12:54

once we are here in the copilot chat we

play12:56

can press forward slash and then we are

play12:58

going to have access access to the all

play13:00

of the set of that we have here and you

play13:01

can see here a new one like ask Visual

play13:04

Studio ask BS where we can do general

play13:06

question related to visual studio this

play13:08

is an amazing one and there are others

play13:10

that we already seen or you already know

play13:12

like documentation experimental

play13:14

conversation this is a new one here

play13:16

explain fix generate and More in copilot

play13:19

chat we can use the slash command

play13:22

explain to explain a piece of code a

play13:25

file or more inside copilot chat I am

play13:28

going to start the command I'm going to

play13:30

do explain and let's explain this chat

play13:33

completion service file after a couple

play13:35

of seconds we see that giab copilot

play13:38

analyze the file and it's going to break

play13:40

down the key parts of the file for me

play13:42

like the properties and more and it

play13:44

works in a lot of places what about if I

play13:46

want to know more about what is a

play13:48

project file doing let's ask for explain

play13:50

for a project file we can see here that

play13:52

analyze the ISR project file and start

play13:54

to give us information about the file

play13:56

here we can see the project as case what

play13:58

is is the target TR of this project hey

play14:00

we are working with net8 the root name

play14:02

space and more explain is an amazing way

play14:05

to explain pieces of code files or more

play14:08

when you are working with the GitHub

play14:09

copilot chat and we have a super

play14:11

powerful SL command Visual Studio 2022

play14:15

and gith have copilot chat which is the

play14:17

ask BS the ask Visual Studio we can use

play14:19

this command to ask question on how we

play14:21

can do how we can do things and interact

play14:24

in Visual Studio I select a piece of

play14:25

code and now I'm going to ask GitHub

play14:27

compilot chat how can I refactor this

play14:29

code I am going to select the file here

play14:32

but I also going to select the file with

play14:33

the lines 25 32 that the one that I have

play14:36

and I'm going to ask to refactor this to

play14:38

a new function compilot is going to

play14:40

refactor the full code and it's going to

play14:42

show me how I can change the code I can

play14:44

generate here a function to generate the

play14:47

chat request and also how I can use this

play14:49

new code here and I can ask Visual

play14:51

Studio related question like an example

play14:54

how about if I want to change to a dark

play14:56

theme I am working in Life theme right

play14:58

now now let's switch to a to a dark

play15:00

theme Cy is sinking and after a couple

play15:03

of seconds I am going to have the step

play15:05

by step necessary to change my ID to a

play15:08

dark theme and there it is I can use the

play15:10

askb command to do amazing SC where I'm

play15:13

working with giab compilot chat The Full

play15:16

Experience of using GitHub copilot in

play15:17

Visual Studio 2022 is amazing I really

play15:21

really like it if you want to learn more

play15:23

if you want to go deep in any of the

play15:25

topics that are available here please

play15:28

take a look look at these

play15:32

resources

Rate This

5.0 / 5 (0 votes)

Related Tags
GitHub CopilotVisual Studio 2022AI CodingCode SuggestionsCode RefactoringProgramming ProductivitySoftware DevelopmentIntelliSenseChat GPTTech Tutorial