Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into virtualCharRune
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrusNajmabadi committed Mar 29, 2020
2 parents 9f3f0a4 + c5a98d8 commit 0653414
Show file tree
Hide file tree
Showing 93 changed files with 319 additions and 365 deletions.
5 changes: 4 additions & 1 deletion src/Analyzers/CSharp/Analyzers/CSharpAnalyzers.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)CSharpAnalyzersResources.resx" GenerateSource="true" Link="CSharpAnalyzersResources.resx" />
<None Include="$(MSBuildThisFileDirectory)CSharpAnalyzersResources.resx" />
<None Include="$(MSBuildThisFileDirectory)CSharpAnalyzersResources.resx">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)AddAccessibilityModifiers\CSharpAddAccessibilityModifiersDiagnosticAnalyzer.cs" />
Expand All @@ -29,6 +31,7 @@
<Compile Include="$(MSBuildThisFileDirectory)RemoveUnreachableCode\RemoveUnreachableCodeHelpers.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UseCoalesceExpression\CSharpUseCoalesceExpressionDiagnosticAnalyzer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UseCoalesceExpression\CSharpUseCoalesceExpressionForNullableDiagnosticAnalyzer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UseDefaultLiteral\CSharpUseDefaultLiteralDiagnosticAnalyzer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UseExpressionBody\Helpers\UseExpressionBodyForAccessorsHelper.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UseExpressionBody\Helpers\UseExpressionBodyForConstructorsHelper.cs" />
Expand Down
6 changes: 6 additions & 0 deletions src/Analyzers/CSharp/Analyzers/CSharpAnalyzersResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -201,4 +201,10 @@
<data name="default_expression_can_be_simplified" xml:space="preserve">
<value>'default' expression can be simplified</value>
</data>
<data name="Deconstruct_variable_declaration" xml:space="preserve">
<value>Deconstruct variable declaration</value>
</data>
<data name="Variable_declaration_can_be_deconstructed" xml:space="preserve">
<value>Variable declaration can be deconstructed</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using System.Collections.Generic;
using System.Collections.Immutable;
using System.Composition;
using System.Linq;
using System.Threading;
using Microsoft.CodeAnalysis.CodeStyle;
Expand All @@ -18,15 +17,15 @@

namespace Microsoft.CodeAnalysis.CSharp.UseDeconstruction
{
[DiagnosticAnalyzer(LanguageNames.CSharp), Shared]
[DiagnosticAnalyzer(LanguageNames.CSharp)]
internal class CSharpUseDeconstructionDiagnosticAnalyzer : AbstractBuiltInCodeStyleDiagnosticAnalyzer
{
public CSharpUseDeconstructionDiagnosticAnalyzer()
: base(IDEDiagnosticIds.UseDeconstructionDiagnosticId,
CSharpCodeStyleOptions.PreferDeconstructedVariableDeclaration,
LanguageNames.CSharp,
new LocalizableResourceString(nameof(FeaturesResources.Deconstruct_variable_declaration), FeaturesResources.ResourceManager, typeof(FeaturesResources)),
new LocalizableResourceString(nameof(FeaturesResources.Variable_declaration_can_be_deconstructed), FeaturesResources.ResourceManager, typeof(FeaturesResources)))
new LocalizableResourceString(nameof(CSharpAnalyzersResources.Deconstruct_variable_declaration), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources)),
new LocalizableResourceString(nameof(CSharpAnalyzersResources.Variable_declaration_can_be_deconstructed), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources)))
{
}

