From 68d1c055177241766afd14ebfd2803eb3a473649 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Mon, 20 Jun 2022 16:44:49 -0700 Subject: [PATCH 1/8] Add correctness check that only runs analyzers --- azure-pipelines.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 06884e78282d9..9647669ed3383 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: 25 + steps: + - template: eng/pipelines/checkout-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" From 77ac388f7964f918cf9598cece3b75f14db7dd3b Mon Sep 17 00:00:00 2001 From: David Barbet Date: Tue, 21 Jun 2022 11:33:40 -0700 Subject: [PATCH 2/8] Increase timeout --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9647669ed3383..0ebb4e941580e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -273,7 +273,7 @@ jobs: pool: name: NetCore1ESPool-Public demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Pre.Open - timeoutInMinutes: 25 + timeoutInMinutes: 30 steps: - template: eng/pipelines/checkout-task.yml From eb39b1ac4c90177ba4fc88d6a5757229a8a88621 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Wed, 22 Jun 2022 11:21:39 -0700 Subject: [PATCH 3/8] Update analyzers / format version --- dotnet-tools.json | 2 +- eng/Versions.props | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 4f2432ff6b213..47faf7f35aa11 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 From b0dd4fa84c5bab1029d61d5bc5092a3dae22cf52 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Wed, 22 Jun 2022 15:44:06 -0700 Subject: [PATCH 4/8] Fix new formatting warnings --- .../CodeGenAsyncMethodBuilderOverrideTests.cs | 2 +- .../Test/Emit/CodeGen/CodeGenOperators.cs | 14 ++--- .../Diagnostics/OperationAnalyzerTests.cs | 6 +- .../Semantic/Semantics/RecordStructTests.cs | 6 +- .../Test/Semantic/Semantics/RecordTests.cs | 18 +++--- .../Semantics/TopLevelStatementsTests.cs | 24 ++++---- .../VBCSCompilerTests/CompilerServerTests.cs | 4 +- .../CompileExpressionsTests.cs | 2 +- .../MissingAssemblyTests.cs | 2 +- .../ReferencedModulesTests.cs | 2 +- ...actInternalsVisibleToCompletionProvider.cs | 2 +- .../HostTest/InteractiveHostDesktopTests.cs | 10 ++-- src/Scripting/CSharpTest.Desktop/CsiTests.cs | 6 +- .../CSharpTest/CommandLineRunnerTests.cs | 56 +++++++++---------- 14 files changed, 77 insertions(+), 77 deletions(-) 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 54f632b6f3f96..761a5b7fff0ca 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 97ddce1d7134f..74fc44ab88a34 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/RecordTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/RecordTests.cs @@ -14054,7 +14054,7 @@ public void CopyCtor_Accessibility_01(string accessibility) $@" record A(int X) {{ - { accessibility } A(A a) + {accessibility} A(A a) => throw null; }} "; @@ -14075,7 +14075,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() @@ -14101,7 +14101,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() @@ -14134,7 +14134,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() @@ -15599,7 +15599,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; }} "; @@ -18488,7 +18488,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; @@ -18514,7 +18514,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; @@ -19049,7 +19049,7 @@ public void EqualityContract_05(string accessibility) $@" record A {{ - { accessibility } virtual System.Type EqualityContract + {accessibility} virtual System.Type EqualityContract => throw null; }} "; @@ -19070,7 +19070,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 b9ed5f26b2844..15ea5d961b9fb 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/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/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; From 9ce32400c3885fb0fd0d3915fd94cfea834178e5 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Wed, 22 Jun 2022 17:07:57 -0700 Subject: [PATCH 5/8] Fix more warnings --- .../Tests/AliasAmbiguousType/AliasAmbiguousTypeTests.cs | 4 ++-- .../Tests/UseIndexOrRangeOperator/UseRangeOperatorTests.cs | 4 ++-- .../Portable/AddImport/CSharpAddImportFeatureService.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) 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/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, From 5bf9771872a402fdf435f851d2ce2d90d65bf03a Mon Sep 17 00:00:00 2001 From: David Barbet Date: Wed, 22 Jun 2022 17:19:32 -0700 Subject: [PATCH 6/8] Fix another batch of warnings --- .../KeywordCompletionProviderTests.cs | 4 ++-- .../OperatorCompletionProviderTests.cs | 2 +- .../SymbolCompletionProviderTests.cs | 2 +- .../ConvertCast/ConvertDirectCastToTryCastTests.cs | 8 ++++---- .../ConvertCast/ConvertTryCastToDirectCastTests.cs | 12 ++++++------ .../Updater/SettingsUpdaterTests.cs | 2 +- .../QuickInfo/SemanticQuickInfoSourceTests.cs | 10 +++++----- .../Workspaces/WorkspaceTests_EditorFeatures.cs | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/KeywordCompletionProviderTests.cs b/src/EditorFeatures/CSharpTest/Completion/CompletionProviders/KeywordCompletionProviderTests.cs index 5c3d6722ef93b..2a87d77712819 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 7934a8dd8be98..6452469ba7c72 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 91f99c661367f..bbf558673e7c9 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} From 8c8ae7069503f2598b6330bcc4d7d43f88e1df15 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Thu, 23 Jun 2022 10:56:55 -0700 Subject: [PATCH 7/8] Bump timeout in case restore takes a while --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0ebb4e941580e..f995280a47c76 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -273,7 +273,7 @@ jobs: pool: name: NetCore1ESPool-Public demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Pre.Open - timeoutInMinutes: 30 + timeoutInMinutes: 35 steps: - template: eng/pipelines/checkout-task.yml From b688a615fd346fa7a16faca98811e835e1647f06 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Mon, 25 Jul 2022 16:05:30 -0700 Subject: [PATCH 8/8] Fix windows checkout task name --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 22a902f3fe996..a5f540e20249e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -275,7 +275,7 @@ jobs: demands: ImageOverride -equals Build.Windows.Amd64.VS2022.Pre.Open timeoutInMinutes: 35 steps: - - template: eng/pipelines/checkout-task.yml + - template: eng/pipelines/checkout-windows-task.yml - task: PowerShell@2 displayName: Build with analyzers