Skip to content

Commit

Permalink
Revert "Route tooling (#42597)" (#42943)
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesNK authored Jul 27, 2022
1 parent c5727eb commit 6df6573
Show file tree
Hide file tree
Showing 76 changed files with 14 additions and 13,685 deletions.
3 changes: 0 additions & 3 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
<add key="dotnet31-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet3.1-transport/nuget/v3/index.json" />
<!-- Used for the Rich Navigation indexing task -->
<add key="richnav" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-buildservices/nuget/v3/index.json" />
<!-- Preview VS bits for route tooling. Will be removed in future when packages referenced by Roslyn move out of preview. -->
<add key="vssdk" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vssdk/nuget/v3/index.json" />
<add key="vs-impl" value="https://pkgs.dev.azure.com/azure-public/vside/_packaging/vs-impl/nuget/v3/index.json" />
</packageSources>
<disabledPackageSources>
<clear />
Expand Down
1 change: 0 additions & 1 deletion eng/Dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ and are generated based on the last package release.
<LatestPackageReference Include="Microsoft.CodeAnalysis.Common" />
<LatestPackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" />
<LatestPackageReference Include="Microsoft.CodeAnalysis.CSharp" />
<LatestPackageReference Include="Microsoft.CodeAnalysis.ExternalAccess.AspNetCore" />
<LatestPackageReference Include="Microsoft.CodeAnalysis.Razor" />
<LatestPackageReference Include="Microsoft.CSharp" />
<LatestPackageReference Include="Microsoft.Extensions.Caching.Abstractions" />
Expand Down
7 changes: 3 additions & 4 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,9 @@
-->
<Analyzer_MicrosoftCodeAnalysisCSharpVersion>3.3.1</Analyzer_MicrosoftCodeAnalysisCSharpVersion>
<Analyzer_MicrosoftCodeAnalysisCSharpWorkspacesVersion>3.3.1</Analyzer_MicrosoftCodeAnalysisCSharpWorkspacesVersion>
<MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>4.3.0-3.22329.30</MicrosoftCodeAnalysisExternalAccessAspNetCoreVersion>
<MicrosoftCodeAnalysisCommonVersion>4.3.0-3.22329.30</MicrosoftCodeAnalysisCommonVersion>
<MicrosoftCodeAnalysisCSharpVersion>4.3.0-3.22329.30</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.3.0-3.22329.30</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
<MicrosoftCodeAnalysisCommonVersion>4.2.0-2.22128.1</MicrosoftCodeAnalysisCommonVersion>
<MicrosoftCodeAnalysisCSharpVersion>4.2.0-2.22128.1</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesVersion>4.2.0-2.22128.1</MicrosoftCodeAnalysisCSharpWorkspacesVersion>
<MicrosoftCodeAnalysisPublicApiAnalyzersVersion>3.3.3</MicrosoftCodeAnalysisPublicApiAnalyzersVersion>
<MicrosoftCodeAnalysisCSharpAnalyzerTestingXUnitVersion>1.1.2-beta1.22276.1</MicrosoftCodeAnalysisCSharpAnalyzerTestingXUnitVersion>
<MicrosoftCodeAnalysisCSharpCodeFixTestingXUnitVersion>1.1.2-beta1.22276.1</MicrosoftCodeAnalysisCSharpCodeFixTestingXUnitVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Text;
using Microsoft.Extensions.DependencyModel;
using Microsoft.Extensions.DependencyModel.Resolution;
Expand All @@ -28,17 +26,15 @@ public class DiagnosticProject
private static readonly ICompilationAssemblyResolver _assemblyResolver = new AppBaseCompilationAssemblyResolver();
private static readonly Dictionary<Assembly, Solution> _solutionCache = new Dictionary<Assembly, Solution>();

public static Project Create(Assembly testAssembly, string[] sources, Func<Workspace> workspaceFactory = null, Type analyzerReference = null)
public static Project Create(Assembly testAssembly, string[] sources)
{
Solution solution;
lock (_solutionCache)
{
if (!_solutionCache.TryGetValue(testAssembly, out solution))
{
workspaceFactory ??= CreateWorkspace;

var projectId = ProjectId.CreateNewId(debugName: TestProjectName);
solution = workspaceFactory()
solution = new AdhocWorkspace()
.CurrentSolution
.AddProject(projectId, TestProjectName, TestProjectName, LanguageNames.CSharp);

Expand All @@ -50,13 +46,6 @@ public static Project Create(Assembly testAssembly, string[] sources, Func<Works
}
}

if (analyzerReference != null)
{
solution = solution.AddAnalyzerReference(
projectId,
new AnalyzerFileReference(analyzerReference.Assembly.Location, AssemblyLoader.Instance));
}

_solutionCache.Add(testAssembly, solution);
}
}
Expand All @@ -79,23 +68,4 @@ public static Project Create(Assembly testAssembly, string[] sources, Func<Works

return solution.GetProject(testProject);
}

private static Workspace CreateWorkspace()
{
return new AdhocWorkspace();
}

internal sealed class AssemblyLoader : IAnalyzerAssemblyLoader
{
public static AssemblyLoader Instance = new AssemblyLoader();

public void AddDependencyLocation(string fullPath)
{
}

public Assembly LoadFromPath(string fullPath)
{
return Assembly.LoadFrom(fullPath);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,4 @@ internal static class DiagnosticDescriptors
DiagnosticSeverity.Warning,
isEnabledByDefault: true,
helpLinkUri: "https://aka.ms/aspnet/analyzers");

internal static readonly DiagnosticDescriptor RoutePatternIssue = new(
"RP0001",
new LocalizableResourceString(nameof(Resources.Invalid_Route_pattern), Resources.ResourceManager, typeof(Resources)),
new LocalizableResourceString(nameof(Resources.Route_issue_0), Resources.ResourceManager, typeof(Resources)),
"Style",
DiagnosticSeverity.Warning,
isEnabledByDefault: true,
helpLinkUri: "https://aka.ms/aspnet/analyzers");
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<AddPublicApiAnalyzers>false</AddPublicApiAnalyzers>
<TargetFramework>netstandard2.0</TargetFramework>
<IncludeBuildOutput>false</IncludeBuildOutput>
<Nullable>Enable</Nullable>
<RootNamespace>Microsoft.AspNetCore.Analyzers</RootNamespace>
</PropertyGroup>

<ItemGroup>
<Reference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="All" />
<Reference Include="Microsoft.CodeAnalysis.ExternalAccess.AspNetCore" />

<InternalsVisibleTo Include="Microsoft.AspNetCore.App.Analyzers.Test" />
<InternalsVisibleTo Include="Microsoft.AspNetCore.App.CodeFixes" />
Expand Down
186 changes: 0 additions & 186 deletions src/Framework/AspNetCoreAnalyzers/src/Analyzers/Resources.resx

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6df6573

Please sign in to comment.