Expand Down
10 changes: 10 additions & 0 deletions src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.cs.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<target state="new">Convert switch statement to expression</target>
<note />
</trans-unit>
<trans-unit id="Deconstruct_variable_declaration">
<source>Deconstruct variable declaration</source>
<target state="new">Deconstruct variable declaration</target>
<note />
</trans-unit>
<trans-unit id="Simplify_default_expression">
<source>Simplify 'default' expression</source>
<target state="new">Simplify 'default' expression</target>
Expand Down Expand Up @@ -127,6 +132,11 @@
<target state="new">Use 'switch' expression</target>
<note />
</trans-unit>
<trans-unit id="Variable_declaration_can_be_deconstructed">
<source>Variable declaration can be deconstructed</source>
<target state="new">Variable declaration can be deconstructed</target>
<note />
</trans-unit>
<trans-unit id="default_expression_can_be_simplified">
<source>'default' expression can be simplified</source>
<target state="new">'default' expression can be simplified</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.de.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<target state="new">Convert switch statement to expression</target>
<note />
</trans-unit>
<trans-unit id="Deconstruct_variable_declaration">
<source>Deconstruct variable declaration</source>
<target state="new">Deconstruct variable declaration</target>
<note />
</trans-unit>
<trans-unit id="Simplify_default_expression">
<source>Simplify 'default' expression</source>
<target state="new">Simplify 'default' expression</target>
Expand Down Expand Up @@ -127,6 +132,11 @@
<target state="new">Use 'switch' expression</target>
<note />
</trans-unit>
<trans-unit id="Variable_declaration_can_be_deconstructed">
<source>Variable declaration can be deconstructed</source>
<target state="new">Variable declaration can be deconstructed</target>
<note />
</trans-unit>
<trans-unit id="default_expression_can_be_simplified">
<source>'default' expression can be simplified</source>
<target state="new">'default' expression can be simplified</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<target state="new">Convert switch statement to expression</target>
<note />
</trans-unit>
<trans-unit id="Deconstruct_variable_declaration">
<source>Deconstruct variable declaration</source>
<target state="new">Deconstruct variable declaration</target>
<note />
</trans-unit>
<trans-unit id="Simplify_default_expression">
<source>Simplify 'default' expression</source>
<target state="new">Simplify 'default' expression</target>
Expand Down Expand Up @@ -127,6 +132,11 @@
<target state="new">Use 'switch' expression</target>
<note />
</trans-unit>
<trans-unit id="Variable_declaration_can_be_deconstructed">
<source>Variable declaration can be deconstructed</source>
<target state="new">Variable declaration can be deconstructed</target>
<note />
</trans-unit>
<trans-unit id="default_expression_can_be_simplified">
<source>'default' expression can be simplified</source>
<target state="new">'default' expression can be simplified</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.fr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<target state="new">Convert switch statement to expression</target>
<note />
</trans-unit>
<trans-unit id="Deconstruct_variable_declaration">
<source>Deconstruct variable declaration</source>
<target state="new">Deconstruct variable declaration</target>
<note />
</trans-unit>
<trans-unit id="Simplify_default_expression">
<source>Simplify 'default' expression</source>
<target state="new">Simplify 'default' expression</target>
Expand Down Expand Up @@ -127,6 +132,11 @@
<target state="new">Use 'switch' expression</target>
<note />
</trans-unit>
<trans-unit id="Variable_declaration_can_be_deconstructed">
<source>Variable declaration can be deconstructed</source>
<target state="new">Variable declaration can be deconstructed</target>
<note />
</trans-unit>
<trans-unit id="default_expression_can_be_simplified">
<source>'default' expression can be simplified</source>
<target state="new">'default' expression can be simplified</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.it.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<target state="new">Convert switch statement to expression</target>
<note />
</trans-unit>
<trans-unit id="Deconstruct_variable_declaration">
<source>Deconstruct variable declaration</source>
<target state="new">Deconstruct variable declaration</target>
<note />
</trans-unit>
<trans-unit id="Simplify_default_expression">
<source>Simplify 'default' expression</source>
<target state="new">Simplify 'default' expression</target>
Expand Down Expand Up @@ -127,6 +132,11 @@
<target state="new">Use 'switch' expression</target>
<note />
</trans-unit>
<trans-unit id="Variable_declaration_can_be_deconstructed">
<source>Variable declaration can be deconstructed</source>
<target state="new">Variable declaration can be deconstructed</target>
<note />
</trans-unit>
<trans-unit id="default_expression_can_be_simplified">
<source>'default' expression can be simplified</source>
<target state="new">'default' expression can be simplified</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ja.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<target state="new">Convert switch statement to expression</target>
<note />
</trans-unit>
<trans-unit id="Deconstruct_variable_declaration">
<source>Deconstruct variable declaration</source>
<target state="new">Deconstruct variable declaration</target>
<note />
</trans-unit>
<trans-unit id="Simplify_default_expression">
<source>Simplify 'default' expression</source>
<target state="new">Simplify 'default' expression</target>
Expand Down Expand Up @@ -127,6 +132,11 @@
<target state="new">Use 'switch' expression</target>
<note />
</trans-unit>
<trans-unit id="Variable_declaration_can_be_deconstructed">
<source>Variable declaration can be deconstructed</source>
<target state="new">Variable declaration can be deconstructed</target>
<note />
</trans-unit>
<trans-unit id="default_expression_can_be_simplified">
<source>'default' expression can be simplified</source>
<target state="new">'default' expression can be simplified</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ko.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<target state="new">Convert switch statement to expression</target>
<note />
</trans-unit>
<trans-unit id="Deconstruct_variable_declaration">
<source>Deconstruct variable declaration</source>
<target state="new">Deconstruct variable declaration</target>
<note />
</trans-unit>
<trans-unit id="Simplify_default_expression">
<source>Simplify 'default' expression</source>
<target state="new">Simplify 'default' expression</target>
Expand Down Expand Up @@ -127,6 +132,11 @@
<target state="new">Use 'switch' expression</target>
<note />
</trans-unit>
<trans-unit id="Variable_declaration_can_be_deconstructed">
<source>Variable declaration can be deconstructed</source>
<target state="new">Variable declaration can be deconstructed</target>
<note />
</trans-unit>
<trans-unit id="default_expression_can_be_simplified">
<source>'default' expression can be simplified</source>
<target state="new">'default' expression can be simplified</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<target state="new">Convert switch statement to expression</target>
<note />
</trans-unit>
<trans-unit id="Deconstruct_variable_declaration">
<source>Deconstruct variable declaration</source>
<target state="new">Deconstruct variable declaration</target>
<note />
</trans-unit>
<trans-unit id="Simplify_default_expression">
<source>Simplify 'default' expression</source>
<target state="new">Simplify 'default' expression</target>
Expand Down Expand Up @@ -127,6 +132,11 @@
<target state="new">Use 'switch' expression</target>
<note />
</trans-unit>
<trans-unit id="Variable_declaration_can_be_deconstructed">
<source>Variable declaration can be deconstructed</source>
<target state="new">Variable declaration can be deconstructed</target>
<note />
</trans-unit>
<trans-unit id="default_expression_can_be_simplified">
<source>'default' expression can be simplified</source>
<target state="new">'default' expression can be simplified</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<target state="new">Convert switch statement to expression</target>
<note />
</trans-unit>
<trans-unit id="Deconstruct_variable_declaration">
<source>Deconstruct variable declaration</source>
<target state="new">Deconstruct variable declaration</target>
<note />
</trans-unit>
<trans-unit id="Simplify_default_expression">
<source>Simplify 'default' expression</source>
<target state="new">Simplify 'default' expression</target>
Expand Down Expand Up @@ -127,6 +132,11 @@
<target state="new">Use 'switch' expression</target>
<note />
</trans-unit>
<trans-unit id="Variable_declaration_can_be_deconstructed">
<source>Variable declaration can be deconstructed</source>
<target state="new">Variable declaration can be deconstructed</target>
<note />
</trans-unit>
<trans-unit id="default_expression_can_be_simplified">
<source>'default' expression can be simplified</source>
<target state="new">'default' expression can be simplified</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.ru.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<target state="new">Convert switch statement to expression</target>
<note />
</trans-unit>
<trans-unit id="Deconstruct_variable_declaration">
<source>Deconstruct variable declaration</source>
<target state="new">Deconstruct variable declaration</target>
<note />
</trans-unit>
<trans-unit id="Simplify_default_expression">
<source>Simplify 'default' expression</source>
<target state="new">Simplify 'default' expression</target>
Expand Down Expand Up @@ -127,6 +132,11 @@
<target state="new">Use 'switch' expression</target>
<note />
</trans-unit>
<trans-unit id="Variable_declaration_can_be_deconstructed">
<source>Variable declaration can be deconstructed</source>
<target state="new">Variable declaration can be deconstructed</target>
<note />
</trans-unit>
<trans-unit id="default_expression_can_be_simplified">
<source>'default' expression can be simplified</source>
<target state="new">'default' expression can be simplified</target>
Expand Down
10 changes: 10 additions & 0 deletions src/Analyzers/CSharp/Analyzers/xlf/CSharpAnalyzersResources.tr.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<target state="new">Convert switch statement to expression</target>
<note />
</trans-unit>
<trans-unit id="Deconstruct_variable_declaration">
<source>Deconstruct variable declaration</source>
<target state="new">Deconstruct variable declaration</target>
<note />
</trans-unit>
<trans-unit id="Simplify_default_expression">
<source>Simplify 'default' expression</source>
<target state="new">Simplify 'default' expression</target>
Expand Down Expand Up @@ -127,6 +132,11 @@
<target state="new">Use 'switch' expression</target>
<note />
</trans-unit>
<trans-unit id="Variable_declaration_can_be_deconstructed">
<source>Variable declaration can be deconstructed</source>
<target state="new">Variable declaration can be deconstructed</target>
<note />
</trans-unit>
<trans-unit id="default_expression_can_be_simplified">
<source>'default' expression can be simplified</source>
<target state="new">'default' expression can be simplified</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<target state="new">Convert switch statement to expression</target>
<note />
</trans-unit>
<trans-unit id="Deconstruct_variable_declaration">
<source>Deconstruct variable declaration</source>
<target state="new">Deconstruct variable declaration</target>
<note />
</trans-unit>
<trans-unit id="Simplify_default_expression">
<source>Simplify 'default' expression</source>
<target state="new">Simplify 'default' expression</target>
Expand Down Expand Up @@ -127,6 +132,11 @@
<target state="new">Use 'switch' expression</target>
<note />
</trans-unit>
<trans-unit id="Variable_declaration_can_be_deconstructed">
<source>Variable declaration can be deconstructed</source>
<target state="new">Variable declaration can be deconstructed</target>
<note />
</trans-unit>
<trans-unit id="default_expression_can_be_simplified">
<source>'default' expression can be simplified</source>
<target state="new">'default' expression can be simplified</target>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
<target state="new">Convert switch statement to expression</target>
<note />
</trans-unit>
<trans-unit id="Deconstruct_variable_declaration">
<source>Deconstruct variable declaration</source>
<target state="new">Deconstruct variable declaration</target>
<note />
</trans-unit>
<trans-unit id="Simplify_default_expression">
<source>Simplify 'default' expression</source>
<target state="new">Simplify 'default' expression</target>
Expand Down Expand Up @@ -127,6 +132,11 @@
<target state="new">Use 'switch' expression</target>
<note />
</trans-unit>
<trans-unit id="Variable_declaration_can_be_deconstructed">
<source>Variable declaration can be deconstructed</source>
<target state="new">Variable declaration can be deconstructed</target>
<note />
</trans-unit>
<trans-unit id="default_expression_can_be_simplified">
<source>'default' expression can be simplified</source>
<target state="new">'default' expression can be simplified</target>
Expand Down
1 change: 1 addition & 0 deletions src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<Compile Include="$(MSBuildThisFileDirectory)RemoveUnusedMembers\CSharpRemoveUnusedMembersCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UseDefaultLiteral\CSharpUseDefaultLiteralCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UseExpressionBody\UseExpressionBodyCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs" />
Expand Down
Loading

0 comments on commit 0653414

Please sign in to comment.