Ensure analyzer packaging works for CS/VB (#535)
This change removes CSharp from the name of the package as well as ensures the analzyer/codefixers are added for vb projects when added as NuGet packages.
This commit is contained in:
Родитель
e9527bdae4
Коммит
981dd02c4f
|
@ -1,4 +1,3 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30509.190
|
||||
|
@ -31,9 +30,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.UpgradeAss
|
|||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.UpgradeAssistant.Steps.Source", "src\steps\Microsoft.DotNet.UpgradeAssistant.Steps.Source\Microsoft.DotNet.UpgradeAssistant.Steps.Source.csproj", "{C04E2349-B339-4AEF-89FB-AD8DCD9B117A}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers", "src\extensions\default\analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers.csproj", "{7176CD56-0822-410E-9318-C3440D24A0BB}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers", "src\extensions\default\analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.csproj", "{7176CD56-0822-410E-9318-C3440D24A0BB}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes", "src\extensions\default\analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes.csproj", "{6D52D932-7890-4269-8F05-FDEA6DE45B42}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes", "src\extensions\default\analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes.csproj", "{6D52D932-7890-4269-8F05-FDEA6DE45B42}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.Package", "src\extensions\default\analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.Package\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.Package.csproj", "{12080E4D-027D-4880-8A94-AA22DCD15F07}"
|
||||
EndProject
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
using Microsoft.CodeAnalysis.CodeFixes;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Dependencies;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.ConfigUpdaters;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Steps.Packages.Analyzers;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
|
|
@ -22,16 +22,18 @@
|
|||
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);_AddAnalyzersToOutput</TargetsForTfmSpecificContentInPackage>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Update="tools\*.ps1" CopyToOutputDirectory="Always" Pack="true" PackagePath="" />
|
||||
</ItemGroup>
|
||||
<Target Name="_AddAnalyzersToOutput">
|
||||
<ItemGroup>
|
||||
<TfmSpecificPackageFile Include="$(OutputPath)\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers.dll" PackagePath="analyzers/dotnet/cs" />
|
||||
<TfmSpecificPackageFile Include="$(OutputPath)\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes.dll" PackagePath="analyzers/dotnet/cs" />
|
||||
<TfmSpecificPackageFile Include="$(OutputPath)\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.dll" PackagePath="analyzers/dotnet/cs" />
|
||||
<TfmSpecificPackageFile Include="$(OutputPath)\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes.dll" PackagePath="analyzers/dotnet/cs" />
|
||||
<TfmSpecificPackageFile Include="$(OutputPath)\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.dll" PackagePath="analyzers/dotnet/vb" />
|
||||
<TfmSpecificPackageFile Include="$(OutputPath)\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes.dll" PackagePath="analyzers/dotnet/vb" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
|
@ -9,7 +9,7 @@ using Microsoft.CodeAnalysis.CSharp;
|
|||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp)]
|
|
@ -7,7 +7,7 @@ using System.Linq;
|
|||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic)]
|
|
@ -9,7 +9,7 @@ using Microsoft.CodeAnalysis.CSharp;
|
|||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp)]
|
||||
public sealed class BinaryFormatterUnsafeDeserializeAnalyzer : DiagnosticAnalyzer
|
|
@ -8,7 +8,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax;
|
|||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
using Microsoft.CodeAnalysis.Operations;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
internal static class DiagnosticAnalyzerExtensions
|
||||
{
|
|
@ -6,7 +6,7 @@ using System.Collections.Immutable;
|
|||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp)]
|
|
@ -6,7 +6,7 @@ using System.Collections.Immutable;
|
|||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp)]
|
|
@ -8,7 +8,7 @@ using Microsoft.CodeAnalysis.CSharp;
|
|||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp)]
|
|
@ -6,7 +6,7 @@ using System.Collections.Immutable;
|
|||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp)]
|
|
@ -9,7 +9,7 @@ using Microsoft.CodeAnalysis.CSharp;
|
|||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp)]
|
|
@ -9,7 +9,7 @@ using Microsoft.CodeAnalysis.CSharp;
|
|||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp)]
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
using System;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
public class IdentifierMapping
|
||||
{
|
|
@ -10,7 +10,7 @@ using Microsoft.CodeAnalysis.CSharp;
|
|||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
/// <summary>
|
||||
/// Base class analyzer for identifying usage of APIs that should be replaced with other APIs.
|
|
@ -8,7 +8,7 @@
|
|||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers {
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers {
|
||||
using System;
|
||||
|
||||
|
||||
|
@ -39,7 +39,7 @@ namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
|||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers.Resources", typeof(Resources).Assembly);
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
|
@ -6,7 +6,7 @@ using System.Collections.Immutable;
|
|||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp)]
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using System.Linq;
|
||||
using Microsoft.CodeAnalysis;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
public static class SyntaxNodeHelpers
|
||||
{
|
|
@ -6,7 +6,7 @@ using System.Collections.Immutable;
|
|||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic, LanguageNames.FSharp)]
|
||||
public sealed class SystemDeploymentAnalyzer : DiagnosticAnalyzer
|
|
@ -8,7 +8,7 @@ using Microsoft.CodeAnalysis.CSharp;
|
|||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp)]
|
|
@ -9,7 +9,7 @@ using Microsoft.CodeAnalysis.CSharp;
|
|||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[DiagnosticAnalyzer(LanguageNames.CSharp)]
|
|
@ -11,9 +11,9 @@ using Microsoft.CodeAnalysis.CodeFixes;
|
|||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Editing;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[ExportCodeFixProvider(LanguageNames.CSharp, Name = "UA0010 CodeFix Provider")]
|
|
@ -2,7 +2,6 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using System.Collections.Immutable;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.CodeAnalysis;
|
||||
|
@ -10,9 +9,9 @@ using Microsoft.CodeAnalysis.CodeActions;
|
|||
using Microsoft.CodeAnalysis.CodeFixes;
|
||||
using Microsoft.CodeAnalysis.Editing;
|
||||
using Microsoft.CodeAnalysis.Simplification;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes
|
||||
{
|
||||
[ExportCodeFixProvider(LanguageNames.CSharp, LanguageNames.VisualBasic, Name = "UA0013 CodeFix Provider")]
|
||||
public class ApiControllerCodeFixer : CodeFixProvider
|
|
@ -10,10 +10,10 @@ using Microsoft.CodeAnalysis.CodeActions;
|
|||
using Microsoft.CodeAnalysis.CodeFixes;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Editing;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers;
|
||||
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes
|
||||
{
|
||||
[ExportCodeFixProvider(LanguageNames.CSharp, Name = "UA0012 CodeFix Provider")]
|
||||
public sealed class BinaryFormatterUnsafeDeserializeCodeFixer : CodeFixProvider
|
|
@ -8,7 +8,7 @@
|
|||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes {
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes {
|
||||
using System;
|
||||
|
||||
|
||||
|
@ -39,8 +39,7 @@ namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes
|
|||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes.CodeFixReso" +
|
||||
"urces", typeof(CodeFixResources).Assembly);
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes.CodeFixResources", typeof(CodeFixResources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
|
@ -4,9 +4,9 @@
|
|||
using System.Collections.Immutable;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CodeFixes;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[ExportCodeFixProvider(LanguageNames.CSharp, Name = "UA0004 CodeFix Provider")]
|
|
@ -4,9 +4,9 @@
|
|||
using System.Collections.Immutable;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CodeFixes;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[ExportCodeFixProvider(LanguageNames.CSharp, Name = "UA0009 CodeFix Provider")]
|
|
@ -4,9 +4,9 @@
|
|||
using System.Collections.Immutable;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CodeFixes;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[ExportCodeFixProvider(LanguageNames.CSharp, Name = "UA0007 CodeFix Provider")]
|
|
@ -4,9 +4,9 @@
|
|||
using System.Collections.Immutable;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CodeFixes;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[ExportCodeFixProvider(LanguageNames.CSharp, Name = "UA0002 CodeFix Provider")]
|
|
@ -13,17 +13,17 @@ using Microsoft.CodeAnalysis.CodeFixes;
|
|||
using Microsoft.CodeAnalysis.CSharp;
|
||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Editing;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers;
|
||||
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[ExportCodeFixProvider(LanguageNames.CSharp, Name = "UA0005 CodeFix Provider")]
|
||||
public class HttpContextCurrentCodeFixer : CodeFixProvider
|
||||
{
|
||||
private const string HttpContextHelperName = "HttpContextHelper";
|
||||
private const string HttpContextHelperResourceName = "Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes.Templates.HttpContextHelper.cs";
|
||||
private const string HttpContextHelperResourceName = "Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes.Templates.HttpContextHelper.cs";
|
||||
|
||||
public sealed override ImmutableArray<string> FixableDiagnosticIds => ImmutableArray.Create(HttpContextCurrentAnalyzer.DiagnosticId);
|
||||
|
|
@ -11,9 +11,9 @@ using Microsoft.CodeAnalysis.CSharp;
|
|||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Editing;
|
||||
using Microsoft.CodeAnalysis.Simplification;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[ExportCodeFixProvider(LanguageNames.CSharp, Name = "UA0006 CodeFix Provider")]
|
|
@ -12,9 +12,9 @@ using Microsoft.CodeAnalysis.CSharp;
|
|||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Editing;
|
||||
using Microsoft.CodeAnalysis.Simplification;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes
|
||||
{
|
||||
public abstract class IdentifierUpgradeCodeFixer : CodeFixProvider
|
||||
{
|
|
@ -5,8 +5,8 @@
|
|||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
|
||||
<ProjectReference Include="..\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers.csproj" />
|
||||
<ProjectReference Include="..\..\..\..\common\Microsoft.DotNet.UpgradeAssistant.Abstractions\Microsoft.DotNet.UpgradeAssistant.Abstractions.csproj" />
|
||||
<ProjectReference Include="..\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="Templates\*.cs" />
|
|
@ -2,13 +2,10 @@
|
|||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Editing;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes
|
||||
{
|
||||
/// <summary>
|
||||
/// Use this utility to build a QualifiedName from a string.
|
|
@ -4,9 +4,9 @@
|
|||
using System.Collections.Immutable;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CodeFixes;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[ExportCodeFixProvider(LanguageNames.CSharp, Name = "UA0003 CodeFix Provider")]
|
|
@ -8,7 +8,7 @@ using Microsoft.CodeAnalysis.CSharp;
|
|||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes
|
||||
{
|
||||
public static class RoslynExtensions
|
||||
{
|
|
@ -4,9 +4,9 @@
|
|||
using System.Collections.Immutable;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CodeFixes;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[ExportCodeFixProvider(LanguageNames.CSharp, Name = "UA0008 CodeFix Provider")]
|
|
@ -8,9 +8,9 @@ using Microsoft.CodeAnalysis;
|
|||
using Microsoft.CodeAnalysis.CodeActions;
|
||||
using Microsoft.CodeAnalysis.CodeFixes;
|
||||
using Microsoft.CodeAnalysis.Editing;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes
|
||||
{
|
||||
[ApplicableComponents(ProjectComponents.AspNetCore)]
|
||||
[ExportCodeFixProvider(LanguageNames.CSharp, Name = "UA0001 CodeFix Provider")]
|
|
@ -4,8 +4,8 @@
|
|||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\common\Microsoft.DotNet.UpgradeAssistant.Abstractions\Microsoft.DotNet.UpgradeAssistant.Abstractions.csproj" />
|
||||
<ProjectReference Include="..\..\extensions\default\analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers.csproj" />
|
||||
<ProjectReference Include="..\..\extensions\default\analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes.csproj" />
|
||||
<ProjectReference Include="..\..\extensions\default\analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.csproj" />
|
||||
<ProjectReference Include="..\..\extensions\default\analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net5.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
<ExcludeMSBuildRuntime>true</ExcludeMSBuildRuntime>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Moq" />
|
||||
<PackageReference Include="AutoFixture" />
|
||||
|
@ -16,8 +14,8 @@
|
|||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\src\extensions\default\analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes.csproj" />
|
||||
<ProjectReference Include="..\..\..\src\extensions\default\analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes.csproj" />
|
||||
<ProjectReference Include="..\..\..\src\extensions\default\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.ConfigUpdaters\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.ConfigUpdaters.csproj" />
|
||||
<ProjectReference Include="..\..\Microsoft.DotNet.UpgradeAssistant.TestHelpers\Microsoft.DotNet.UpgradeAssistant.TestHelpers.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
|
@ -5,8 +5,8 @@ using System.Threading;
|
|||
using System.Threading.Tasks;
|
||||
using Autofac.Extras.Moq;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Abstractions.Tests.TestAssets;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.ConfigUpdaters;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes;
|
||||
using Moq;
|
||||
using Xunit;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
using System.Collections.Immutable;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.CodeFixes;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Abstractions.Tests.TestAssets
|
||||
{
|
||||
|
|
|
@ -10,7 +10,7 @@ using Microsoft.CodeAnalysis.Text;
|
|||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.Test;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers.Test
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.Test
|
||||
{
|
||||
[Collection(AnalyzerTestCollection.Name)]
|
||||
public class AnalyzerTests
|
||||
|
|
|
@ -5,7 +5,7 @@ using System;
|
|||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Text;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers.Test
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.Test
|
||||
{
|
||||
public class ExpectedDiagnostic
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CodeAnalysis" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis" />
|
||||
<PackageReference Include="Microsoft.Build.Locator" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Features" />
|
||||
<PackageReference Include="Microsoft.CodeAnalysis.VisualBasic.Features" />
|
||||
|
@ -27,8 +27,8 @@
|
|||
</PackageReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\..\src\extensions\default\analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers.csproj" />
|
||||
<ProjectReference Include="..\..\..\..\..\src\extensions\default\analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes.csproj" />
|
||||
<ProjectReference Include="..\..\..\..\..\src\extensions\default\analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.csproj" />
|
||||
<ProjectReference Include="..\..\..\..\..\src\extensions\default\analyzers\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes\Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes.csproj" />
|
||||
<ProjectReference Include="..\..\..\..\..\src\steps\Microsoft.DotNet.UpgradeAssistant.Steps.Source\Microsoft.DotNet.UpgradeAssistant.Steps.Source.csproj" />
|
||||
<ProjectReference Include="..\..\..\..\..\src\components\Microsoft.DotNet.UpgradeAssistant.MSBuild\Microsoft.DotNet.UpgradeAssistant.MSBuild.csproj" />
|
||||
<ProjectReference Include="..\..\..\..\Microsoft.DotNet.UpgradeAssistant.TestHelpers\Microsoft.DotNet.UpgradeAssistant.TestHelpers.csproj" />
|
||||
|
|
|
@ -13,8 +13,8 @@ using Microsoft.CodeAnalysis.CodeActions;
|
|||
using Microsoft.CodeAnalysis.CodeFixes;
|
||||
using Microsoft.CodeAnalysis.Diagnostics;
|
||||
using Microsoft.CodeAnalysis.MSBuild;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers;
|
||||
using Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CodeFixes;
|
||||
using Xunit;
|
||||
|
||||
namespace Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.Test
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
<ConfigUpdateFilePath>$(OutputPath)ConfigUpdaters\</ConfigUpdateFilePath>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<SourceUpdateFiles Include="$(OutputPath)Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.Analyzers.*" />
|
||||
<SourceUpdateFiles Include="$(OutputPath)Microsoft.DotNet.UpgradeAssistant.Extensions.Default.Analyzers.*" />
|
||||
<SourceUpdateFiles Include="$(OutputPath)Microsoft.DotNet.UpgradeAssistant.Extensions.Default.CSharp.CodeFixes.*" />
|
||||
<ConfigUpdateFiles Include="$(OutputPath)Microsoft.DotNet.UpgradeAssistant.Extensions.Default.ConfigUpdaters.*" />
|
||||
</ItemGroup>
|
||||
|
|
Загрузка…
Ссылка в новой задаче