зеркало из https://github.com/dotnet/razor.git
Remove unused service
This commit is contained in:
Родитель
b29a1c3f34
Коммит
f217326ffd
|
@ -1,36 +0,0 @@
|
|||
// Copyright (c) .NET Foundation. All rights reserved.
|
||||
// Licensed under the MIT license. See License.txt in the project root for license information.
|
||||
|
||||
using System;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Razor.Workspaces;
|
||||
|
||||
namespace Microsoft.AspNetCore.Razor.LanguageServer;
|
||||
|
||||
internal sealed class LspWorkspaceProvider(IHostServicesProvider hostServicesProvider) : IWorkspaceProvider, IDisposable
|
||||
{
|
||||
private readonly AdhocWorkspaceProvider _workspaceFactory = new AdhocWorkspaceProvider(hostServicesProvider);
|
||||
|
||||
private bool _disposed;
|
||||
|
||||
void IDisposable.Dispose()
|
||||
{
|
||||
if (_disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_workspaceFactory.Dispose();
|
||||
_disposed = true;
|
||||
}
|
||||
|
||||
public Workspace GetWorkspace()
|
||||
{
|
||||
if (_disposed)
|
||||
{
|
||||
throw new ObjectDisposedException(nameof(LspWorkspaceProvider));
|
||||
}
|
||||
|
||||
return _workspaceFactory.GetOrCreate();
|
||||
}
|
||||
}
|
|
@ -119,8 +119,6 @@ internal partial class RazorLanguageServer : SystemTextJsonLanguageServer<RazorR
|
|||
// Add the logger as a service in case anything in CLaSP pulls it out to do logging
|
||||
services.AddSingleton<ILspLogger>(Logger);
|
||||
|
||||
services.AddSingleton<IWorkspaceProvider, LspWorkspaceProvider>();
|
||||
|
||||
services.AddSingleton<IFormattingCodeDocumentProvider, LspFormattingCodeDocumentProvider>();
|
||||
|
||||
var featureOptions = _featureOptions ?? new DefaultLanguageServerFeatureOptions();
|
||||
|
|
Загрузка…
Ссылка в новой задаче