Skip to content

Commit a03cdfd

Browse files
author
Kraig Brockschmidt
committed
Merge branch 'kraigb-python' of https://github.com/MicrosoftDocs/visualstudio-docs-pr into kraigb-python
2 parents 7c01866 + 5314990 commit a03cdfd

16 files changed

+136
-299
lines changed

docs/csharp-ide/rename-refactoring-csharp.md

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,6 @@ caps.latest.revision: 45
1919
author: "gewarren"
2020
ms.author: "gewarren"
2121
manager: "ghogen"
22-
translation.priority.ht:
23-
- "de-de"
24-
- "es-es"
25-
- "fr-fr"
26-
- "it-it"
27-
- "ja-jp"
28-
- "ko-kr"
29-
- "ru-ru"
30-
- "zh-cn"
31-
- "zh-tw"
32-
translation.priority.mt:
33-
- "cs-cz"
34-
- "pl-pl"
35-
- "pt-br"
36-
- "tr-tr"
3722
---
3823
# Rename Refactoring (C#)
3924
**Rename** is a refactoring feature in the Visual Studio integrated development environment (IDE) that provides an easy way to rename identifiers for code symbols such as fields, local variables, methods, namespaces, properties, and types. **Rename** can be used to change the names in comments and in strings and to change the declarations and calls of an identifier.
@@ -45,7 +30,7 @@ translation.priority.mt:
4530

4631
|Feature|Behavior of Refactoring in the IDE|
4732
|-------------|----------------------------------------|
48-
|Code Editor|In the Code Editor, rename refactoring is available when you position the cursor on certain types of code symbols. When the cursor is in this position, you can invoke the **Rename** command by typing the keyboard shortcut (CTRL + R, CTRL + R), or by selecting the **Rename** command from a smart tag, shortcut menu, or the **Refactor** menu.|
33+
|Code Editor|In the Code Editor, rename refactoring is available when you position the cursor on certain types of code symbols. When the cursor is in this position, you can invoke the **Rename** command by typing the keyboard shortcut (Ctrl + R, Ctrl + R), or by selecting the **Rename** command from Quick Actions, the shortcut menu, or the **Refactor** menu.|
4934
|Class View|When you select an identifier in Class View, rename refactoring is available from the shortcut menu and **Refactor** menu.|
5035
|Object Browser|When you select an identifier in Object Browser, rename refactoring is only available from the **Refactor** menu.|
5136
|Property Grid of the Windows Forms Designer|In the **Property Grid** of the Windows Forms Designer, changing the name of a control will initiate a rename operation for that control. The **Rename** dialog box will not appear.|
@@ -100,7 +85,7 @@ translation.priority.mt:
10085

10186
7. In the **Preview Changes** dialog box, click **Apply**.
10287

103-
#### To rename an identifier using smart tags
88+
#### To rename an identifier using Quick Actions
10489

10590
1. Create a console application named `RenameIdentifier`, and then replace `Program` with the following example code.
10691

