Move RazorCompletionFactsService to CodeAnalysis.Workspaces.Razor.

- Also updated workspaces test project to also compile for netcoreapp2.2.
This commit is contained in:
N. Taylor Mullen 2018-09-17 17:50:28 -07:00
parent b20921741c
commit 2b1bdb7342
9 changed files with 15 additions and 14 deletions

View File

@ -1,17 +1,15 @@
// 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.
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.Composition; using System.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 Microsoft.AspNetCore.Razor.Language.Syntax;
namespace Microsoft.VisualStudio.Editor.Razor namespace Microsoft.CodeAnalysis.Razor
{ {
[System.Composition.Shared] [Shared]
[Export(typeof(RazorCompletionFactsService))] [Export(typeof(RazorCompletionFactsService))]
internal class DefaultRazorCompletionFactsService : RazorCompletionFactsService internal class DefaultRazorCompletionFactsService : RazorCompletionFactsService
{ {
@ -84,7 +82,7 @@ namespace Microsoft.VisualStudio.Editor.Razor
} }
// Internal for testing // Internal for testing
internal static bool IsDirectiveCompletableToken(SyntaxToken token) internal static bool IsDirectiveCompletableToken(AspNetCore.Razor.Language.Syntax.SyntaxToken token)
{ {
return token.Kind == SyntaxKind.Identifier || return token.Kind == SyntaxKind.Identifier ||
// Marker symbol // Marker symbol

View File

@ -4,9 +4,9 @@
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language;
namespace Microsoft.VisualStudio.Editor.Razor namespace Microsoft.CodeAnalysis.Razor
{ {
public abstract class RazorCompletionFactsService internal abstract class RazorCompletionFactsService
{ {
public abstract IReadOnlyList<RazorCompletionItem> GetCompletionItems(RazorSyntaxTree syntaxTree, SourceSpan location); public abstract IReadOnlyList<RazorCompletionItem> GetCompletionItems(RazorSyntaxTree syntaxTree, SourceSpan location);
} }

View File

@ -3,9 +3,9 @@
using System; using System;
namespace Microsoft.VisualStudio.Editor.Razor namespace Microsoft.CodeAnalysis.Razor
{ {
public sealed class RazorCompletionItem internal sealed class RazorCompletionItem
{ {
public RazorCompletionItem( public RazorCompletionItem(
string displayText, string displayText,

View File

@ -1,9 +1,9 @@
// 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.VisualStudio.Editor.Razor namespace Microsoft.CodeAnalysis.Razor
{ {
public enum RazorCompletionItemKind internal enum RazorCompletionItemKind
{ {
Directive Directive
} }

View File

@ -13,6 +13,7 @@ using Microsoft.AspNetCore.Razor.Language;
using Microsoft.AspNetCore.Razor.Language.Legacy; using Microsoft.AspNetCore.Razor.Language.Legacy;
using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Completion; using Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.Razor;
using Microsoft.CodeAnalysis.Tags; using Microsoft.CodeAnalysis.Tags;
using Microsoft.CodeAnalysis.Text; using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion; using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion;

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net46;$(StandardTestTfms)</TargetFrameworks> <TargetFrameworks>net46;netcoreapp2.2;$(StandardTestTfms)</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Razor.Language.Syntax;
using Moq; using Moq;
using Xunit; using Xunit;
namespace Microsoft.VisualStudio.Editor.Razor namespace Microsoft.CodeAnalysis.Razor
{ {
public class DefaultRazorCompletionFactsServiceTest public class DefaultRazorCompletionFactsServiceTest
{ {

View File

@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Razor.Language;
using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Completion; using Microsoft.CodeAnalysis.Completion;
using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.Options;
using Microsoft.CodeAnalysis.Razor;
using Microsoft.CodeAnalysis.Text; using Microsoft.CodeAnalysis.Text;
using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion; using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion;
using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text;

View File

@ -7,6 +7,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor.Language; using Microsoft.AspNetCore.Razor.Language;
using Microsoft.AspNetCore.Razor.Language.Extensions; using Microsoft.AspNetCore.Razor.Language.Extensions;
using Microsoft.AspNetCore.Razor.Language.Legacy; using Microsoft.AspNetCore.Razor.Language.Legacy;
using Microsoft.CodeAnalysis.Razor;
using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion; using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion;
using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data; using Microsoft.VisualStudio.Language.Intellisense.AsyncCompletion.Data;
using Microsoft.VisualStudio.Text; using Microsoft.VisualStudio.Text;