Skip to content

Latest commit

 

History

History
46 lines (30 loc) · 2.95 KB

File metadata and controls

46 lines (30 loc) · 2.95 KB

ステップ 4: コメントを使ってCopilotでコードを生成する

素晴らしいですね、Copilotタブを活用しています! 🎉

ここまでで、Copilotのクイックタブの自動提案やCopilotハブを使ってAIが生成した提案を受け入れる方法を学びました。

次に、コメントを活用してCopilotの提案を生成する方法を見ていきましょう!

⌨️ アクティビティ: コメントからCopilot提案コードを生成する

  1. Solution Explorer内のコードスペースから、プロジェクトを右クリックして新しいファイルを作成します。

Note: もし前の手順でコードスペースを閉じた場合は、再度開くか新しいコードスペースを作成してください。

  1. Class を選択し、ファイル名を Comments.cs に設定します。

  2. Comments クラス内に次のコメントを入力します:

    // create a method that generates a comment for a given skill
    
  3. enter to go to a new line.

  4. Copilot will suggest a code block.

  5. 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 type control + enter to bring up the GitHub Copilot completions panel.

  6. Click Open Completions Panel. Copilot will synthesise around 10 different code suggestions. You should see something like this: VS Code showing suggestions to a comment

  7. Find a solution you like and click Accept Solution を押します。

  8. Comments.cs ファイルが解決済みの内容で更新されます。

⌨️ アクティビティ: コードスペースからリポジトリにコードをプッシュする

GitHub Copilotを使って変更内容を要約し、コードをコミットしましょう。

  1. Source Control タブを開きます。
  2. Message 入力欄の ✨ ボタンをタップして、Copilotにメッセージを生成させます。

Copilotでメッセージを生成するためにコミットタブを開く

  1. Commit ボタンをクリックします。

Exercise 4 - Using GitHub Copilot with C# に進んでください。

免責事項:
この文書は、AI翻訳サービスを使用して機械的に翻訳されています。正確性を追求しておりますが、自動翻訳には誤りや不正確な表現が含まれる可能性があります。原文(元の言語で記載された文書)が正式な情報源とみなされるべきです。重要な情報については、専門の人間による翻訳を推奨します。本翻訳の使用に起因する誤解や誤った解釈について、当方は一切の責任を負いません。