@@ -123,22 +108,18 @@ translation.priority.mt:
123108
}
124109
```
125110

126-
2. In the declaration for `MethodB`, type or backspace over the method identifier. A smart tag prompt will appear below this identifier.
111+
2. In the declaration for `MethodB`, type or backspace over the method identifier. A Quick Actions light bulb will appear in the margin.
127112

128113
> [!NOTE]
129-
> You can only invoke rename refactoring using smart tags at the declaration of an identifier.
114+
> You can only invoke rename refactoring using Quick Actions at the declaration of an identifier.
130115

131-
3. Type the keyboard shortcut SHIFT+ALT+F10, and then press the DOWN ARROW to display the smart tag menu.
116+
3. Type the keyboard shortcut **Shift+Alt+F10** to display the Quick Actions menu.
132117

133118
-or-
134119

135-
Move the mouse pointer over the smart tag prompt to display the smart tag. Then move the mouse pointer over the smart tag and click the DOWN ARROW to display the smart tag menu.
120+
Click the black triangle next to the light bulb to display the Quick Actions menu.
136121

137-
4. Select the **Rename '\<identifer1>' to '\<identifier2>'** menu item to invoke rename refactoring without a preview of the changes to your code. All references to **\<identifer1>** will automatically be updated to **\<identifier2>**.
138-
139-
-or-
140-
141-
Select the **Rename with preview** menu item to invoke rename refactoring with a preview of the changes to your code. The **Preview Changes** dialog box will appear.
122+
4. Select the **Rename '\<identifer1>' to '\<identifier2>'** menu item to invoke rename refactoring. All references to **\<identifer1>** will automatically be updated to **\<identifier2>**.
142123

143124
## Remarks
144125

docs/data-tools/create-a-windows-form-to-search-data.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,6 @@ caps.latest.revision: 28
1717
author: "gewarren"
1818
ms.author: "gewarren"
1919
manager: "ghogen"
20-
translation.priority.ht:
21-
- "de-de"
22-
- "es-es"
23-
- "fr-fr"
24-
- "it-it"
25-
- "ja-jp"
26-
- "ko-kr"
27-
- "ru-ru"
28-
- "zh-cn"
29-
- "zh-tw"
30-
translation.priority.mt:
31-
- "cs-cz"
32-
- "pl-pl"
33-
- "pt-br"
34-
- "tr-tr"
3520
ms.technology: "vs-data-tools"
3621
---
3722
# Create a Windows Form to search data

docs/ide/codesnippet/CSharp/walkthrough-test-first-support-with-the-generate-from-usage-feature_5.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ public Automobile()
22
{
33
this.Model = "Not specified";
44
this.TopSpeed = -1;
5-
this.IsRunning = true;
5+
this.IsRunning = false;
66
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Sub New()
2-
Model = "Not specified"
3-
TopSpeed = -1
4-
IsRunning = True
5-
End Sub
1+
Sub New()
2+
Model = "Not specified"
3+
TopSpeed = -1
4+
IsRunning = False
5+
End Sub

docs/ide/go-to.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Visual Studio's **Go To** commands perform a focused search of your code to help
2525

2626
Input | Function
2727
------------ | ---
28-
**Keyboard** | Press **Ctrl + T**
28+
**Keyboard** | Press **Ctrl + t** or **Ctrl + ,**
2929
**Mouse** | Select **Edit**, **Go To**, **Go To All**
3030

3131
This will display a small window at the top right of your code editor, by default.
26.8 KB
Loading

docs/ide/media/genclass_underline.png

2.27 KB
Loading
4.59 KB
Loading

docs/ide/media/genotherdialog.png

-3.92 KB
Loading

docs/ide/navigating-code.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Go To has the following commands, which are available in the **Edit** menu under
7070

7171
- **Go To Line** (**Ctrl + G**): Move to the specified line number in the active document.
7272

73-
- **Go to All** (**Ctrl + T**): Move to the specified line, type, file, member, or symbol.
73+
- **Go to All** (**Ctrl + T** or **Ctrl + ,**): Move to the specified line, type, file, member, or symbol.
7474

7575
- **Go to File** (**Ctrl + 1**, **Ctrl + F**): Move to the specified file in the solution.
7676

docs/ide/productivity-tips-for-visual-studio.md

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,6 @@ caps.latest.revision: 28
1313
author: "gewarren"
1414
ms.author: "gewarren"
1515
manager: "ghogen"
16-
translation.priority.ht:
17-
- "cs-cz"
18-
- "de-de"
19-
- "es-es"
20-
- "fr-fr"
21-
- "it-it"
22-
- "ja-jp"
23-
- "ko-kr"
24-
- "pl-pl"
25-
- "pt-br"
26-
- "ru-ru"
27-
- "tr-tr"
28-
- "zh-cn"
29-
- "zh-tw"
3016
---
3117
# Productivity Tips for Visual Studio
3218
By following these tips, you can more quickly and efficiently write, navigate, and debug your code in Visual Studio. For more information about common keyboard shortcuts, see [Tips and Tricks](../ide/tips-and-tricks-for-visual-studio.md). For a more complete list, see [Identifying and Customizing Keyboard Shortcuts](../ide/identifying-and-customizing-keyboard-shortcuts-in-visual-studio.md) and [Default Keyboard Shortcuts](../ide/default-keyboard-shortcuts-in-visual-studio.md).
@@ -85,23 +71,11 @@ By following these tips, you can more quickly and efficiently write, navigate, a
8571

8672
To insert a snippet, on the menu bar, choose **Edit**, **IntelliSense**, **Insert Snippet** or open the shortcut menu in a file and choose **Insert Snippet**. For more information, see [Code Snippets](../ide/code-snippets.md).
8773

88-
- **Fix code errors inline**. Smart Tags appear as blue or red boxes under a line of code. You can display Smart Tag options by pointing to one of the boxes or by placing the cursor in the line of code and choosing the Ctrl + . (period) keys.
89-
90-
Blue boxes suggest ways to fix errors in your code.
91-
92-
Figure 1: Error Smart Tags
93-
94-
![Error Smart Tag Suggestions](../ide/media/productivity_bluesmarttags.png "Productivity_BlueSmartTags")
95-
96-
Red boxes suggest ways to refactor your code.
97-
98-
Figure 2: Refactoring Smart Tags
99-
100-
![Refactor Smart Tag Suggestions](../ide/media/productivity_redsmarttags.png "Productivity_RedSmartTags")
101-
74+
- **Fix code errors inline**. Quick Actions let you easily refactor, generate, or otherwise modify code with a single action. These actions can be applied using the Light Bulb icon ![Small Light Bulb Icon](media/vs2015_lightbulbsmall.png "VS2017_LightBulbSmall"), or by pressing **Alt + Enter** or **Ctrl + .** when your cursor is on the appropriate line of code. See [Quick Actions](quick-actions.md) for more information.
75+
10276
- **Show and edit the definition of a code element**. You can quickly show and edit the module in which a code element, such as a member, a variable, or a local, is defined.
10377

104-
To open a definition in a pop-up window, highlight the element and then choose the Alt+F12 keys, or open the shortcut menu for the element and then choose **Peek Definition**. To open a definition in a separate code window, open the shortcut menu for the element, and then choose **Go to Definition**.
78+
To open a definition in a pop-up window, highlight the element and then choose the **Alt+F12** keys, or open the shortcut menu for the element and then choose **Peek Definition**. To open a definition in a separate code window, open the shortcut menu for the element, and then choose **Go to Definition**.
10579

10680
## <a name="BKMK_Navigating"></a> Navigating Within Your Code
10781
You can use various techniques to find and move to specific locations in your code more quickly.

docs/ide/quick-actions.md

Lines changed: 20 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,6 @@ manager: "ghogen"
1616
dev_langs:
1717
- CSharp
1818
- VB
19-
translation.priority.ht:
20-
- "cs-cz"
21-
- "de-de"
22-
- "es-es"
23-
- "fr-fr"
24-
- "it-it"
25-
- "ja-jp"
26-
- "ko-kr"
27-
- "pl-pl"
28-
- "pt-br"
29-
- "ru-ru"
30-
- "tr-tr"
31-
- "zh-cn"
32-
- "zh-tw"
3319
---
3420
# Quick Actions
3521

@@ -56,7 +42,7 @@ Here are some of the common Quick Actions which are applicable to both C# and Vi
5642
### Add missing cases/default case/both
5743
When creating a `switch` statement in C#, or `Select Case` statement in Visual Basic, you can use a Code Action to automatically add missing case items, a default case statement, or both. For an empty statement like the following:
5844

59-
```CSharp
45+
```csharp
6046
enum MyEnum
6147
{
6248
Item1,
@@ -72,8 +58,7 @@ switch(myEnum)
7258
{
7359
}
7460
```
75-
76-
```VB
61+
```vb
7762
Enum MyEnum
7863
Item1
7964
Item2
@@ -90,7 +75,7 @@ End Select
9075

