зеркало из https://github.com/dotnet/razor.git
Remove unused parameter
This commit is contained in:
Родитель
f3a633bf3a
Коммит
4207fcf417
|
@ -11,14 +11,12 @@ namespace Microsoft.AspNetCore.Razor.LanguageServer;
|
|||
|
||||
internal sealed class AdhocWorkspaceFactory(IHostServicesProvider hostServicesProvider) : IAdhocWorkspaceFactory
|
||||
{
|
||||
public AdhocWorkspace Create(params IWorkspaceService[] workspaceServices)
|
||||
public AdhocWorkspace Create()
|
||||
{
|
||||
workspaceServices ??= [];
|
||||
|
||||
var fallbackServices = hostServicesProvider.GetServices();
|
||||
var services = AdhocServices.Create(
|
||||
workspaceServices: workspaceServices.ToImmutableArray(),
|
||||
languageServices: ImmutableArray<ILanguageService>.Empty,
|
||||
workspaceServices: [],
|
||||
languageServices: [],
|
||||
fallbackServices);
|
||||
|
||||
return new AdhocWorkspace(services);
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
using Microsoft.CodeAnalysis.Host;
|
||||
|
||||
namespace Microsoft.CodeAnalysis.Razor.Workspaces;
|
||||
|
||||
internal interface IAdhocWorkspaceFactory
|
||||
{
|
||||
AdhocWorkspace Create(params IWorkspaceService[] workspaceServices);
|
||||
AdhocWorkspace Create();
|
||||
}
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
using System.Collections.Immutable;
|
||||
using System.Composition;
|
||||
using Microsoft.CodeAnalysis.Host;
|
||||
using Microsoft.CodeAnalysis.Razor.Workspaces;
|
||||
|
||||
namespace Microsoft.CodeAnalysis.Remote.Razor;
|
||||
|
@ -11,13 +9,12 @@ namespace Microsoft.CodeAnalysis.Remote.Razor;
|
|||
[Export(typeof(IAdhocWorkspaceFactory)), Shared]
|
||||
internal sealed class RemoteAdhocWorkspaceFactory() : IAdhocWorkspaceFactory
|
||||
{
|
||||
public AdhocWorkspace Create(params IWorkspaceService[] workspaceServices)
|
||||
public AdhocWorkspace Create()
|
||||
{
|
||||
workspaceServices ??= [];
|
||||
var hostServices = RemoteWorkspaceAccessor.GetWorkspace().Services.HostServices;
|
||||
|
||||
var services = AdhocServices.Create(
|
||||
workspaceServices: workspaceServices.ToImmutableArray(),
|
||||
workspaceServices: [],
|
||||
languageServices: [],
|
||||
fallbackServices: hostServices);
|
||||
|
||||
|
|
|
@ -1,10 +1,8 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Razor.Test.Common.Workspaces;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Host;
|
||||
using Microsoft.CodeAnalysis.Razor.Workspaces;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer.Test;
|
||||
|
@ -17,9 +15,9 @@ internal class TestAdhocWorkspaceFactory : IAdhocWorkspaceFactory
|
|||
{
|
||||
}
|
||||
|
||||
public AdhocWorkspace Create(params IWorkspaceService[] workspaceServices)
|
||||
public AdhocWorkspace Create()
|
||||
{
|
||||
var services = TestServices.Create(workspaceServices, Enumerable.Empty<ILanguageService>());
|
||||
var services = TestServices.Create(workspaceServices: [], razorLanguageServices: []);
|
||||
var workspace = TestWorkspace.Create(services);
|
||||
return workspace;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче