From 86f25f025e3a1d4a58424a5bd2ac29487a668082 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 15 Jul 2026 10:14:06 -0600 Subject: [PATCH 1/2] Remodel how analyzer dependencies are managed This updates some dependencies, but more importantly it adopts the pattern in the vs-mef repo for how analyzer dependencies are expressed so that they don't accidentally get updated with other dependencies. --- .github/renovate.json | 2 +- Directory.Build.targets | 2 ++ Directory.Packages.Analyzers.props | 15 +++++++++++++++ Directory.Packages.props | 10 ++-------- .../FixUtils.cs | 3 +-- .../VSTHRD200UseAsyncNamingConventionCodeFix.cs | 2 +- 6 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 Directory.Packages.Analyzers.props diff --git a/.github/renovate.json b/.github/renovate.json index b5dfac106..d5154a48d 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -8,7 +8,7 @@ ], "packageRules": [ { - "matchJsonata": ["sharedVariableName='CodeAnalysisVersion'"], + "matchFileNames": ["Directory.Packages.Analyzers.props"], "enabled": false } ], diff --git a/Directory.Build.targets b/Directory.Build.targets index dbcb085dc..70909045c 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -5,5 +5,7 @@ + + diff --git a/Directory.Packages.Analyzers.props b/Directory.Packages.Analyzers.props new file mode 100644 index 000000000..dd6773138 --- /dev/null +++ b/Directory.Packages.Analyzers.props @@ -0,0 +1,15 @@ + + + 4.14.0 + + + + + + + + + + + + diff --git a/Directory.Packages.props b/Directory.Packages.props index ac02a6011..1e906dc48 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -6,9 +6,8 @@ true 2.3.0 2.0.226 - 3.11.0 + 5.6.0 1.1.4 - 3.11.0-beta1.26226.5 @@ -41,11 +40,6 @@ - - - - @@ -56,7 +50,7 @@ - + diff --git a/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/FixUtils.cs b/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/FixUtils.cs index 9639738b9..164e28dbd 100644 --- a/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/FixUtils.cs +++ b/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/FixUtils.cs @@ -160,9 +160,8 @@ internal static AnonymousFunctionExpressionSyntax MakeMethodAsync(this Anonymous Solution? solution = await Renamer.RenameSymbolAsync( document.Project.Solution, methodSymbol, - ////new SymbolRenameOptions { RenameInComments = true }, // Required by later compiler version + default, newName, - document.Project.Solution.Workspace.Options, cancellationToken).ConfigureAwait(false); document = solution.GetDocumentOrThrow(document.Id); semanticModel = null; diff --git a/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/VSTHRD200UseAsyncNamingConventionCodeFix.cs b/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/VSTHRD200UseAsyncNamingConventionCodeFix.cs index fe17ac2fb..a442aa527 100644 --- a/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/VSTHRD200UseAsyncNamingConventionCodeFix.cs +++ b/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/VSTHRD200UseAsyncNamingConventionCodeFix.cs @@ -70,8 +70,8 @@ public AddAsyncSuffixCodeAction(Document document, Diagnostic diagnostic, string Solution? updatedSolution = await Renamer.RenameSymbolAsync( solution, methodSymbol, + default, this.newName, - solution.Workspace.Options, cancellationToken).ConfigureAwait(false); return updatedSolution; From a71fbbbb279cb949ed9de839b5ecd3742fa93212 Mon Sep 17 00:00:00 2001 From: Andrew Arnott Date: Wed, 15 Jul 2026 10:47:24 -0600 Subject: [PATCH 2/2] Retarget analyzers to .NET 8 SDK --- Directory.Packages.Analyzers.props | 16 +++++++++++----- .../FixUtils.cs | 2 +- .../VSTHRD200UseAsyncNamingConventionCodeFix.cs | 2 +- test/Directory.Packages.props | 9 +-------- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Directory.Packages.Analyzers.props b/Directory.Packages.Analyzers.props index dd6773138..a5770f019 100644 --- a/Directory.Packages.Analyzers.props +++ b/Directory.Packages.Analyzers.props @@ -1,15 +1,21 @@ + - 4.14.0 + 4.11.0 - + + - - - + + + + + + + diff --git a/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/FixUtils.cs b/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/FixUtils.cs index 164e28dbd..b408e9ede 100644 --- a/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/FixUtils.cs +++ b/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/FixUtils.cs @@ -160,7 +160,7 @@ internal static AnonymousFunctionExpressionSyntax MakeMethodAsync(this Anonymous Solution? solution = await Renamer.RenameSymbolAsync( document.Project.Solution, methodSymbol, - default, + default(SymbolRenameOptions), newName, cancellationToken).ConfigureAwait(false); document = solution.GetDocumentOrThrow(document.Id); diff --git a/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/VSTHRD200UseAsyncNamingConventionCodeFix.cs b/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/VSTHRD200UseAsyncNamingConventionCodeFix.cs index a442aa527..e42db7232 100644 --- a/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/VSTHRD200UseAsyncNamingConventionCodeFix.cs +++ b/src/Microsoft.VisualStudio.Threading.Analyzers.CodeFixes/VSTHRD200UseAsyncNamingConventionCodeFix.cs @@ -70,7 +70,7 @@ public AddAsyncSuffixCodeAction(Document document, Diagnostic diagnostic, string Solution? updatedSolution = await Renamer.RenameSymbolAsync( solution, methodSymbol, - default, + default(SymbolRenameOptions), this.newName, cancellationToken).ConfigureAwait(false); diff --git a/test/Directory.Packages.props b/test/Directory.Packages.props index 11d31c355..c79fbe79b 100644 --- a/test/Directory.Packages.props +++ b/test/Directory.Packages.props @@ -2,14 +2,7 @@ - - 5.3.0 - - - - - - +