9176
Using the **Add Both** Quick Action to fill in both missing cases and a default case will create the following:
9277

93-
```CSharp
78+
```csharp
9479
switch(myEnum)
9580
{
9681
case MyEnum.Item1:
@@ -103,8 +88,7 @@ switch(myEnum)
10388
break;
10489
}
10590
```
106-
107-
```VB
91+
```vb
10892
Select Case myEnum
10993
Case MyEnum.Item1
11094
Exit Select
@@ -118,7 +102,7 @@ End Select
118102
### Correct misspelled type
119103
If you accidentally misspell a type in Visual Studio, this Quick Action will automatically correct it for you. You will see these items in the light bulb menu as **"Change '*misspelled type*' to '*correct type*'**. For example:
120104

121-
```CSharp
105+
```csharp
122106
// Before
123107
private viod MyMethod()
124108
{
@@ -131,8 +115,7 @@ private void MyMethod()
131115
{
132116
}
133117
```
134-
135-
```VB
118+
```vb
136119
' Before
137120
Function MyFunction as Intger
138121
End Function
@@ -147,7 +130,7 @@ End Function
147130
### Remove unnecessary cast
148131
If you cast a type to another type which doesn't require a cast, the **Remove Unnecessary Cast** Quick Action item will remove the cast from your code.
149132

150-
```CSharp
133+
```csharp
151134
// before
152135
int number = (int)3;
153136

