0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

GitHub Copilot スラッシュコマンド

Posted at

💻 VS Code におけるコマンド&ワークスペース操作ガイド

VS Code や AI コーディングアシスタントと連携して、開発効率を向上させるためのコマンド群を紹介します。以下のコマンドを使えば、コードの理解、テスト、修正、新規作成などを素早く実行できます。

以下は、/help で表示される一覧です。

@workspace

  • 用途: ワークスペースに関する質問をする

/explain

  • 用途: アクティブなエディターで開いているコードの仕組みを説明してくれます
  • : main.tsのコードの流れや処理の意味を知りたいとき

スクリーンショット 2025-04-25 19.50.00.png

/tests

  • 用途: 選択したコードに対して、単体テストコード(ユニットテスト)を生成
  • : add()関数を選んで「/tests」と入力すると、Jest などのテストコードを自動生成

スクリーンショット 2025-04-25 19.39.22.png

/fix

  • 用途: 選択したコードに対して、問題の修正案を提案してくれます
  • : バグがある関数を選択して「/fix」で修正ポイントを確認

スクリーンショット 2025-04-25 19.44.58.png

/new

  • 用途: 新しいファイルやプロジェクトのスキャフォールディング(雛形コード)を生成
  • : React の新しいページファイルなどを生成

スクリーンショット 2025-04-25 19.59.47.png

/newNotebook

  • 用途: 新しい Jupyter Notebook ファイル(.ipynb)を作成
  • 活用例: データ分析や機械学習プロジェクトの開始時に便利

スクリーンショット 2025-04-25 20.09.59.png

/setupTests(試験段階)

  • 用途: プロジェクト全体でテスト環境を構築する(JestやMochaの初期設定など)

@vscode

  • 用途: VS Code の設定・操作に関する質問ができる

/search

  • 用途: ワークスペース内で検索するためのクエリパラメータを生成
  • : 特定の関数や変数の使用箇所を絞り込み検索

スクリーンショット 2025-04-25 20.14.13.png

/startDebugging

  • 用途: VS Code でデバッグ構成(launch.json)を自動生成して、即デバッグをスタート

@terminal

  • 用途: ターミナルコマンドに関する操作方法を確認できる

/explain

  • 用途: ターミナルコマンドの意味や実行結果を解説してくれる
  • : main.tsのコードの流れや処理の意味を知りたいとき

スクリーンショット 2025-04-25 19.44.58.png

@github

  • 用途: GitHub のリポジトリ検索や、コード検索、エンタープライズナレッジの取得に使える
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?