Skip to content

Commit 7dfb673

Browse files
Translate to Japanese (#25)
1 parent 7121feb commit 7dfb673

File tree

4 files changed

+140
-66
lines changed

4 files changed

+140
-66
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
1-
# Shortcuts And Actions
1+
# 必須ショートカット機能の習得
22

3-
Through out this guided experience, you will see "shortcut" tags.
4-
These tags include the official name of each action and can be found
5-
using the the `Find Action...` feature of your IDE. Reference your
6-
preferences to find out what that shortcut is, but here are a few known
7-
shortcut combinations:
3+
この演習では ReSharper や Rider が提供する機能のうち、必須で習得して欲しい機能を学びます。
4+
この必須機能は、ショートカットで簡単、かつ、ダイレクトに呼び出すことが出来ます。
5+
6+
ショートカットキーはたくさんありますが、困ったら検索することが出来ます。
7+
困った時に探す方法を紹介するので、後述するチートシートを印刷して、マーカーを引いておくことを推奨します。
8+
9+
10+
## ショートカットキーと機能
11+
12+
`Find Action...` の機能を使うと、たくさんあるショートカットキーに割り当てられた機能を見つけ出すことが出来ます。ショートカットキーの設定はいくつかの代表的な設定があります。自分がどの設定を使っているか、InstallしたReSharper や Rider の Preferences (設定) を確認してください。
13+
14+
`Find Action...` の機能を呼び出す代表的なショートカットキーは以下の通りです:
815

916
- ReSharper Keymap on Windows: `Ctrl + Shift + A`
1017
- Visual Studio Keymap on Windows: `Ctrl + Shift + A`
1118
- Visual Studio Keymap on macOS: `Command (⌘) + Shift (⇧) + A`
1219

13-
The Keymap reference guide is also available online :
20+
ショートカットキーのチートシートがあります。
21+
22+
[Help] > [Keymap Reference] から自分が選択している Keymap のチートシートを選んで印刷し、デスクサイドに置いておくことを推奨します。
23+
24+
また、キーマップのリファレンスガイドはオンラインで参照できます:
1425

1526
- Rider: https://www.jetbrains.com/help/rider/Reference_Keymap_Rider.html
16-
- ReSharper: https://www.jetbrains.com/help/resharper/Reference__Keyboard_Shortcuts.html
27+
- ReSharper: https://www.jetbrains.com/help/resharper/Reference__Keyboard_Shortcuts.html

localized/ja/00-EssentialShortcuts/0.1-AltEnter.cs

+75-23
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,53 @@
22
{
33
// <shortcut id="Show context actions">Alt+Enter</shortcut>
44
//
5-
// Used to apply quick fixes to inspections ("squigglies"), or apply
6-
// context specific actions, depending on location of text caret
5+
// QuickFix 機能を使ってみましょう。
76
//
8-
// Also allows searching and applying all ReSharper commands direct
9-
// from the menu.
7+
// QuickFix は、Inspections (コード検査機能 = 波線で表示されるところ) や、
8+
// 現在のキャレット位置に応じて ReSharper や Rider が提供する機能を
9+
// 簡単に (ダイレクトに) 適用することが出来ます。
10+
//
11+
// もちろん、メニューから機能を選ぶことで、ReSharper や Rider が提供する
12+
// 全ての機能を選択して適用することもできます。
13+
//
14+
// QuickFix があることは、エディタの左側余白(行番号付近)に表示されます。
15+
// 例えば、以下のようなバリエーションがあります。
16+
// - 黄色の電球: 警告の修正
17+
// - 赤色の電球: エラーの修正
18+
// - ハンマー : コンテキストアクションの適用 (選択箇所特有の機能適用)
19+
// - などなど
20+
//
21+
// (補足)
22+
// 「コンテキスト」という言葉は日本語だと「文脈」と翻訳されますが、
23+
// 「その時の状況」といったイメージで理解すると良いでしょう。
24+
// ReSharper や Rider は、選択箇所そのものの問題だけでなく、
25+
// その時の状況 (前後関係やそこに至る文脈) に応じて
26+
// 推奨する改善や修正を提示してくれます。
27+
// ソフトウエア業界では、こういった前後関係の文脈や
28+
// 時間的連続性を言うときに「コンテキスト」という表現を
29+
// 使うことが多いです。
30+
// https://ja.wikipedia.org/wiki/%E3%82%B3%E3%83%B3%E3%83%86%E3%82%AF%E3%82%B9%E3%83%88
1031
//
11-
// Icon is displayed in gutter margin on left of editor, e.g. yellow
12-
// light bulb to fix warning, red light bulb to fix error, hammer to
13-
// apply a context action, etc.
1432

15-
// 1. Apply QuickFix for an inspection
16-
// The class doesn't match ReSharper's naming style
17-
// Place text caret on "squiggly". Note the lightbulb in the margin on the left
18-
// Click the light bulb, or hit <shortcut id="Show context actions">Alt+Enter</shortcut>
19-
// Select "Rename to 'BadlyNamedClass'" to fix
33+
// 1. Inspection (コード検査結果) に QuickFix を適用してみます
34+
// 設定で定義している命名スタイルと一致しないクラス名があったとします。
35+
// ReSharper や Rider は 波線で教えてくれます。
36+
//
37+
// badlyNamedClass に波線が引かれていると思います (*1)。
38+
// <shortcut id="Show context actions">Alt+Enter</shortcut> を押すか、
39+
// エディター左側の余白、行番号付近にある電球アイコンをクリックしましょう。
2040
//
21-
// (More on inspections in section 3)
41+
// "Rename to 'BadlyNamedClass'" とコードスタイルに設定されている
42+
// 命名規則に適合した修正が提案されているはずです。選択して修正してみましょう。
43+
//
44+
// (*1)
45+
// もし、badlyNamedClass に波線が引かれていない場合は、
46+
// あなたが使っている ReSharper や Rider のコードスタイル設定が、
47+
// この演習が期待している前提と違っている可能性が高いです。
48+
// コードスタイルの設定に関しては以下を参照してください。
49+
// https://www.jetbrains.com/resharper/features/code_formatting.html
50+
//
51+
// (Inspections (コード検査) については Section 3 で詳しく説明します)
2252
public class badlyNamedClass
2353
{
2454
}
@@ -27,20 +57,42 @@ public class ContextAction
2757
{
2858
public static string FormatString(string arg)
2959
{
30-
// 2. Apply context action
31-
// Place text caret on "arg"
32-
// Note the hammer action - a context action is available (no squiggly!)
33-
// Hit <shortcut id="Show context actions">Alt+Enter</shortcut>, select "To String.Format invocation"
60+
// 2. コンテキストアクションを適用してみます
61+
// 下の "arg" を選択してキャレットを置いてください。
62+
// ハンマーのアイコンが表示されましたか?
63+
// コンテキストアクションを使うことが出来ます(波線は出ませんので注意!)。
64+
// <shortcut id="Show context actions">Alt+Enter</shortcut> を押して、
65+
// "To String.Format invocation" を選択してください。
66+
// String.Format 形式に簡単に修正できます。
67+
//
68+
// (注意)
69+
// C#での文字列操作は気付かずパフォーマンス悪化に陥ることが多いです。
70+
// 言語仕様を理解していないと、メモリ消費、実行速度の2つの面で課題が出ます。
71+
// メモリ消費の観点では '+' 演算は使うべきではありません。
72+
// StringBuilder 、または内部的に StringBuilder を使っている
73+
// 文字列補完機能 '$' を使うべきです。
74+
// もし、実行速度にこだわるのであればもう少し実装方式を考える必要が出てくるでしょう。
75+
//
76+
// String 型と StringBuilder 型 の違い
77+
// https://docs.microsoft.com/ja-jp/dotnet/api/system.text.stringbuilder?view=net-5.0#the-string-and-stringbuilder-types
78+
//
79+
// Performance Of String Concatenation In C# (C#における文字列結合の性能考察)
80+
// https://dotnetcoretutorials.com/2020/02/06/performance-of-string-concatenation-in-c/
81+
//
3482
return "Hello" + arg + "World";
3583
}
3684
}
3785

38-
// 3. Go to action
39-
// Place text caret on class name below
40-
// <shortcut id="Show context actions">Alt+Enter</shortcut>, note magnifying glass
41-
// Click magnifying glass, start typing "rename"
42-
// Or, just start typing "rename" from menu
43-
// Filters ReSharper commands and applies
86+
// 3. Go to action 機能を使ってみます。
87+
// 下のクラス名のどこかにキャレットを置き、
88+
// <shortcut id="Show context actions">Alt+Enter</shortcut> を押します。
89+
//
90+
// コンテキストメニューが表示されている状態で 'rename' とタイプし、
91+
// たくさんの機能からフィルターして表示される 'Rename...' を選択します。
92+
//
93+
// このように、 ReSharper や Rider は、
94+
// 様々な場所で直接タイプすることで機能をフィルターし、
95+
// 直接呼び出すことが出来ます。
4496
public class GoToAction
4597
{
4698
}
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
# Essential Shortcuts - Search Everywhere
1+
# 必須ショートカット - Search Everywhere (どこでも検索)
22

3-
Search everywhere by name combines go to type, symbol, actions and file in one menu.
3+
Search Everywhere (どこでも検索) という、必ず覚えて欲しい必須機能のショートカットがあります。
4+
名前であらゆる場所を検索し、タイプ、シンボル、アクション、ファイルへの移動を全てここから行うことができます。
45

5-
<shortcut id="Search Everywhere">Ctrl+T</shortcut>
6+
| IDE種類 | ショートカット |
7+
| :--- | :--- |
8+
| ReSharper | <shortcut id="Search Everywhere">Ctrl+T</shortcut> |
9+
| Rider | <shortcut id="Search Everywhere">Shift, Shift (Double Shift)</shortcut> |
610

7-
`Escape` to cancel.
11+
`Escape` でキャンセルできます。
812

9-
Covered in more detail in next section
13+
詳細は次のセクションで説明します。

localized/ja/00-EssentialShortcuts/0.3-ContextualMenus.cs

+37-30
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,72 @@
11
namespace EssentialShortcuts
22
{
3-
// Navigate To menu
3+
// Navigate To メニューを使ってみます。
44
//
5-
// Displays a contextual menu of options you can use to navigate to from
6-
// your current location
5+
// 現在の場所から移動したい時に利用できるコンテキストメニューを表示します。
6+
// これ1つ覚えておけば目的ごとの個別ショートカットを憶える必要がない便利なナビゲーション機能です。
77
//
8-
// Very useful way of navigating without having to learn ALL of the shortcuts!
8+
// <shortcut id="Navigate To...">Ctrl+Shift+G (Rider Default Keymap)</shortcut>
9+
// <shortcut id="Navigate To...">Alt+` (Rider VisualStudio Keymap)</shortcut>
910
//
10-
// <shortcut id="Navigate To…">Alt+` (VS)</shortcut>
11+
// 下の例で試してみましょう。2つの方法があります。
12+
// クラス名にキャレットを置き、
13+
// 1. 上で示したショートカットで 'Navigate to...' を起動します。
14+
// 2. <shortcut id="Show context actions">Alt+Enter</shortcut> を押し、'Navigate To' とタイプします。
1115
//
12-
// 1. Place text caret on class name, invoke menu
13-
// 2. <shortcut id="Show context actions">Alt+Enter</shortcut>on class name, start typing (e.g. "Navigate To", "Extension methods")
16+
// いずれの場合も表示されたコンテキストメニューで任意のワードをタイプすると、その内容で機能がフィルターできます。
17+
// 例えば、 'Navigate to...' を起動したコンテキストメニューで 'Extension methods' とタイプしてみてください。
1418
//
15-
// (Most options not useful with this example. Covered in more detail in next section)
19+
// (ここで表示されるほとんどの選択肢はこの演習例では意味をなしません。後のセクションで詳しく説明します。)
1620
public class NavigateTo
1721
{
1822
}
1923

2024

21-
// Refactor This menu
25+
// Refactor This メニューを使ってみます。
2226
//
23-
// Displays a contextual menu of options for refactoring available at the current location
27+
// 現在の場所で利用可能なリファクタリングのメニューを表示します。
28+
// これも1つ覚えておけば目的ごとの個別ショートカットを憶える必要がない便利な機能です。
2429
//
25-
// Very useful for invoking refactorings without requiring to know ALL shortcuts
30+
// <shortcut id="Refactor This...">Ctrl+Alt+Shift+T (Rider Default Keymap)</shortcut>
31+
// <shortcut id="Refactor This...">Ctrl+Shift+R (Rider VisualStudio Keymap)</shortcut>
2632
//
27-
// <shortcut id="Refactor This...">Ctrl+Shift+R (VS + IntelliJ)</shortcut>
33+
// クラス名にキャレットを置き、
34+
// 3. 上で示したショートカットで 'Refactor This' を起動します。
35+
// rename を選択し、クラス名を rename してみましょう。
36+
// 4. <shortcut id="Show context actions">Alt+Enter</shortcut> を押し、'Refactor This' とタイプします。
37+
// 続けて 'Rename' とタイプして rename してみましょう。
2838
//
29-
// 3. Place text caret on class name, invoke menu
30-
// Select rename, rename class
31-
// 4. <shortcut id="Show context actions">Alt+Enter</shortcut> on class name, start typing (e.g. "Refactor This", "Rename")
32-
//
33-
// Covered in more detail in next section
39+
// (詳細は次のセクションで説明します。)
3440
public class RefactorThis
3541
{
3642
}
3743

3844

39-
// Generate Code menu
45+
// Generate Code メニューを使ってみます。
4046
//
41-
// Displays a contextual menu of options for generating code available at the current location
47+
// 現在の場所で利用可能なコード生成のメニューを表示します。
4248
//
43-
// <shortcut id="Generate...">Alt+Insert (in text editor)</shortcut>
49+
// <shortcut id="Generate...">Alt+Insert (in text editor / Rider Default Keymap)</shortcut>
50+
// <shortcut id="Generate...">Ctrl+N (in text editor / Rider VisualStudio Keymap)</shortcut>
4451
//
45-
// Covered in more detail in the Editing section
52+
// (詳細は Editing のセクションで説明します。)
4653
public class GenerateCode
4754
{
4855
}
4956

50-
// Inspect This menu
51-
//
52-
// Displays a contextual menu of options for analysing code and control flow
53-
// at the current location
57+
// Inspect This メニューを使ってみます。
5458
//
55-
// Very useful for invoking value analysis without learning ALL shortcuts!
59+
// 現在の場所で利用可能なコード解析とコントロールフローを分析するためのメニューを表示します。
60+
// これ1つ覚えておけば変数解析の個別ショートカットを憶える必要がない便利な機能です。
5661
//
57-
// <shortcut id="Inspect This...">Ctrl+Shift+Alt+A (VS + IntelliJ)</shortcut>
62+
// <shortcut id="Inspect This...">Ctrl+Shift+Alt+A (Common)</shortcut>
5863
//
59-
// 4. Place text caret on class name, invoke menu
60-
// 5. <shortcut id="Show context actions">Alt+Enter</shortcut> on class name, start typing (e.g. "Inspect This", "Hierarchies")
64+
// クラス名にキャレットを置き、
65+
// 5. 上で示したショートカットで 'Inspect This...' を起動します。
66+
// 6. <shortcut id="Show context actions">Alt+Enter</shortcut> を押し、 'Inspect This' とタイプします。
67+
// 続けて 'TypeHierarchy' とタイプして 継承関係を確認してみましょう。
6168
//
62-
// (Most options not useful with this example. Covered in more detail in later section)
69+
// (ここで表示されるほとんどの選択肢はこの演習例では意味をなしません。後のセクションで詳しく説明します。)
6370
public class InspectThis
6471
{
6572
}

0 commit comments

Comments
 (0)