Skip to content

Commit

Permalink
Merge pull request #1791 from razzmatazz/upgrade-lsp-to-0-14-2
Browse files Browse the repository at this point in the history
Update OmniSharp.Extensions.LanguageServer to "0.14.2" to fix synchronisation
  • Loading branch information
filipw authored May 12, 2020
2 parents 6c9d8a5 + 4fd9d7e commit 99d3403
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
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

0 comments on commit 99d3403

Please sign in to comment.