Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OmniSharp.Extensions.LanguageServer to "0.14.2" to fix synchronisation #1791

Merged
merged 1 commit into from
May 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<PackageReference Update="Nuget.ProjectModel" Version="$(NuGetPackageVersion)" />
<PackageReference Update="Nuget.Versioning" Version="$(NuGetPackageVersion)" />

<PackageReference Update="OmniSharp.Extensions.LanguageServer" Version="0.13.1" />
<PackageReference Update="OmniSharp.Extensions.LanguageServer" Version="0.14.2" />

<PackageReference Update="SQLitePCLRaw.bundle_green" Version="1.1.2" />
<PackageReference Update="System.Collections.Immutable" Version="1.4.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using OmniSharp.Extensions.Embedded.MediatR;
using MediatR;
using OmniSharp.Extensions.JsonRpc;
using OmniSharp.Extensions.LanguageServer.Protocol;
using OmniSharp.Extensions.LanguageServer.Protocol.Client.Capabilities;
Expand Down
19 changes: 10 additions & 9 deletions src/OmniSharp.LanguageServerProtocol/LanguageServerHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
using OmniSharp.LanguageServerProtocol.Eventing;
using OmniSharp.LanguageServerProtocol.Handlers;
using OmniSharp.Mef;
using OmniSharp.Models.Diagnostics;
using OmniSharp.Options;
using OmniSharp.Roslyn;
using OmniSharp.Services;
Expand All @@ -28,7 +27,6 @@ internal class LanguageServerHost : IDisposable
{
private readonly LanguageServerOptions _options;
private IServiceCollection _services;
private readonly LoggerFactory _loggerFactory;
private readonly CommandLineApplication _application;
private readonly CancellationTokenSource _cancellationTokenSource;
private CompositionHost _compositionHost;
Expand All @@ -44,24 +42,24 @@ public LanguageServerHost(
CommandLineApplication application,
CancellationTokenSource cancellationTokenSource)
{
_loggerFactory = new LoggerFactory();
_logger = _loggerFactory.CreateLogger<LanguageServerHost>();
_options = new LanguageServerOptions()
.WithInput(input)
.WithOutput(output)
.WithLoggerFactory(_loggerFactory)
.AddDefaultLoggingProvider()
.ConfigureLogging(x => x
.AddLanguageServer()
.SetMinimumLevel(application.LogLevel))
.OnInitialize(Initialize)
.WithMinimumLogLevel(application.LogLevel)
.WithServices(services => _services = services);
.WithServices(services => {
_services = services;
});

_application = application;
_cancellationTokenSource = cancellationTokenSource;
}

public void Dispose()
{
_compositionHost?.Dispose();
_loggerFactory?.Dispose();
_cancellationTokenSource?.Dispose();
}

Expand Down Expand Up @@ -93,6 +91,9 @@ private void CreateCompositionHost(InitializeParams initializeParams)
_eventEmitter = new LanguageServerEventEmitter();
_serviceProvider = CompositionHostBuilder.CreateDefaultServiceProvider(_environment, configurationRoot, _eventEmitter, _services);

var loggerFactory = _serviceProvider.GetService<ILoggerFactory>();
_logger = loggerFactory.CreateLogger<LanguageServerHost>();

var options = _serviceProvider.GetRequiredService<IOptionsMonitor<OmniSharpOptions>>();
var plugins = _application.CreatePluginAssemblies(options.CurrentValue, _environment);

Expand Down