From 520876e55d3bb86d90b3bf22e4c71db07283dd58 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Tue, 14 Nov 2017 16:49:35 -0800 Subject: [PATCH] Re-add some Legacy ITagHelperResolver infrastructure. - This is required until the TagHelperProjectSystem is completed. --- .../Legacy/ITagHelperResolver.cs | 18 ++++++++++++++ .../Legacy/LegacyTagHelperResolver.cs | 24 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/Microsoft.VisualStudio.LanguageServices.Razor/Legacy/ITagHelperResolver.cs create mode 100644 src/Microsoft.VisualStudio.LanguageServices.Razor/Legacy/LegacyTagHelperResolver.cs diff --git a/src/Microsoft.VisualStudio.LanguageServices.Razor/Legacy/ITagHelperResolver.cs b/src/Microsoft.VisualStudio.LanguageServices.Razor/Legacy/ITagHelperResolver.cs new file mode 100644 index 0000000000..a0ae0eb27e --- /dev/null +++ b/src/Microsoft.VisualStudio.LanguageServices.Razor/Legacy/ITagHelperResolver.cs @@ -0,0 +1,18 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Threading.Tasks; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Razor; + +namespace Microsoft.VisualStudio.LanguageServices.Razor +{ + // ---------------------------------------------------------------------------------------------------- + // NOTE: This is only here for VisualStudio binary compatibility. This type should not be used; instead + // use the Microsoft.CodeAnalysis.Razor variant from Microsoft.CodeAnalysis.Razor.Workspaces + // ---------------------------------------------------------------------------------------------------- + public interface ITagHelperResolver + { + Task GetTagHelpersAsync(Project project); + } +} \ No newline at end of file diff --git a/src/Microsoft.VisualStudio.LanguageServices.Razor/Legacy/LegacyTagHelperResolver.cs b/src/Microsoft.VisualStudio.LanguageServices.Razor/Legacy/LegacyTagHelperResolver.cs new file mode 100644 index 0000000000..ed6cc73313 --- /dev/null +++ b/src/Microsoft.VisualStudio.LanguageServices.Razor/Legacy/LegacyTagHelperResolver.cs @@ -0,0 +1,24 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.ComponentModel.Composition; +using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.Razor; + +namespace Microsoft.VisualStudio.LanguageServices.Razor +{ + // ---------------------------------------------------------------------------------------------------- + // NOTE: This is only here for VisualStudio binary compatibility. This type should not be used; instead + // use TagHelperResolver. + // ---------------------------------------------------------------------------------------------------- + [Export(typeof(ITagHelperResolver))] + internal class LegacyTagHelperResolver : DefaultTagHelperResolver, ITagHelperResolver + { + [ImportingConstructor] + public LegacyTagHelperResolver( + [Import(typeof(VisualStudioWorkspace))] Workspace workspace) + : base(workspace.Services.GetRequiredService(), workspace) + { + } + } +} \ No newline at end of file