Get to know GitHub Copilot in VS Code and be productive IMMEDIATELY
Summary
TLDRGitHub Copilotは開発者のスキルを向上させるAIアシスタントです。インストール後、通常通りコーディングを始めることで「ゴーストテキスト」が自動的に有効になります。アイコンを確認してアクティブ状態を確認し、必要に応じて特定のファイルや言語で無効にできます。タブキーで補完を受け入れ、コマンドキーを併用して必要な分だけ補完を適用。代替の提案を見たい場合は、コマンドとエンターキーを押してサイドパネルを開きます。インラインチャットでコードを直接操作し、問題解決や意思決定を迅速に行うことができます。サイドバーのチャットエリアで問題解決や詳細の検討に役立て、全てのチャット履歴にアクセス可能です。GitHub Copilotはエラーの説明や修正にも優れ、ターミナルや他の場所でもサポートを提供しています。これらを駆使して開発者の生活をより良いものにしましょう。
Takeaways
- 🎉 GitHub Copilotは開発者のスキルを向上させるのに役立つとのことです。
- 🛠 特別な学習は必要なく、通常通りコーディングするだけでAIが働き始めます。
- 👻 「ゴーストテキスト」機能は、GitHub Copilotの拡張機能をインストールしてログインすると自動的に有効になります。
- 🔍 ステータスバーのアイコンでCopilotのアクティビティを確認できます。特定のファイルや言語でCopilotをオフにするにはアイコンをクリックします。
- ✅ コメントを書くことで、望む機能をCopilotに伝えることができます。
- 🗂 タブキーでGhost Textの補完を受け入れることができます。一部のみ必要な場合は、CtrlまたはCommandキーを押しながら右矢印キーで選択できます。
- 🔄 CtrlまたはCommandとEnterキーを同時に押すと、より多くの代替提案を見ることができます。
- 💬 「インラインチャット」機能を使うと、コード内で直接AIと対話できます。
- 📝 インラインチャットは、コードを反復的に改善するのに便利です。
- 🗃️ GitHub Copilotにはサイドバーにアクセスできるより従来のチャットエリアもあります。
- 🔧 コード内の問題がある場合、GitHub Copilotはライトバルブまたはクイック提案メニューでエラーを説明し、修正することもできます。
- ✨ スパークルアイコンをクリックすることで、ターミナルや他の場所でGitHub Copilotの助けを得ることができます。
Q & A
GitHub Copilotの使用を開始するにはどうすればよいですか?
-GitHub Copilotの使用を開始するには、まず拡張機能をインストールしてGitHubにログインします。その後、通常通りコードを書くだけで、AIが動作します。
Ghost Textとは何ですか?
-Ghost Textは、コードを書く際に自動的に提案されるテキストのことです。これにより、コーディングがスムーズに進みます。
GitHub Copilotがアクティブかどうかはどこで確認できますか?
-GitHub Copilotがアクティブかどうかは、ステータスバーのGitHub Copilotアイコンで確認できます。
Ghost Textの提案を受け入れるにはどうすればよいですか?
-Ghost Textの提案を受け入れるには、Tabキーを押します。部分的に受け入れる場合は、ControlキーまたはCommandキーを押しながら右矢印キーを押します。
Ghost Textを拒否するにはどうすればよいですか?
-Ghost Textを拒否するには、Escapeキーを押します。
Inline Chatとは何ですか?
-Inline Chatは、コード内で直接AIと対話できる機能です。ControlキーまたはCommandキーとIキーを押すことでトリガーされます。
GitHub Copilotのチャットエリアはどのようにアクセスしますか?
-GitHub Copilotのチャットエリアは、サイドバーのチャットアイコンをクリックすることでアクセスできます。
GitHub Copilotはどのようにエラーを修正しますか?
-GitHub Copilotは、コード内の問題が発生した際にライトバルブやクイックサジェストメニューでエラーの説明や修正提案を行います。
GitHub Copilotの履歴はどこで確認できますか?
-GitHub Copilotの履歴は、チャットのトップにある履歴アイコンをクリックすることで確認できます。
GitHub Copilotを特定のファイルや言語で無効にするにはどうすればよいですか?
-GitHub Copilotを特定のファイルや言語で無効にするには、ステータスバーのCopilotアイコンをクリックして無効にします。
Outlines
😀 GitHub Copilotの使い方と利点
GitHub Copilotは開発者のスキルを向上させるAIアシスタントで、使い始める方法やその機能について解説しています。Copilotは特別な学習は不要で、通常通りコーディングするだけで自動的に機能します。Ghost Text機能はコメントを書くことで自動的にコードを提案し、Tabキーで確定できます。Ghost Textの選択肢が合わなければ、ControlまたはCommandキーとEnterでサイドパネルから代替の提案を見ることができます。また、Inline Chatを利用してコード内で直接AIと対話し、コードの改善を行ったり、サイドバーのチャットエリアで問題解決や実装の詳細をブラストストームすることができます。エラー修正や問題解決にも利用でき、コードの改善案を提供します。
Transcripts
So you've got GitHub Copilot.
Congrats - Copilot can help you level up your skills as
a developer in ways that you probably thought were not
possible.
Seriously.
But now that you've got it, where do you start?
How does it work?
What do you need to learn?
We're gonna answer all of that in this video, and
I think you'll find that once you know how and
where to use Copilot, it is pretty simple to dramatically
increase your speed and productivity almost immediately.
The secret of GitHub Copilot is that there isn't anything
special that you need to do to learn how to
interact with it.
All you have to do to use GitHub Copilot is
code.
That's it.
Just code like you normally would and watch the AI
go to work.
This is called "Ghost Text", and it's automatically turned on
when you install the extension and log in to GitHub
Copilot.
You can verify that Copilot is active by checking for
the GitHub Copilot icon down here in your status bar,
and if you want to turn Copilot off for a
specific file or language, click on this icon and you
can disable it.
You can also trigger Ghost Text by writing a comment
expressing what you want.
To accept a Ghost text completion, press Tab.
If you only want part of the ghost text, you
can just hold down the Control or Command keys and
press the right arrow to accept as much or little
of it as you want, and you can hit escape
at any time to dismiss the ghost text.
You can do a lot with just Ghost Text, and
you'll find that Copilot is remarkably good at anticipating your
next move and doing a lot of the work for
you.
For example, if I create a variable called nums, Copilot
gives me what I probably want based on the name
of the variable and the function in the file already
an array of numbers.
And if I press enter below the function, it assumes
that I want to call the function and pass in
the nums variable, which is exactly what I want.
Now Ghost Text may give you what you want, or
it may be close and almost, but a miss.
In that case, you can see some alternative suggestions by
pressing the Control or Command and Enter keys.
This opens up a side panel where you can see
more suggestions from the AI that you might like better.
The other way that you can use GitHub Copilot right
in your code is to chat with it directly, right
here, using something that's called "Inline Chat."
This can be triggered with the Control or Command and
I keys.
None of this code actually exists in your file until
you accept it, so if you hit escape it will
all just go away.
No harm, no foul.
Inline Chat is great for iterating on your code right
in line.
So for instance here,
perhaps we want to return a static file at this
route instead of what Copilot gave us, so we can
highlight the block and iterate on that with Inline Chat.
And Inline Chat always gives you a diff view showing
you what's been added and changed so that you can
be sure that this is what you want before you
accept it.
GitHub Copilot also features a more traditional dedicated chat area
in the sidebar that you can access by clicking on
the chat icon.
If you've ever used another AI chat before, this will
feel very familiar.
While Ghost Text and Inline Chat are good for helping
you code faster, chat is good for helping you solve
problems and make decisions quicker.
It is terrific for brainstorming and figuring out implementation details.
You can always customize where the chat appears in your
editor.
So, for instance, if you'd like to see your code
and your project files in the chat all at the
same time, you can click on the secondary sidebar icon
and just drag the chat into that sidebar.
All of your chats are saved to a history that
you can access at any time with the history icon
at the top of the chat.
There are a few other places that you'll find GitHub
Copilot, and it can be quite useful.
One of them is when you have a problem in
your code,
you'll find GitHub Copilot here in the light bulb or
quick suggestion menu where it can explain and often even
fix your errors right inline.
Copilot is extremely good at fixing silly mistakes and explaining
compiler errors that otherwise make no sense.
You'll also find GitHub Copilot anywhere that you see this
sparkle icon.
This includes places like the Terminal and anywhere that GitHub
Copilot might be able to help you out.
All you have to do is keep your eye out
for the sparkle and when you see it, give it
a click and see what Copilot can do for you
right then and there.
And believe it or not, that's it.
You now know the essentials of how to interact with
GitHub Copilot.
Go forth and see how much better life can be
as a developer and make sure you check out our
other videos on GitHub Copilot for all your AI coding
needs.
Happy coding.
5.0 / 5 (0 votes)