зеркало из https://github.com/dotnet/razor.git
Move completion resolve code to common layer
This commit is contained in:
Родитель
62df8df06a
Коммит
b3762aff2b
|
@ -11,7 +11,7 @@ using Microsoft.AspNetCore.Razor.PooledObjects;
|
|||
using Microsoft.CodeAnalysis.Razor.Logging;
|
||||
using Microsoft.VisualStudio.LanguageServer.Protocol;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion;
|
||||
namespace Microsoft.CodeAnalysis.Razor.Completion;
|
||||
|
||||
internal class AggregateCompletionItemResolver
|
||||
{
|
|
@ -5,7 +5,7 @@ using System.Threading;
|
|||
using System.Threading.Tasks;
|
||||
using Microsoft.VisualStudio.LanguageServer.Protocol;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion;
|
||||
namespace Microsoft.CodeAnalysis.Razor.Completion;
|
||||
|
||||
internal abstract class CompletionItemResolver
|
||||
{
|
|
@ -5,15 +5,13 @@ using System;
|
|||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Razor.LanguageServer.ProjectSystem;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Razor.Completion;
|
||||
using Microsoft.CodeAnalysis.Razor.ProjectSystem;
|
||||
using Microsoft.CodeAnalysis.Razor.Tooltip;
|
||||
using Microsoft.VisualStudio.LanguageServer.Protocol;
|
||||
using Microsoft.VisualStudio.Text.Adornments;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer.Completion;
|
||||
namespace Microsoft.CodeAnalysis.Razor.Completion;
|
||||
|
||||
internal class RazorCompletionItemResolver(IProjectSnapshotManager projectManager) : CompletionItemResolver
|
||||
{
|
|
@ -4,10 +4,8 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using Microsoft.AspNetCore.Razor.PooledObjects;
|
||||
using Microsoft.AspNetCore.Razor.Utilities;
|
||||
using Microsoft.CodeAnalysis.Razor.ProjectSystem;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer.ProjectSystem;
|
||||
namespace Microsoft.CodeAnalysis.Razor.ProjectSystem;
|
||||
|
||||
internal static partial class IProjectSnapshotManagerExtensions
|
||||
{
|
|
@ -6,11 +6,9 @@ using System.Diagnostics.CodeAnalysis;
|
|||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Razor.PooledObjects;
|
||||
using Microsoft.AspNetCore.Razor.Utilities;
|
||||
using Microsoft.CodeAnalysis.Razor;
|
||||
using Microsoft.CodeAnalysis.Razor.Logging;
|
||||
using Microsoft.CodeAnalysis.Razor.ProjectSystem;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer.ProjectSystem;
|
||||
namespace Microsoft.CodeAnalysis.Razor.ProjectSystem;
|
||||
|
||||
internal static partial class IProjectSnapshotManagerExtensions
|
||||
{
|
|
@ -5,11 +5,9 @@ using System;
|
|||
using System.IO;
|
||||
using Microsoft.AspNetCore.Razor.Language;
|
||||
using Microsoft.AspNetCore.Razor.Utilities;
|
||||
using Microsoft.CodeAnalysis.Razor;
|
||||
using Microsoft.CodeAnalysis.Razor.ProjectSystem;
|
||||
using Microsoft.Extensions.Internal;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer.ProjectSystem;
|
||||
namespace Microsoft.CodeAnalysis.Razor.ProjectSystem;
|
||||
|
||||
internal sealed record class MiscFilesHostProject : HostProject
|
||||
{
|
|
@ -8,11 +8,11 @@ using Microsoft.AspNetCore.Razor.Language.Components;
|
|||
using Microsoft.AspNetCore.Razor.ProjectSystem;
|
||||
using Microsoft.AspNetCore.Razor.Test.Common;
|
||||
using Microsoft.CodeAnalysis.Razor.ProjectSystem;
|
||||
using Microsoft.CodeAnalysis.Razor.Workspaces.Test;
|
||||
using Roslyn.Test.Utilities;
|
||||
using Xunit;
|
||||
using Xunit.Abstractions;
|
||||
using static Microsoft.AspNetCore.Razor.Language.CommonMetadata;
|
||||
using IProjectSnapshotManagerExtensions = Microsoft.CodeAnalysis.Razor.Workspaces.Test.IProjectSnapshotManagerExtensions;
|
||||
|
||||
namespace Microsoft.CodeAnalysis.Razor.Tooltip;
|
||||
|
||||
|
@ -22,7 +22,7 @@ public class ProjectAvailabilityTests(ITestOutputHelper testOutput) : ToolingTes
|
|||
public async Task GetProjectAvailabilityText_NoProjects_ReturnsNull()
|
||||
{
|
||||
var projectManager = CreateProjectSnapshotManager();
|
||||
var solutionQueryOperations = projectManager.GetQueryOperations();
|
||||
var solutionQueryOperations = IProjectSnapshotManagerExtensions.GetQueryOperations(projectManager);
|
||||
|
||||
var availability = await solutionQueryOperations.GetProjectAvailabilityTextAsync("file.razor", "MyTagHelper", DisposalToken);
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class ProjectAvailabilityTests(ITestOutputHelper testOutput) : ToolingTes
|
|||
updater.DocumentAdded(hostProject.Key, hostDocument, TestMocks.CreateTextLoader(hostDocument.FilePath, text: ""));
|
||||
});
|
||||
|
||||
var solutionQueryOperations = projectManager.GetQueryOperations();
|
||||
var solutionQueryOperations = IProjectSnapshotManagerExtensions.GetQueryOperations(projectManager);
|
||||
|
||||
var availability = await solutionQueryOperations.GetProjectAvailabilityTextAsync(hostDocument.FilePath, tagHelperTypeName, DisposalToken);
|
||||
|
||||
|
@ -109,7 +109,7 @@ public class ProjectAvailabilityTests(ITestOutputHelper testOutput) : ToolingTes
|
|||
updater.DocumentAdded(hostProject2.Key, hostDocument, TestMocks.CreateTextLoader(hostDocument.FilePath, text: ""));
|
||||
});
|
||||
|
||||
var solutionQueryOperations = projectManager.GetQueryOperations();
|
||||
var solutionQueryOperations = IProjectSnapshotManagerExtensions.GetQueryOperations(projectManager);
|
||||
|
||||
var availability = await solutionQueryOperations.GetProjectAvailabilityTextAsync(hostDocument.FilePath, tagHelperTypeName, DisposalToken);
|
||||
|
||||
|
@ -157,7 +157,7 @@ public class ProjectAvailabilityTests(ITestOutputHelper testOutput) : ToolingTes
|
|||
updater.DocumentAdded(hostProject2.Key, hostDocument, TestMocks.CreateTextLoader(hostDocument.FilePath, text: ""));
|
||||
});
|
||||
|
||||
var solutionQueryOperations = projectManager.GetQueryOperations();
|
||||
var solutionQueryOperations = IProjectSnapshotManagerExtensions.GetQueryOperations(projectManager);
|
||||
|
||||
var availability = await solutionQueryOperations.GetProjectAvailabilityTextAsync(hostDocument.FilePath, tagHelperTypeName, DisposalToken);
|
||||
|
||||
|
@ -201,7 +201,7 @@ public class ProjectAvailabilityTests(ITestOutputHelper testOutput) : ToolingTes
|
|||
updater.DocumentAdded(hostProject2.Key, hostDocument, TestMocks.CreateTextLoader(hostDocument.FilePath, text: ""));
|
||||
});
|
||||
|
||||
var solutionQueryOperations = projectManager.GetQueryOperations();
|
||||
var solutionQueryOperations = IProjectSnapshotManagerExtensions.GetQueryOperations(projectManager);
|
||||
|
||||
var availability = await solutionQueryOperations.GetProjectAvailabilityTextAsync(hostDocument.FilePath, "MyTagHelper", DisposalToken);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче