0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Visual Studio】コードを素早く追跡するためのショートカット

0
Last updated at Posted at 2026-10-31

結論

調べたい処理が、どこに書かれているのか素早く見つける

image.png

詳細

Ctrl+F

ファイル内文字列検索

public TodoDto GetTodo(int id)
{
    var todo = _context.Todos.FirstOrDefault(x => x.Id == id);

    var dto = new TodoDto
    {
        Id = todo.Id,
        Title = todo.Title
    };

    return dto;
}
  • このファイルの中から todo という文字列を探したい場合に使う
  • Ctrl + F を押す
  • 検索欄に todo と入力
  • 該当箇所が順番に表示される
  • 現在開いているファイルの中だけを検索する機能

Ctrl+Shift+F

ソリューション全体文字列検索
→複数のファイルから該当箇所を探せる

F12

定義を見たいときに使用

Shift+12

どこでそれが参照されているかを確認できる

Alt+F12

  • Alt + F12は現在のコード画面を大きく切り替えずに、定義の中身を小さなウィンドウで確認できる
  • コードを読み進めながら、ちょっと中身を確認したいときに便利

Ctrl+T

  • Ctrl + T は「ファイル名・クラス名・メソッド名などを検索するショートカット」
  • Visual Studioで Ctrl + T を押すと、検索欄が表示される
  • 例えば、次のような検索ができる
    • TodoService → TodoServiceクラスを探す
    • GetTodo → GetTodoメソッドを探す
    • Todo.cs → Todo.csファイルを探す
  • Ctrl + Shift + F との違い
    • Ctrl + T ファイル・型・メンバーなど
    • Ctrl + Shift + F コード内に書かれている文字列
  • 例えば、「GetTodoというメソッドがどこに定義されているか探したい」なら Ctrl + T が便利
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?