Move RazorSyntaxFactsService to VS.Editor.Razor and export it.

- Moved service poco types: `AcceptedCharacters`, `BlockKind`, `ClassifiedSpan`, `SpanKind` and `TagHelperSpan` into VS.Editor.Razor.

#1762
This commit is contained in:
N. Taylor Mullen 2017-11-13 12:42:47 -08:00
parent de23788019
commit 44e5874029
8 changed files with 11 additions and 24 deletions

View File

@ -1,17 +0,0 @@
// 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 Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Host.Mef;
namespace Microsoft.CodeAnalysis.Razor
{
[ExportLanguageServiceFactory(typeof(RazorSyntaxFactsService), RazorLanguage.Name, ServiceLayer.Default)]
internal class DefaultRazorSyntaxFactsServiceFactory : ILanguageServiceFactory
{
public ILanguageService CreateLanguageService(HostLanguageServices languageServices)
{
return new DefaultRazorSyntaxFactsService();
}
}
}

View File

@ -3,7 +3,7 @@
using System; using System;
namespace Microsoft.CodeAnalysis.Razor namespace Microsoft.VisualStudio.Editor.Razor
{ {
[Flags] [Flags]
public enum AcceptedCharacters public enum AcceptedCharacters

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // 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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.CodeAnalysis.Razor namespace Microsoft.VisualStudio.Editor.Razor
{ {
public enum BlockKind public enum BlockKind
{ {

View File

@ -3,7 +3,7 @@
using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language;
namespace Microsoft.CodeAnalysis.Razor namespace Microsoft.VisualStudio.Editor.Razor
{ {
public struct ClassifiedSpan public struct ClassifiedSpan
{ {

View File

@ -3,13 +3,16 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.Linq; using System.Linq;
using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language;
using Microsoft.AspNetCore.Razor.Language.Legacy; using Microsoft.AspNetCore.Razor.Language.Legacy;
using Span = Microsoft.AspNetCore.Razor.Language.Legacy.Span; using Span = Microsoft.AspNetCore.Razor.Language.Legacy.Span;
namespace Microsoft.CodeAnalysis.Razor namespace Microsoft.VisualStudio.Editor.Razor
{ {
[System.Composition.Shared]
[Export(typeof(RazorSyntaxFactsService))]
internal class DefaultRazorSyntaxFactsService : RazorSyntaxFactsService internal class DefaultRazorSyntaxFactsService : RazorSyntaxFactsService
{ {
public override IReadOnlyList<ClassifiedSpan> GetClassifiedSpans(RazorSyntaxTree syntaxTree) public override IReadOnlyList<ClassifiedSpan> GetClassifiedSpans(RazorSyntaxTree syntaxTree)

View File

@ -4,8 +4,9 @@
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language;
using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Host;
using Microsoft.CodeAnalysis.Razor;
namespace Microsoft.CodeAnalysis.Razor namespace Microsoft.VisualStudio.Editor.Razor
{ {
public abstract class RazorSyntaxFactsService : ILanguageService public abstract class RazorSyntaxFactsService : ILanguageService
{ {

View File

@ -1,7 +1,7 @@
// Copyright (c) .NET Foundation. All rights reserved. // 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. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
namespace Microsoft.CodeAnalysis.Razor namespace Microsoft.VisualStudio.Editor.Razor
{ {
public enum SpanKind public enum SpanKind
{ {

View File

@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language;
namespace Microsoft.CodeAnalysis.Razor namespace Microsoft.VisualStudio.Editor.Razor
{ {
public struct TagHelperSpan public struct TagHelperSpan
{ {