素晴らしいですね、Copilotタブを活用しています! 🎉
ここまでで、Copilotのクイックタブの自動提案やCopilotハブを使ってAIが生成した提案を受け入れる方法を学びました。
次に、コメントを活用してCopilotの提案を生成する方法を見ていきましょう!
- Solution Explorer内のコードスペースから、プロジェクトを右クリックして新しいファイルを作成します。
Note: もし前の手順でコードスペースを閉じた場合は、再度開くか新しいコードスペースを作成してください。
-
Class を選択し、ファイル名を
Comments.cs
に設定します。 -
Comments クラス内に次のコメントを入力します:
// create a method that generates a comment for a given skill
-
enter
to go to a new line. -
Copilot will suggest a code block.
-
Hover over the red squiggly and select the
...
Note If you don't see the copilot code block suggestion or the red squiggly and the three dots
...
, you can typecontrol + enter
to bring up the GitHub Copilot completions panel. -
Click
Open Completions Panel
. Copilot will synthesise around 10 different code suggestions. You should see something like this: -
Find a solution you like and click
Accept Solution
を押します。 -
Comments.cs
ファイルが解決済みの内容で更新されます。
GitHub Copilotを使って変更内容を要約し、コードをコミットしましょう。
- Source Control タブを開きます。
- Message 入力欄の ✨ ボタンをタップして、Copilotにメッセージを生成させます。
- Commit ボタンをクリックします。
Exercise 4 - Using GitHub Copilot with C# に進んでください。
免責事項:
この文書は、AI翻訳サービスを使用して機械的に翻訳されています。正確性を追求しておりますが、自動翻訳には誤りや不正確な表現が含まれる可能性があります。原文(元の言語で記載された文書)が正式な情報源とみなされるべきです。重要な情報については、専門の人間による翻訳を推奨します。本翻訳の使用に起因する誤解や誤った解釈について、当方は一切の責任を負いません。