diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 25342c1531094..a5f540e20249e 100644
--- a/azure-pipelines.yml
+++ b/azure-pipelines.yml
@@ -268,3 +268,17 @@ jobs:
parameters:
jobName: Correctness_Rebuild
configuration: Release
+
+- job: Correctness_Analyzers
+ pool:
+ name: NetCore1ESPool-Public
+ demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Pre.Open
+ timeoutInMinutes: 35
+ steps:
+ - template: eng/pipelines/checkout-windows-task.yml
+
+ - task: PowerShell@2
+ displayName: Build with analyzers
+ inputs:
+ filePath: eng/build.ps1
+ arguments: -restore -build -configuration Debug -prepareMachine -ci -binaryLog -runAnalyzers:$true -warnAsError:$true -properties "/p:RoslynEnforceCodeStyle=true"
diff --git a/dotnet-tools.json b/dotnet-tools.json
index 447b894f9dc94..b81fdc2997f8c 100644
--- a/dotnet-tools.json
+++ b/dotnet-tools.json
@@ -2,7 +2,7 @@
"isRoot": true,
"tools": {
"dotnet-format": {
- "version": "6.3.317301",
+ "version": "6.4.326609",
"commands": [
"dotnet-format"
]
diff --git a/eng/Versions.props b/eng/Versions.props
index 35ff9797cc2af..9efa0df71c9f7 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -15,7 +15,7 @@
Keep the setting conditional. The toolset sets the assembly version to 42.42.42.42 if not set explicitly.
-->
$(MajorVersion).$(MinorVersion).0.0
- 4.2.0-1.final
+ 4.3.0-1.final
@@ -24,7 +24,7 @@
1.1.2-beta1.22122.4
0.1.132-beta
- 4.2.0-2.final
+ 4.3.0-1.final
17.3.37-preview
diff --git a/src/Analyzers/CSharp/Tests/AliasAmbiguousType/AliasAmbiguousTypeTests.cs b/src/Analyzers/CSharp/Tests/AliasAmbiguousType/AliasAmbiguousTypeTests.cs
index c4cd1021c0fd4..88c2ed760d403 100644
--- a/src/Analyzers/CSharp/Tests/AliasAmbiguousType/AliasAmbiguousTypeTests.cs
+++ b/src/Analyzers/CSharp/Tests/AliasAmbiguousType/AliasAmbiguousTypeTests.cs
@@ -34,11 +34,11 @@ private static string GetAmbiguousDefinition(string typeDefinion)
=> $@"
namespace N1
{{
- { typeDefinion }
+ {typeDefinion}
}}
namespace N2
{{
- { typeDefinion }
+ {typeDefinion}
}}";
[Fact, Trait(Traits.Feature, Traits.Features.CodeActionsAliasAmbiguousType)]
diff --git a/src/Analyzers/CSharp/Tests/UseIndexOrRangeOperator/UseRangeOperatorTests.cs b/src/Analyzers/CSharp/Tests/UseIndexOrRangeOperator/UseRangeOperatorTests.cs
index 59dcb0c223c92..89a27047e1858 100644
--- a/src/Analyzers/CSharp/Tests/UseIndexOrRangeOperator/UseRangeOperatorTests.cs
+++ b/src/Analyzers/CSharp/Tests/UseIndexOrRangeOperator/UseRangeOperatorTests.cs
@@ -960,7 +960,7 @@ public class C
public class Test
{{
public object M(C c)
- => { subStringCode };
+ => {subStringCode};
}}";
var fixedSource =
@$"
@@ -971,7 +971,7 @@ public class C
public class Test
{{
public object M(C c)
- => { rangeCode };
+ => {rangeCode};
}}";
await new VerifyCS.Test
{
diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncMethodBuilderOverrideTests.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncMethodBuilderOverrideTests.cs
index e76fddcd11a38..d4376cd3e4eb2 100644
--- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncMethodBuilderOverrideTests.cs
+++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenAsyncMethodBuilderOverrideTests.cs
@@ -2085,7 +2085,7 @@ public void BuilderOnMethod_InternalReturnType()
[AsyncMethodBuilder(null)] internal class MyTaskType {{ }}
// Make the builder factory and the builder internal as well
-{AsyncBuilderCode("MyTaskTypeBuilder", "MyTaskType").Replace("public class MyTaskType", "internal class MyTaskType") }
+{AsyncBuilderCode("MyTaskTypeBuilder", "MyTaskType").Replace("public class MyTaskType", "internal class MyTaskType")}
class C
{{
diff --git a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenOperators.cs b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenOperators.cs
index d3cfb27c9413a..482f4f502c04b 100644
--- a/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenOperators.cs
+++ b/src/Compilers/CSharp/Test/Emit/CodeGen/CodeGenOperators.cs
@@ -5173,7 +5173,7 @@ static void Main()
public static long Calculate1(long[] f)
{
-" + $" return { BuildSequenceOfBinaryExpressions_01() };" + @"
+" + $" return {BuildSequenceOfBinaryExpressions_01()};" + @"
}
public static long Calculate2(long[] f)
@@ -5233,7 +5233,7 @@ static void Main()
public static double Calculate(long[] f)
{
-" + $" return checked({ BuildSequenceOfBinaryExpressions_01() });" + @"
+" + $" return checked({BuildSequenceOfBinaryExpressions_01()});" + @"
}
}
";
@@ -5264,7 +5264,7 @@ static void Main()
public static bool Calculate(bool[] a, bool[] f)
{
-" + $" return { BuildSequenceOfBinaryExpressions_03(count) };" + @"
+" + $" return {BuildSequenceOfBinaryExpressions_03(count)};" + @"
}
}
";
@@ -5323,7 +5323,7 @@ static void Main()
public static double? Calculate(float?[] f)
{
-" + $" return { BuildSequenceOfBinaryExpressions_01() };" + @"
+" + $" return {BuildSequenceOfBinaryExpressions_01()};" + @"
}
}
";
@@ -5364,7 +5364,7 @@ static void Test1()
public static double? Calculate(double?[] f)
{
-" + $" return { BuildSequenceOfBinaryExpressions_01(count) };" + @"
+" + $" return {BuildSequenceOfBinaryExpressions_01(count)};" + @"
}
static void Test2()
@@ -5380,7 +5380,7 @@ static void Test2()
public static double Calculate(double[] f)
{
-" + $" return { BuildSequenceOfBinaryExpressions_01(count) };" + @"
+" + $" return {BuildSequenceOfBinaryExpressions_01(count)};" + @"
}
}
";
@@ -5403,7 +5403,7 @@ static void Main()
public static bool Calculate(S1[] a, S1[] f)
{
-" + $" return { BuildSequenceOfBinaryExpressions_03() };" + @"
+" + $" return {BuildSequenceOfBinaryExpressions_03()};" + @"
}
}
diff --git a/src/Compilers/CSharp/Test/Emit2/Diagnostics/OperationAnalyzerTests.cs b/src/Compilers/CSharp/Test/Emit2/Diagnostics/OperationAnalyzerTests.cs
index faf119b347e7e..a5f46893e3e8a 100644
--- a/src/Compilers/CSharp/Test/Emit2/Diagnostics/OperationAnalyzerTests.cs
+++ b/src/Compilers/CSharp/Test/Emit2/Diagnostics/OperationAnalyzerTests.cs
@@ -1328,7 +1328,7 @@ class Test
public static long Calculate1(long[] f)
{
long x;
-" + $" x = { buildSequenceOfBinaryExpressions(8192) };" + @"
+" + $" x = {buildSequenceOfBinaryExpressions(8192)};" + @"
return x;
}
}";
@@ -1336,8 +1336,8 @@ public static long Calculate1(long[] f)
CreateCompilationWithMscorlib45(source)
.VerifyDiagnostics()
.VerifyAnalyzerDiagnostics(new DiagnosticAnalyzer[] { new AssignmentOperationSyntaxTestAnalyzer() }, null, null,
- Diagnostic(AssignmentOperationSyntaxTestAnalyzer.AssignmentOperationDescriptor.Id, $"x = { buildSequenceOfBinaryExpressions(8192) }").WithLocation(7, 9),
- Diagnostic(AssignmentOperationSyntaxTestAnalyzer.AssignmentSyntaxDescriptor.Id, $"x = { buildSequenceOfBinaryExpressions(8192) }").WithLocation(7, 9));
+ Diagnostic(AssignmentOperationSyntaxTestAnalyzer.AssignmentOperationDescriptor.Id, $"x = {buildSequenceOfBinaryExpressions(8192)}").WithLocation(7, 9),
+ Diagnostic(AssignmentOperationSyntaxTestAnalyzer.AssignmentSyntaxDescriptor.Id, $"x = {buildSequenceOfBinaryExpressions(8192)}").WithLocation(7, 9));
}
[WorkItem(9020, "https://github.com/dotnet/roslyn/issues/9020")]
diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/RecordStructTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/RecordStructTests.cs
index af189f60d2298..0875bde258167 100644
--- a/src/Compilers/CSharp/Test/Semantic/Semantics/RecordStructTests.cs
+++ b/src/Compilers/CSharp/Test/Semantic/Semantics/RecordStructTests.cs
@@ -3933,7 +3933,7 @@ public void Deconstruct_UserDefined_Accessibility_07(string accessibility)
$@"
record struct A(int X)
{{
- { accessibility } void Deconstruct(out int a)
+ {accessibility} void Deconstruct(out int a)
=> throw null;
}}
";
@@ -4241,7 +4241,7 @@ public void RecordEquals_10(string accessibility)
$@"
record struct A
{{
- { accessibility } bool Equals(A x)
+ {accessibility} bool Equals(A x)
=> throw null;
bool System.IEquatable.Equals(A x) => throw null;
@@ -4271,7 +4271,7 @@ public void RecordEquals_11(string accessibility)
$@"
record struct A
{{
- { accessibility } bool Equals(A x)
+ {accessibility} bool Equals(A x)
=> throw null;
bool System.IEquatable.Equals(A x) => throw null;
diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/RecordTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/RecordTests.cs
index b1fb16a62054e..a4a057e66f280 100644
--- a/src/Compilers/CSharp/Test/Semantic/Semantics/RecordTests.cs
+++ b/src/Compilers/CSharp/Test/Semantic/Semantics/RecordTests.cs
@@ -14006,7 +14006,7 @@ public void CopyCtor_Accessibility_01(string accessibility)
$@"
record A(int X)
{{
- { accessibility } A(A a)
+ {accessibility} A(A a)
=> throw null;
}}
";
@@ -14027,7 +14027,7 @@ public void CopyCtor_Accessibility_02(string accessibility)
$@"
record A(int X)
{{
- { accessibility } A(A a)
+ {accessibility} A(A a)
=> System.Console.Write(""RAN"");
public static void Main()
@@ -14053,7 +14053,7 @@ public void CopyCtor_Accessibility_03(string accessibility)
$@"
sealed record A(int X)
{{
- { accessibility } A(A a)
+ {accessibility} A(A a)
=> System.Console.Write(""RAN"");
public static void Main()
@@ -14086,7 +14086,7 @@ public void CopyCtor_Accessibility_04(string accessibility)
$@"
sealed record A(int X)
{{
- { accessibility } A(A a)
+ {accessibility} A(A a)
=> System.Console.Write(""RAN"");
public static void Main()
@@ -15551,7 +15551,7 @@ public void Deconstruct_UserDefined_Accessibility_07(string accessibility)
$@"
record A(int X)
{{
- { accessibility } void Deconstruct(out int a)
+ {accessibility} void Deconstruct(out int a)
=> throw null;
}}
";
@@ -18440,7 +18440,7 @@ public void RecordEquals_10(string accessibility)
$@"
record A
{{
- { accessibility } virtual bool Equals(A x)
+ {accessibility} virtual bool Equals(A x)
=> throw null;
bool System.IEquatable.Equals(A x) => throw null;
@@ -18466,7 +18466,7 @@ public void RecordEquals_11(string accessibility)
$@"
record A
{{
- { accessibility } virtual bool Equals(A x)
+ {accessibility} virtual bool Equals(A x)
=> throw null;
bool System.IEquatable.Equals(A x) => throw null;
@@ -19001,7 +19001,7 @@ public void EqualityContract_05(string accessibility)
$@"
record A
{{
- { accessibility } virtual System.Type EqualityContract
+ {accessibility} virtual System.Type EqualityContract
=> throw null;
}}
";
@@ -19022,7 +19022,7 @@ public void EqualityContract_06(string accessibility)
$@"
record A
{{
- { accessibility } virtual System.Type EqualityContract
+ {accessibility} virtual System.Type EqualityContract
=> throw null;
bool System.IEquatable.Equals(A x) => throw null;
diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/TopLevelStatementsTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/TopLevelStatementsTests.cs
index 1355a19ac9cb8..98065b0ae78f7 100644
--- a/src/Compilers/CSharp/Test/Semantic/Semantics/TopLevelStatementsTests.cs
+++ b/src/Compilers/CSharp/Test/Semantic/Semantics/TopLevelStatementsTests.cs
@@ -7610,9 +7610,9 @@ public void Return_01()
-
+
-
+
@@ -7657,9 +7657,9 @@ public void Return_02()
-
+
-
+
@@ -7704,9 +7704,9 @@ public void Return_03()
-
+
-
+
@@ -7735,8 +7735,8 @@ public void Return_03()
-
-
+
+
@@ -7773,9 +7773,9 @@ public void Return_04()
-
+
-
+
@@ -7805,8 +7805,8 @@ public void Return_04()
-
-
+
+
diff --git a/src/Compilers/Server/VBCSCompilerTests/CompilerServerTests.cs b/src/Compilers/Server/VBCSCompilerTests/CompilerServerTests.cs
index 7d3727a204824..084293f127f64 100644
--- a/src/Compilers/Server/VBCSCompilerTests/CompilerServerTests.cs
+++ b/src/Compilers/Server/VBCSCompilerTests/CompilerServerTests.cs
@@ -235,7 +235,7 @@ private static (T Result, string Output) UseTextWriter(Encoding encoding, Fun
currentDirectory: tempDir);
if (result.ExitCode != 0)
{
- AssertEx.Fail($"Deterministic compile failed \n stdout: { result.Output }");
+ AssertEx.Fail($"Deterministic compile failed \n stdout: {result.Output}");
}
var listener = await serverData.Complete();
Assert.Equal(CompletionData.RequestCompleted, listener.CompletionDataList.Single());
@@ -1503,7 +1503,7 @@ private async Task RunDeterministicTest(string source)
{
if (first[i] != second[i])
{
- AssertEx.Fail($"Bytes were different at position { i } ({ first[i] } vs { second[i] }). Flags used were (\"{ finalFlags1 }\" vs \"{ finalFlags2 }\")");
+ AssertEx.Fail($"Bytes were different at position {i} ({first[i]} vs {second[i]}). Flags used were (\"{finalFlags1}\" vs \"{finalFlags2}\")");
}
}
}
diff --git a/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/KeywordCompletionProviderTests.cs b/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/KeywordCompletionProviderTests.cs
index d47ed942af886..4b20752f53bd4 100644
--- a/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/KeywordCompletionProviderTests.cs
+++ b/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/KeywordCompletionProviderTests.cs
@@ -550,7 +550,7 @@ class C
{{
void M()
{{
- var data = (n$$) { (hasNewline ? Environment.NewLine : string.Empty) } M();
+ var data = (n$$) {(hasNewline ? Environment.NewLine : string.Empty)} M();
}}
}}";
@@ -588,7 +588,7 @@ public async Task TestInCastExpressionThatMightBeParenthesizedExpression2(bool h
var markup =
$@"class C
{{
- bool Prop => (t$$) { (hasExpression ? "n" : string.Empty) }
+ bool Prop => (t$$) {(hasExpression ? "n" : string.Empty)}
private int n;
}}";
if (hasExpression)
diff --git a/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/OperatorCompletionProviderTests.cs b/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/OperatorCompletionProviderTests.cs
index 5869337fe5125..c101644ed83ba 100644
--- a/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/OperatorCompletionProviderTests.cs
+++ b/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/OperatorCompletionProviderTests.cs
@@ -666,7 +666,7 @@ public static void Main()
s.$$
}}
}}";
- await VerifyItemExistsAsync(string.Format(template, $"public static bool operator {operatorSign}(S a, S b)"), operatorSign, inlineDescription: $"x { operatorSign } y");
+ await VerifyItemExistsAsync(string.Format(template, $"public static bool operator {operatorSign}(S a, S b)"), operatorSign, inlineDescription: $"x {operatorSign} y");
await VerifyNoItemsExistAsync(string.Format(template, $"public static int operator {operatorSign}(S a, S b)"));
await VerifyNoItemsExistAsync(string.Format(template, $"public static bool operator {operatorSign}(S a, S b, S c)"));
await VerifyNoItemsExistAsync(string.Format(template, $"public static bool operator {operatorSign}(S a, object b)"));
diff --git a/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/SymbolCompletionProviderTests.cs b/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/SymbolCompletionProviderTests.cs
index 41baa0adc2592..10678041484e5 100644
--- a/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/SymbolCompletionProviderTests.cs
+++ b/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/SymbolCompletionProviderTests.cs
@@ -8361,7 +8361,7 @@ void goo()
";
- var expectedDescription = $"({ FeaturesResources.field }) int C.x";
+ var expectedDescription = $"({FeaturesResources.field}) int C.x";
await VerifyItemInLinkedFilesAsync(markup, "x", expectedDescription);
}
diff --git a/src/EditorFeatures/CSharpTest/ConvertCast/ConvertDirectCastToTryCastTests.cs b/src/EditorFeatures/CSharpTest/ConvertCast/ConvertDirectCastToTryCastTests.cs
index 9265b9e572c80..2283783f1251c 100644
--- a/src/EditorFeatures/CSharpTest/ConvertCast/ConvertDirectCastToTryCastTests.cs
+++ b/src/EditorFeatures/CSharpTest/ConvertCast/ConvertDirectCastToTryCastTests.cs
@@ -296,7 +296,7 @@ class Program
{{
public static void Main()
{{
- var x = { cast };
+ var x = {cast};
}}
}}
";
@@ -307,7 +307,7 @@ class Program
{{
public static void Main()
{{
- var x = { asExpression };
+ var x = {asExpression};
}}
}}
";
@@ -350,7 +350,7 @@ class Program
{{
public static void Main()
{{
- var x = { cast };
+ var x = {cast};
}}
}}
";
@@ -359,7 +359,7 @@ class Program
{{
public static void Main()
{{
- var x = { asExpression };
+ var x = {asExpression};
}}
}}
";
diff --git a/src/EditorFeatures/CSharpTest/ConvertCast/ConvertTryCastToDirectCastTests.cs b/src/EditorFeatures/CSharpTest/ConvertCast/ConvertTryCastToDirectCastTests.cs
index c293fb5596ed4..f68a30c5bdf42 100644
--- a/src/EditorFeatures/CSharpTest/ConvertCast/ConvertTryCastToDirectCastTests.cs
+++ b/src/EditorFeatures/CSharpTest/ConvertCast/ConvertTryCastToDirectCastTests.cs
@@ -97,7 +97,7 @@ class Program
{{
public static void Main()
{{
- var x = { asExpression };
+ var x = {asExpression};
}}
}}
";
@@ -108,7 +108,7 @@ class Program
{{
public static void Main()
{{
- var x = { cast };
+ var x = {cast};
}}
}}
";
@@ -132,7 +132,7 @@ class Program
{{
public static void Main()
{{
- var x = { asExpression };
+ var x = {asExpression};
}}
}}
";
@@ -141,7 +141,7 @@ class Program
{{
public static void Main()
{{
- var x = { cast };
+ var x = {cast};
}}
}}
";
@@ -171,7 +171,7 @@ class Program
{{
public static void Main()
{{
- var x = { asExpression };
+ var x = {asExpression};
}}
}}
";
@@ -180,7 +180,7 @@ class Program
{{
public static void Main()
{{
- var x = { cast };
+ var x = {cast};
}}
}}
";
diff --git a/src/EditorFeatures/CSharpTest/EditorConfigSettings/Updater/SettingsUpdaterTests.cs b/src/EditorFeatures/CSharpTest/EditorConfigSettings/Updater/SettingsUpdaterTests.cs
index 9d222a586b960..5067ad6a8b1c8 100644
--- a/src/EditorFeatures/CSharpTest/EditorConfigSettings/Updater/SettingsUpdaterTests.cs
+++ b/src/EditorFeatures/CSharpTest/EditorConfigSettings/Updater/SettingsUpdaterTests.cs
@@ -433,7 +433,7 @@ public async Task TestNamingStyleSettingsUpdater()
dotnet_naming_rule.{(CompilerExtensionsResources.Types + "_should_be_" + CompilerExtensionsResources.Pascal_Case.Replace(' ', '_')).ToLowerInvariant()}.style = {CompilerExtensionsResources.Pascal_Case.Replace(' ', '_').ToLowerInvariant()}
dotnet_naming_rule.{(CompilerExtensionsResources.Non_Field_Members.Replace(' ', '_').Replace('-', '_') + "_should_be_" + CompilerExtensionsResources.Pascal_Case.Replace(' ', '_')).ToLowerInvariant()}.severity = suggestion
-dotnet_naming_rule.{(CompilerExtensionsResources.Non_Field_Members.Replace(' ', '_').Replace('-', '_') + "_should_be_" + CompilerExtensionsResources.Pascal_Case.Replace(' ', '_')).ToLowerInvariant()}.symbols = { CompilerExtensionsResources.Non_Field_Members.Replace(' ', '_').Replace('-', '_').ToLowerInvariant()}
+dotnet_naming_rule.{(CompilerExtensionsResources.Non_Field_Members.Replace(' ', '_').Replace('-', '_') + "_should_be_" + CompilerExtensionsResources.Pascal_Case.Replace(' ', '_')).ToLowerInvariant()}.symbols = {CompilerExtensionsResources.Non_Field_Members.Replace(' ', '_').Replace('-', '_').ToLowerInvariant()}
dotnet_naming_rule.{(CompilerExtensionsResources.Non_Field_Members.Replace(' ', '_').Replace('-', '_') + "_should_be_" + CompilerExtensionsResources.Pascal_Case.Replace(' ', '_')).ToLowerInvariant()}.style = {CompilerExtensionsResources.Pascal_Case.Replace(' ', '_').ToLowerInvariant()}
# {CompilerExtensionsResources.Symbol_specifications}
diff --git a/src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs b/src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs
index cf539ac9ce91d..75fef9a7f03dd 100644
--- a/src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs
+++ b/src/EditorFeatures/CSharpTest/QuickInfo/SemanticQuickInfoSourceTests.cs
@@ -6366,7 +6366,7 @@ void M(int x = 1) { }
";
using var workspace = TestWorkspace.Create(XElement.Parse(workspaceDefinition), workspaceKind: WorkspaceKind.Interactive);
- await TestWithOptionsAsync(workspace, MainDescription($"({ FeaturesResources.parameter }) int x = 1"));
+ await TestWithOptionsAsync(workspace, MainDescription($"({FeaturesResources.parameter}) int x = 1"));
}
[Fact, Trait(Traits.Feature, Traits.Features.QuickInfo)]
@@ -6410,7 +6410,7 @@ void M()
}
}
",
- MainDescription($"({ FeaturesResources.local_variable }) ValueTuple y"));
+ MainDescription($"({FeaturesResources.local_variable}) ValueTuple y"));
}
[WorkItem(18311, "https://github.com/dotnet/roslyn/issues/18311")]
@@ -6446,7 +6446,7 @@ void M()
}
}
",
- MainDescription($"({ FeaturesResources.local_variable }) ValueTuple y"));
+ MainDescription($"({FeaturesResources.local_variable}) ValueTuple y"));
}
[WorkItem(18311, "https://github.com/dotnet/roslyn/issues/18311")]
@@ -6482,7 +6482,7 @@ void M()
}
}
",
- MainDescription($"({ FeaturesResources.local_variable }) (int, int) y"));
+ MainDescription($"({FeaturesResources.local_variable}) (int, int) y"));
}
[WorkItem(18311, "https://github.com/dotnet/roslyn/issues/18311")]
@@ -6756,7 +6756,7 @@ void method1()
}
}
",
- MainDescription($"({ FeaturesResources.parameter }) ? b"));
+ MainDescription($"({FeaturesResources.parameter}) ? b"));
}
[Fact, Trait(Traits.Feature, Traits.Features.QuickInfo)]
diff --git a/src/EditorFeatures/CSharpTest/Workspaces/WorkspaceTests_EditorFeatures.cs b/src/EditorFeatures/CSharpTest/Workspaces/WorkspaceTests_EditorFeatures.cs
index 1c702ce23bc64..3d7d3cf6428c4 100644
--- a/src/EditorFeatures/CSharpTest/Workspaces/WorkspaceTests_EditorFeatures.cs
+++ b/src/EditorFeatures/CSharpTest/Workspaces/WorkspaceTests_EditorFeatures.cs
@@ -1328,7 +1328,7 @@ public async Task TestLinkedFilesStayInSync()
var input = $@"
- { originalText }
+ {originalText}
diff --git a/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/CompileExpressionsTests.cs b/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/CompileExpressionsTests.cs
index a57c5a235a6a4..e8442a32cbffd 100644
--- a/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/CompileExpressionsTests.cs
+++ b/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/CompileExpressionsTests.cs
@@ -352,7 +352,7 @@ static void G(out object o)
out var errorMessages);
Assert.Null(assembly);
AssertEx.Equal(
- new[] { $"(1,11): error CS8185: { CSharpResources.ERR_DeclarationExpressionNotPermitted }" },
+ new[] { $"(1,11): error CS8185: {CSharpResources.ERR_DeclarationExpressionNotPermitted}" },
errorMessages);
Assert.True(methodTokens.IsEmpty);
});
diff --git a/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/MissingAssemblyTests.cs b/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/MissingAssemblyTests.cs
index 46d0e6f849c3a..0980ff3bb0f8b 100644
--- a/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/MissingAssemblyTests.cs
+++ b/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/MissingAssemblyTests.cs
@@ -669,7 +669,7 @@ void M()
out errorMessage);
Assert.Equal(2, numRetries); // Ensure that we actually retried and that we bailed out on the second retry if the same identity was seen in the diagnostics.
- Assert.Equal($"error CS0012: { string.Format(CSharpResources.ERR_NoTypeDef, "MissingType", missingIdentity)}", errorMessage);
+ Assert.Equal($"error CS0012: {string.Format(CSharpResources.ERR_NoTypeDef, "MissingType", missingIdentity)}", errorMessage);
});
}
diff --git a/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/ReferencedModulesTests.cs b/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/ReferencedModulesTests.cs
index 582f93d1505bd..28b5f7ce8a86c 100644
--- a/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/ReferencedModulesTests.cs
+++ b/src/ExpressionEvaluator/CSharp/Test/ExpressionCompiler/ReferencedModulesTests.cs
@@ -914,7 +914,7 @@ IEnumerable CS0433Messages(string type)
// Duplicate extension method, at method scope.
ExpressionCompilerTestHelpers.CompileExpressionWithRetry(blocks, "x.F()", ImmutableArray.Empty, contextFactory, getMetaDataBytesPtr: null, errorMessage: out errorMessage, testData: out testData);
- Assert.Equal($"error CS0121: { string.Format(CSharpResources.ERR_AmbigCall, "N.E.F(A)", "N.E.F(A)") }", errorMessage);
+ Assert.Equal($"error CS0121: {string.Format(CSharpResources.ERR_AmbigCall, "N.E.F(A)", "N.E.F(A)")}", errorMessage);
// Same tests as above but in library that does not directly reference duplicates.
GetContextState(runtime, "A", out blocks, out moduleVersionId, out symReader, out typeToken, out localSignatureToken);
diff --git a/src/Features/CSharp/Portable/AddImport/CSharpAddImportFeatureService.cs b/src/Features/CSharp/Portable/AddImport/CSharpAddImportFeatureService.cs
index d683b1726eb6e..591bbe63569de 100644
--- a/src/Features/CSharp/Portable/AddImport/CSharpAddImportFeatureService.cs
+++ b/src/Features/CSharp/Portable/AddImport/CSharpAddImportFeatureService.cs
@@ -285,7 +285,7 @@ private static bool InfoBoundSuccessfully(ISymbol operation)
}
protected override string GetDescription(IReadOnlyList nameParts)
- => $"using { string.Join(".", nameParts) };";
+ => $"using {string.Join(".", nameParts)};";
protected override (string description, bool hasExistingImport) GetDescription(
Document document,
diff --git a/src/Features/Core/Portable/Completion/Providers/AbstractInternalsVisibleToCompletionProvider.cs b/src/Features/Core/Portable/Completion/Providers/AbstractInternalsVisibleToCompletionProvider.cs
index badd89e5735e5..f2517e714e3b3 100644
--- a/src/Features/Core/Portable/Completion/Providers/AbstractInternalsVisibleToCompletionProvider.cs
+++ b/src/Features/Core/Portable/Completion/Providers/AbstractInternalsVisibleToCompletionProvider.cs
@@ -274,7 +274,7 @@ public override async Task GetChangeAsync(Document document, C
var publicKey = await GetPublicKeyOfProjectAsync(project, cancellationToken).ConfigureAwait(false);
if (!string.IsNullOrEmpty(publicKey))
{
- assemblyName += $", PublicKey={ publicKey }";
+ assemblyName += $", PublicKey={publicKey}";
}
var textChange = new TextChange(item.Span, assemblyName);
diff --git a/src/Interactive/HostTest/InteractiveHostDesktopTests.cs b/src/Interactive/HostTest/InteractiveHostDesktopTests.cs
index 924ea37b7f080..1b49177eecc2e 100644
--- a/src/Interactive/HostTest/InteractiveHostDesktopTests.cs
+++ b/src/Interactive/HostTest/InteractiveHostDesktopTests.cs
@@ -801,7 +801,7 @@ await Execute(@"
AssertEx.AssertEqualToleratingWhitespaceDifferences("", error);
AssertEx.AssertEqualToleratingWhitespaceDifferences(
-$@"{ string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path)) }
+$@"{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))}
OK
", output);
}
@@ -825,11 +825,11 @@ public async Task InitialScript_Error()
var error = await ReadErrorOutputToEnd();
var output = await ReadOutputToEnd();
- AssertEx.AssertEqualToleratingWhitespaceDifferences($@"{initFile.Path}(1,3): error CS1002: { CSharpResources.ERR_SemicolonExpected }
+ AssertEx.AssertEqualToleratingWhitespaceDifferences($@"{initFile.Path}(1,3): error CS1002: {CSharpResources.ERR_SemicolonExpected}
", error);
AssertEx.AssertEqualToleratingWhitespaceDifferences($@"
-{ string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path)) }
+{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))}
[System.Diagnostics.Process]
", output);
}
@@ -851,7 +851,7 @@ public async Task ScriptAndArguments()
var error = await ReadErrorOutputToEnd();
Assert.Equal("", error);
AssertEx.AssertEqualToleratingWhitespaceDifferences(
-$@"{ string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path)) }
+$@"{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))}
""a""
""b""
""c""
@@ -863,7 +863,7 @@ public async Task Script_NoHostNamespaces()
{
await Execute("nameof(Microsoft.Missing)");
var error = await ReadErrorOutputToEnd();
- AssertEx.AssertEqualToleratingWhitespaceDifferences($@"(1,8): error CS0234: { string.Format(CSharpResources.ERR_DottedTypeNameNotFoundInNS, "Missing", "Microsoft") }",
+ AssertEx.AssertEqualToleratingWhitespaceDifferences($@"(1,8): error CS0234: {string.Format(CSharpResources.ERR_DottedTypeNameNotFoundInNS, "Missing", "Microsoft")}",
error);
var output = await ReadOutputToEnd();
diff --git a/src/Scripting/CSharpTest.Desktop/CsiTests.cs b/src/Scripting/CSharpTest.Desktop/CsiTests.cs
index 973cef7ca0f16..61a392ad2436c 100644
--- a/src/Scripting/CSharpTest.Desktop/CsiTests.cs
+++ b/src/Scripting/CSharpTest.Desktop/CsiTests.cs
@@ -57,7 +57,7 @@ public void CurrentWorkingDirectory_Change()
");
var expected = $@"
-{ string.Format(CSharpScriptingResources.LogoLine1, s_compilerVersion) }
+{string.Format(CSharpScriptingResources.LogoLine1, s_compilerVersion)}
{CSharpScriptingResources.LogoLine2}
{ScriptingResources.HelpPrompt}
@@ -72,8 +72,8 @@ public void CurrentWorkingDirectory_Change()
AssertEx.AssertEqualToleratingWhitespaceDifferences(expected, result.Output);
AssertEx.AssertEqualToleratingWhitespaceDifferences($@"
-(1,7): error CS1504: { string.Format(CSharpResources.ERR_NoSourceFile, "a.csx", CSharpResources.CouldNotFindFile) }
-(1,1): error CS0006: { string.Format(CSharpResources.ERR_NoMetadataFile, "C.dll") }
+(1,7): error CS1504: {string.Format(CSharpResources.ERR_NoSourceFile, "a.csx", CSharpResources.CouldNotFindFile)}
+(1,1): error CS0006: {string.Format(CSharpResources.ERR_NoMetadataFile, "C.dll")}
", result.Errors);
Assert.Equal(0, result.ExitCode);
diff --git a/src/Scripting/CSharpTest/CommandLineRunnerTests.cs b/src/Scripting/CSharpTest/CommandLineRunnerTests.cs
index 80558f307c04c..0244868a4d42c 100644
--- a/src/Scripting/CSharpTest/CommandLineRunnerTests.cs
+++ b/src/Scripting/CSharpTest/CommandLineRunnerTests.cs
@@ -28,7 +28,7 @@ public class CommandLineRunnerTests : TestBase
{
private static readonly string s_compilerVersion = CommonCompiler.GetProductVersion(typeof(CSharpInteractiveCompiler));
- private string LogoAndHelpPrompt => $@"{ string.Format(CSharpScriptingResources.LogoLine1, s_compilerVersion) }
+ private string LogoAndHelpPrompt => $@"{string.Format(CSharpScriptingResources.LogoLine1, s_compilerVersion)}
{CSharpScriptingResources.LogoLine2}
{ScriptingResources.HelpPrompt}";
@@ -128,7 +128,7 @@ select x * x
. return new int[] {{ 1, 2, 3, 4, 5 }};
. }}
«Yellow»
-(1,19): warning CS1998: { CSharpResources.WRN_AsyncLacksAwaits }
+(1,19): warning CS1998: {CSharpResources.WRN_AsyncLacksAwaits}
«Gray»
> from x in await GetStuffAsync()
. where x > 2
@@ -137,7 +137,7 @@ . select x * x
> ", runner.Console.Out.ToString());
AssertEx.AssertEqualToleratingWhitespaceDifferences(
- $@"(1,19): warning CS1998: { CSharpResources.WRN_AsyncLacksAwaits }",
+ $@"(1,19): warning CS1998: {CSharpResources.WRN_AsyncLacksAwaits}",
runner.Console.Error.ToString());
}
@@ -146,10 +146,10 @@ . select x * x
public void TestDisplayResultsWithCurrentUICulture1()
{
// logoOutput needs to be retrieved before the runner is started, because the runner changes the culture to de-DE.
- var logoOutput = $@"{ string.Format(CSharpScriptingResources.LogoLine1, s_compilerVersion) }
-{ CSharpScriptingResources.LogoLine2}
+ var logoOutput = $@"{string.Format(CSharpScriptingResources.LogoLine1, s_compilerVersion)}
+{CSharpScriptingResources.LogoLine2}
-{ ScriptingResources.HelpPrompt}";
+{ScriptingResources.HelpPrompt}";
var runner = CreateRunner(input:
@"using System.Globalization;
CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo(""en-GB"", useUserOverride: false)
@@ -160,7 +160,7 @@ public void TestDisplayResultsWithCurrentUICulture1()
runner.RunInteractive();
AssertEx.AssertEqualToleratingWhitespaceDifferences(
-$@"{ logoOutput }
+$@"{logoOutput}
> using System.Globalization;
> CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo(""en-GB"", useUserOverride: false)
[en-GB]
@@ -179,10 +179,10 @@ public void TestDisplayResultsWithCurrentUICulture1()
public void TestDisplayResultsWithCurrentUICulture2()
{
// logoOutput needs to be retrieved before the runner is started, because the runner changes the culture to de-DE.
- var logoOutput = $@"{ string.Format(CSharpScriptingResources.LogoLine1, s_compilerVersion) }
-{ CSharpScriptingResources.LogoLine2}
+ var logoOutput = $@"{string.Format(CSharpScriptingResources.LogoLine1, s_compilerVersion)}
+{CSharpScriptingResources.LogoLine2}
-{ ScriptingResources.HelpPrompt}";
+{ScriptingResources.HelpPrompt}";
// Tests that DefaultThreadCurrentUICulture is respected and not DefaultThreadCurrentCulture.
var runner = CreateRunner(input:
@"using System.Globalization;
@@ -195,7 +195,7 @@ public void TestDisplayResultsWithCurrentUICulture2()
runner.RunInteractive();
AssertEx.AssertEqualToleratingWhitespaceDifferences(
-$@"{ logoOutput }
+$@"{logoOutput}
> using System.Globalization;
> CultureInfo.DefaultThreadCurrentUICulture = new CultureInfo(""en-GB"", useUserOverride: false)
[en-GB]
@@ -325,7 +325,7 @@ public void Args_Interactive2()
runner.RunInteractive();
- var error = $@"error CS2001: { string.Format(CSharpResources.ERR_FileNotFound, Path.Combine(AppContext.BaseDirectory, "@arg1"))}";
+ var error = $@"error CS2001: {string.Format(CSharpResources.ERR_FileNotFound, Path.Combine(AppContext.BaseDirectory, "@arg1"))}";
AssertEx.AssertEqualToleratingWhitespaceDifferences(error, runner.Console.Out.ToString());
AssertEx.AssertEqualToleratingWhitespaceDifferences(error, runner.Console.Error.ToString());
}
@@ -472,7 +472,7 @@ public void Script_NonExistingFile()
Assert.Equal(1, runner.RunInteractive());
- var error = $@"error CS2001: { string.Format(CSharpResources.ERR_FileNotFound, Path.Combine(AppContext.BaseDirectory, "a + b")) }";
+ var error = $@"error CS2001: {string.Format(CSharpResources.ERR_FileNotFound, Path.Combine(AppContext.BaseDirectory, "a + b"))}";
AssertEx.AssertEqualToleratingWhitespaceDifferences(error, runner.Console.Out.ToString());
AssertEx.AssertEqualToleratingWhitespaceDifferences(error, runner.Console.Error.ToString());
}
@@ -485,7 +485,7 @@ public void Help()
Assert.Equal(0, runner.RunInteractive());
AssertEx.AssertEqualToleratingWhitespaceDifferences(
-$@"{ string.Format(CSharpScriptingResources.LogoLine1, s_compilerVersion) }
+$@"{string.Format(CSharpScriptingResources.LogoLine1, s_compilerVersion)}
{CSharpScriptingResources.LogoLine2}
{CSharpScriptingResources.InteractiveHelp}
@@ -526,7 +526,7 @@ public void Script_BadUsings()
Assert.Equal(1, runner.RunInteractive());
- var error = $@"error CS0246: { string.Format(CSharpResources.ERR_SingleTypeNameNotFound, "Alpha") }";
+ var error = $@"error CS0246: {string.Format(CSharpResources.ERR_SingleTypeNameNotFound, "Alpha")}";
AssertEx.AssertEqualToleratingWhitespaceDifferences(error, runner.Console.Out.ToString());
AssertEx.AssertEqualToleratingWhitespaceDifferences(error, runner.Console.Error.ToString());
}
@@ -541,12 +541,12 @@ public void Script_NoHostNamespaces()
$@"{LogoAndHelpPrompt}
> nameof(Microsoft.Missing)
«Red»
-(1,8): error CS0234: { string.Format(CSharpResources.ERR_DottedTypeNameNotFoundInNS, "Missing", "Microsoft") }
+(1,8): error CS0234: {string.Format(CSharpResources.ERR_DottedTypeNameNotFoundInNS, "Missing", "Microsoft")}
«Gray»
> ", runner.Console.Out.ToString());
AssertEx.AssertEqualToleratingWhitespaceDifferences(
- $"(1,8): error CS0234: { string.Format(CSharpResources.ERR_DottedTypeNameNotFoundInNS, "Missing", "Microsoft") }",
+ $"(1,8): error CS0234: {string.Format(CSharpResources.ERR_DottedTypeNameNotFoundInNS, "Missing", "Microsoft")}",
runner.Console.Error.ToString());
}
@@ -683,7 +683,7 @@ public void SourceSearchPaths_Change1()
SearchPaths {{ }}
> #load ""a.csx""
«Red»
-(1,7): error CS1504: { string.Format(CSharpResources.ERR_NoSourceFile, "a.csx", CSharpResources.CouldNotFindFile) }
+(1,7): error CS1504: {string.Format(CSharpResources.ERR_NoSourceFile, "a.csx", CSharpResources.CouldNotFindFile)}
«Gray»
> SourcePaths.Add(@""{dir.Path}"")
> #load ""a.csx""
@@ -693,7 +693,7 @@ public void SourceSearchPaths_Change1()
", runner.Console.Out.ToString());
AssertEx.AssertEqualToleratingWhitespaceDifferences(
- $@"(1,7): error CS1504: { string.Format(CSharpResources.ERR_NoSourceFile, "a.csx", CSharpResources.CouldNotFindFile) }",
+ $@"(1,7): error CS1504: {string.Format(CSharpResources.ERR_NoSourceFile, "a.csx", CSharpResources.CouldNotFindFile)}",
runner.Console.Error.ToString());
}
@@ -719,7 +719,7 @@ public void ReferenceSearchPaths_Change1()
SearchPaths {{ }}
> #r ""C.dll""
«Red»
-(1,1): error CS0006: { string.Format(CSharpResources.ERR_NoMetadataFile, "C.dll") }
+(1,1): error CS0006: {string.Format(CSharpResources.ERR_NoMetadataFile, "C.dll")}
«Gray»
> ReferencePaths.Add(@""{dir.Path}"")
> #r ""C.dll""
@@ -729,7 +729,7 @@ public void ReferenceSearchPaths_Change1()
", runner.Console.Out.ToString());
AssertEx.AssertEqualToleratingWhitespaceDifferences(
- $@"(1,1): error CS0006: { string.Format(CSharpResources.ERR_NoMetadataFile, "C.dll") }",
+ $@"(1,1): error CS0006: {string.Format(CSharpResources.ERR_NoMetadataFile, "C.dll")}",
runner.Console.Error.ToString());
}
@@ -805,7 +805,7 @@ 1 1
AssertEx.AssertEqualToleratingWhitespaceDifferences($@"
«Red»
-{init.Path}(2,3): error CS1002: { CSharpResources.ERR_SemicolonExpected }
+{init.Path}(2,3): error CS1002: {CSharpResources.ERR_SemicolonExpected}
«Gray»
> new C()
C {{ }}
@@ -813,7 +813,7 @@ 1 1
", runner.Console.Out.ToString());
AssertEx.AssertEqualToleratingWhitespaceDifferences(
- $@"{init.Path}(2,3): error CS1002: { CSharpResources.ERR_SemicolonExpected }",
+ $@"{init.Path}(2,3): error CS1002: {CSharpResources.ERR_SemicolonExpected}",
runner.Console.Error.ToString());
}
@@ -828,7 +828,7 @@ public void HelpCommand()
Assert.Equal(
$@"{LogoAndHelpPrompt}
> #help
-{ ScriptingResources.HelpText }
+{ScriptingResources.HelpText}
> ", runner.Console.Out.ToString());
}
@@ -919,7 +919,7 @@ public class Lib2
> #r ""{file2.Path}""
> var l2 = new Lib2();
«Red»
-{ string.Format(ScriptingResources.AssemblyAlreadyLoaded, libBaseName, "0.0.0.0", fileBase1.Path, fileBase2.Path) }
+{string.Format(ScriptingResources.AssemblyAlreadyLoaded, libBaseName, "0.0.0.0", fileBase1.Path, fileBase2.Path)}
«Gray»
> ", runner.Console.Out.ToString());
}
@@ -940,7 +940,7 @@ public void PreservingDeclarationsOnException()
> int i = 100;
> int j = 20; throw new System.Exception(""Bang!""); int k = 3;
«Yellow»
-(1,58): warning CS0162: { CSharpResources.WRN_UnreachableCode }
+(1,58): warning CS0162: {CSharpResources.WRN_UnreachableCode}
«Red»
System.Exception: Bang!
«Gray»
@@ -949,7 +949,7 @@ public void PreservingDeclarationsOnException()
> ", runner.Console.Out.ToString());
AssertEx.AssertEqualToleratingWhitespaceDifferences(
-$@"(1,58): warning CS0162: { CSharpResources.WRN_UnreachableCode }
+$@"(1,58): warning CS0162: {CSharpResources.WRN_UnreachableCode}
System.Exception: Bang!",
runner.Console.Error.ToString());
}
@@ -984,7 +984,7 @@ public void InferredTupleNames()
runner.RunInteractive();
AssertEx.AssertEqualToleratingWhitespaceDifferences(
-$@"{ string.Format(CSharpScriptingResources.LogoLine1, s_compilerVersion) }
+$@"{string.Format(CSharpScriptingResources.LogoLine1, s_compilerVersion)}
{CSharpScriptingResources.LogoLine2}
{ScriptingResources.HelpPrompt}
> var a = 1;