From a765c71c085d3594140d8b42dee04a1765da212c Mon Sep 17 00:00:00 2001 From: Todd Grunke Date: Tue, 8 Jun 2021 13:39:45 -0700 Subject: [PATCH 1/2] Prepare for content type renames for aspx/cshtml/html files. These content type names are not yet submitted. Once they have been submitted, there will be a subsequent commit to only remove the old content type names. --- .../Core/Def/Implementation/Venus/ContainedDocument.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/VisualStudio/Core/Def/Implementation/Venus/ContainedDocument.cs b/src/VisualStudio/Core/Def/Implementation/Venus/ContainedDocument.cs index 94b825545d357..868cbef0d747f 100644 --- a/src/VisualStudio/Core/Def/Implementation/Venus/ContainedDocument.cs +++ b/src/VisualStudio/Core/Def/Implementation/Venus/ContainedDocument.cs @@ -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 = '@'; @@ -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) || + if (projectionBuffer.SourceBuffers.Any(b => b.ContentType.IsOfType(HTML) || + b.ContentType.IsOfType(WebForms) || b.ContentType.IsOfType(HTMLX))) { return HostType.HTML; From 8b85de95e88baf1e7d10d33f11bd64f693a3ccbc Mon Sep 17 00:00:00 2001 From: Todd Grunke Date: Tue, 8 Jun 2021 15:10:57 -0700 Subject: [PATCH 2/2] Cleanup whitespace --- .../Core/Def/Implementation/Venus/ContainedDocument.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/VisualStudio/Core/Def/Implementation/Venus/ContainedDocument.cs b/src/VisualStudio/Core/Def/Implementation/Venus/ContainedDocument.cs index 868cbef0d747f..aa46fe4f09f16 100644 --- a/src/VisualStudio/Core/Def/Implementation/Venus/ContainedDocument.cs +++ b/src/VisualStudio/Core/Def/Implementation/Venus/ContainedDocument.cs @@ -150,7 +150,7 @@ 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; @@ -158,7 +158,7 @@ private HostType GetHostType() // For TypeScript hosted in HTML the source buffers will have type names // HTMLX and TypeScript. - if (projectionBuffer.SourceBuffers.Any(b => b.ContentType.IsOfType(HTML) || + if (projectionBuffer.SourceBuffers.Any(b => b.ContentType.IsOfType(HTML) || b.ContentType.IsOfType(WebForms) || b.ContentType.IsOfType(HTMLX))) {