Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for content type renames for aspx/cshtml/html files. #53954

Merged
merged 2 commits into from
Jun 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ internal sealed partial class ContainedDocument : ForegroundThreadAffinitizedObj

private const string HTML = nameof(HTML);
private const string HTMLX = nameof(HTMLX);
private const string LegacyRazor = nameof(LegacyRazor);
private const string Razor = nameof(Razor);
private const string XOML = nameof(XOML);
private const string WebForms = nameof(WebForms);

private const char RazorExplicit = '@';

Expand Down Expand Up @@ -148,14 +150,16 @@ private HostType GetHostType()
{
// RazorCSharp has an HTMLX base type but should not be associated with
// the HTML host type, so we check for it first.
if (projectionBuffer.SourceBuffers.Any(b => b.ContentType.IsOfType(Razor)))
if (projectionBuffer.SourceBuffers.Any(b => b.ContentType.IsOfType(Razor) ||
b.ContentType.IsOfType(LegacyRazor)))
{
return HostType.Razor;
}

// For TypeScript hosted in HTML the source buffers will have type names
// HTMLX and TypeScript.
if (projectionBuffer.SourceBuffers.Any(b => b.ContentType.IsOfType(HTML) ||
b.ContentType.IsOfType(WebForms) ||
b.ContentType.IsOfType(HTMLX)))
{
return HostType.HTML;
Expand Down