@@ -156,8 +139,7 @@ int number = (int)3;
156139
// after
157140
int number = 3;
158141
```
159-
160-
```VB
142+
```vb
161143
' Before
162144
Dim number as Integer = CType(3, Integer)
163145

@@ -170,7 +152,7 @@ Dim number as Integer = 3
170152
### Replace method with property / Replace property with method
171153
These Quick Actions will convert a method to a property, or vice versa. The example below shows the change from a method to a property. For the opposite case, simply invert the *Before* and *After* sections.
172154

173-
```CSharp
155+
```csharp
174156
private int MyValue;
175157

176158
// Before
@@ -187,8 +169,7 @@ public int MyValue
187169
get { return MyValue; }
188170
}
189171
```
190-
191-
```VB
172+
```vb
192173
Dim MyValue As Integer
193174

194175
' Before
@@ -209,7 +190,7 @@ End Property
209190
### Make Method Synchronous
210191
When using the `async`/`Async` keyword on a method, it is expected that somewhere inside that method the `await`/`Await` keyword will also be used. However, if this isn't the case, a Quick Action will appear that will allow you to make the method synchronous by removing the `async`/`Async` keyword and changing the return type. Use the **Make method synchronous** option from the Quick Actions menu.
211192

212-
```CSharp
193+
```csharp
213194
// Before
214195
async Task<int> MyAsyncMethod()
215196
{
@@ -224,8 +205,7 @@ int MyAsyncMethod()
224205
return 3;
225206
}
226207
```
227-
228-
```VB
208+
```vb
229209
' Before
230210
Async Function MyAsyncMethod() As Task(Of Integer)
231211
Return 3
@@ -242,7 +222,7 @@ End Function
242222
### Make Method Asynchronous
243223
When using the `await`/`Await` keyword inside of a method, it is expected that the method itself is marked with the `async`/`Async` keyword. However, if this isn't the case, a Quick Action will appear that will allow you to make the method asynchronous. Use the **Make method/Function asynchronous** option from the Quick Actions menu.
244224

245-
```CSharp
225+
```csharp
246226
// Before
247227
int MyAsyncMethod()
248228
{
@@ -257,8 +237,7 @@ async Task<int> MyAsyncMethod()
257237
return await Task.Run(...);
258238
}
259239
```
260-
261-
```VB
240+
```vb
262241
' Before
263242
Function MyAsyncMethod() as Integer
264243
Return Await Task.Run(...)
@@ -283,7 +262,7 @@ Using types located in other projects in your solution will display the Quick Ac
283262

284263
When enabled, if you use a type in a namespace that is currently not imported, but exists in a reference assembly or NuGet package, the using/import statement will be created.
285264

286-
```CSharp
265+
```csharp
287266
// Before
288267
Debug.WriteLine("Hello");
289268

@@ -294,8 +273,7 @@ using System.Diagnostics;
294273

295274
Debug.WriteLine("Hello");
296275
```
297-
298-
```VB
276+
```vb
299277
' Before
300278
Debug.WriteLine("Hello")
301279

@@ -310,7 +288,7 @@ Debug.WriteLine("Hello")
310288
### Convert to Interpolated String
311289
[Interpolated strings](/dotnet/csharp/language-reference/keywords/interpolated-strings) are an easy way to express strings with embedded variables, similar to the **[String.Format](https://msdn.microsoft.com/library/system.string.format.aspx)** method. This Quick Action recognizes cases where strings are concatenated, or using **String.Format**, and changes the usage to an interpolated string.
312290

313-
```CSharp
291+
```csharp
314292
// Before
315293
int num = 3;
316294
string s = string.Format("My string with {0} in the middle", num);
@@ -321,8 +299,7 @@ string s = string.Format("My string with {0} in the middle", num);
321299
int num = 3;
322300
string s = $"My string with {num} in the middle";
323301
```
324-
325-
```VB
302+
```vb
326303
' Before
327304
Dim num as Integer = 3
328305
Dim s as String = String.Format("My string with {0} in the middle", num)
@@ -376,7 +353,7 @@ This Quick Action enables you to add separator characters into literal values. (
376353
### Convert **if** construct to **switch**
377354
This Quick Action enables you to convert an **if-then-else** construct to a **switch** construct. (Available only in Visual Studio 2017 (version 15.3 - Preview).)
378355

379-
```CSharp
356+
```csharp
380357
// Before
381358
if (obj is string s)
382359
{
@@ -401,8 +378,7 @@ switch (obj)
401378
break;
402379
}
403380
```
404-
405-
```VB
381+
```vb
406382
' Before
407383
If TypeOf obj Is String s Then
408384
Console.WriteLine("obj is a string: " + s)

0 commit comments

Comments
 (0)