From b1aef03aaf24e2fcd83b41bc116366a7ce482583 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Mon, 1 Apr 2019 20:59:11 -0700 Subject: [PATCH] Expand RazorProject.GetItem to take in FileKinds when getting items. - Obsoleted old `GetItem` API. - Updated tests to take new API. - Added a new test to verify the broken scenario. dotnet/aspnetcore-tooling#8972 \n\nCommit migrated from https://github.com/dotnet/aspnetcore-tooling/commit/2dd34b8dd82a3214ba9242ee627ba13dc55e915a --- .../CodeGenerationBenchmark.cs | 2 +- .../SyntaxTreeGenerationBenckmark.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Razor/perf/Microsoft.AspNetCore.Razor.Performance/CodeGenerationBenchmark.cs b/src/Razor/perf/Microsoft.AspNetCore.Razor.Performance/CodeGenerationBenchmark.cs index c35e1db42f..0748ccf4ef 100644 --- a/src/Razor/perf/Microsoft.AspNetCore.Razor.Performance/CodeGenerationBenchmark.cs +++ b/src/Razor/perf/Microsoft.AspNetCore.Razor.Performance/CodeGenerationBenchmark.cs @@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Razor.Performance ProjectEngine = RazorProjectEngine.Create(RazorConfiguration.Default, fileSystem, b => RazorExtensions.Register(b)); ; - MSN = fileSystem.GetItem(Path.Combine(root.FullName, "MSN.cshtml")); + MSN = fileSystem.GetItem(Path.Combine(root.FullName, "MSN.cshtml"), FileKinds.Legacy); } public RazorProjectEngine ProjectEngine { get; } diff --git a/src/Razor/perf/Microsoft.AspNetCore.Razor.Performance/SyntaxTreeGenerationBenckmark.cs b/src/Razor/perf/Microsoft.AspNetCore.Razor.Performance/SyntaxTreeGenerationBenckmark.cs index d1ec9a0a55..fa1e1c2e64 100644 --- a/src/Razor/perf/Microsoft.AspNetCore.Razor.Performance/SyntaxTreeGenerationBenckmark.cs +++ b/src/Razor/perf/Microsoft.AspNetCore.Razor.Performance/SyntaxTreeGenerationBenckmark.cs @@ -25,7 +25,7 @@ namespace Microsoft.AspNetCore.Razor.Performance ProjectEngine = RazorProjectEngine.Create(RazorConfiguration.Default, fileSystem, b => RazorExtensions.Register(b)); ; - var projectItem = fileSystem.GetItem(Path.Combine(root.FullName, "MSN.cshtml")); + var projectItem = fileSystem.GetItem(Path.Combine(root.FullName, "MSN.cshtml"), FileKinds.Legacy); MSN = RazorSourceDocument.ReadFrom(projectItem); var directiveFeature = ProjectEngine.EngineFeatures.OfType().FirstOrDefault();