You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/ide/quick-actions.md
+97-8Lines changed: 97 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,22 @@
1
1
---
2
2
title: "Quick Actions | Microsoft Docs"
3
3
ms.custom: ""
4
-
ms.date: "03/10/2017"
4
+
ms.date: "05/08/2017"
5
5
ms.reviewer: ""
6
6
ms.suite: ""
7
-
ms.technology:
7
+
ms.technology:
8
8
- "vs-ide-general"
9
9
ms.tgt_pltfrm: ""
10
10
ms.topic: "article"
11
11
ms.devlang: csharp
12
12
ms.assetid: e173fb7d-c5bd-4568-ba0f-aa61913b3244
13
-
author: "BrianPeek"
14
-
ms.author: "brpeek"
13
+
author: "kempb"
14
+
ms.author: "kempb"
15
15
manager: "ghogen"
16
16
dev_langs:
17
17
- CSharp
18
18
- VB
19
-
translation.priority.ht:
19
+
translation.priority.ht:
20
20
- "cs-cz"
21
21
- "de-de"
22
22
- "es-es"
@@ -100,7 +100,7 @@ switch(myEnum)
100
100
caseMyEnum.Item3:
101
101
break;
102
102
default:
103
-
break;
103
+
break;
104
104
}
105
105
```
106
106
@@ -308,7 +308,7 @@ Debug.WriteLine("Hello")
308
308
```
309
309
310
310
### Convert to Interpolated String
311
-
[Interpolated strings](/dotnet/articles/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(v=vs.110).aspx)** method. This Quick Action will recognize cases where strings are concatenated, or using **String.Format**, and change the usage to an interpolated string.
311
+
[Interpolated strings](/dotnet/articles/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.
312
312
313
313
```CSharp
314
314
// Before
@@ -334,5 +334,94 @@ Dim num as Integer = 3
334
334
DimsAsString= $"My string with {num} in the middle"
335
335
```
336
336
337
+
### Remove merge conflict markers
338
+
These Quick Actions enable you to resolve merge conflicts by "taking a change", which removes the conflicting code and markers. (Available only in Visual Studio 2017 (version 15.3 - Preview).)
This Quick Action enables you to add a check in your code to tell whether a parameter is null. (Available only in Visual Studio 2017 (version 15.3 - Preview).)
When you're creating a constructor, this Quick Action enables you to select the properties or fields to generate, or you can generate the constructor from an empty body. You can also use it to add parameters to an existing constructor from the call-site. (Available only in Visual Studio 2017 (version 15.3 - Preview).)
This Quick Action enables you to remove variables that have been declared but never used in your code. (Available only in Visual Studio 2017 (version 15.3 - Preview).)
This Quick Action enables you to create an override from a blank line in a class or struct. The **Pick Members** dialog box lets you choose the members to override. (Available only in Visual Studio 2017 (version 15.3 - Preview).)
This Quick Action enables you to convert a numeric literal from one base numeric system to another. For example, you can change a number to hexadecimal or to binary format. (Available only in Visual Studio 2017 (version 15.3 - Preview).)
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).)
378
+
379
+
```CSharp
380
+
// Before
381
+
if (objisstrings)
382
+
{
383
+
Console.WriteLine("obj is a string: "+s);
384
+
}
385
+
386
+
elseif (objisinti&&i>10)
387
+
{
388
+
Console.WriteLine("obj is an int greater than 10");
389
+
}
390
+
391
+
// Convert to switch
392
+
393
+
// After
394
+
switch (obj)
395
+
{
396
+
casestrings:
397
+
Console.WriteLine("Obj is a string: "+s);
398
+
break;
399
+
caseintiwheni>10:
400
+
Console.WriteLine("obj is an int greater than 10");
401
+
break;
402
+
}
403
+
```
404
+
405
+
```VB
406
+
' Before
407
+
IfTypeOfobjIsStringsThen
408
+
Console.WriteLine("obj is a string: "+s)
409
+
ElseIfTypeOfobjIsIntegeriAndi>10Then
410
+
Console.WriteLine("obj is an int greater than 10")
411
+
EndIf
412
+
413
+
' Convert to switch
414
+
415
+
' After
416
+
SelectCaseobj
417
+
CaseStrings
418
+
Console.WriteLine("Obj is a string: "+s)
419
+
ExitSub
420
+
CaseIntegeriwheni>10
421
+
Console.WriteLine("obj is an int greater than 10")
422
+
ExitSub
423
+
EndSelect
424
+
```
425
+
337
426
# See Also
338
-
*[Code Styles and Quick Actions](code-styles-and-quick-actions.md)
427
+
*[Code Styles and Quick Actions](code-styles-and-quick-actions.md)
0 commit comments