Skip to content
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 .github/workflows/close-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Install GitReleaseManager
uses: gittools/actions/gitreleasemanager/setup@v4.7.0
with:
versionSpec: '0.18.x'
versionSpec: '0.19.x'

- name: Use GitVersion
id: gitversion
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
if: ${{ github.event.action == 'opened' }}
uses: gittools/actions/gitreleasemanager/setup@v4.7.0
with:
versionSpec: '0.18.x'
versionSpec: '0.19.x'

- name: Use GitVersion
if: ${{ github.event.action == 'opened' }}
Expand Down
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<PackageVersion Include="System.Collections.Immutable" Version="10.0.9" />
<PackageVersion Include="System.Threading.Channels" Version="10.0.9" />
<PackageVersion Include="Microsoft.Reactive.Testing" Version="6.1.0" />
<PackageVersion Include="MediatR" Version="14.1.0" />
<PackageVersion Include="MediatR" Version="12.4.1" />
<PackageVersion Include="Bogus" Version="35.6.5" />
<PackageVersion Include="Snapper" Version="2.4.1" />
<PackageVersion Include="Xunit.SkippableFact" Version="1.5.61" />
Expand Down
2 changes: 1 addition & 1 deletion src/JsonRpc.Testing/SettlePipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ async Task<TR> IPipelineBehavior<T, TR>.Handle(T request, RequestHandlerDelegate
_settler.OnStartRequest();
try
{
return await next(cancellationToken).ConfigureAwait(false);
return await next().ConfigureAwait(false);
}
finally
{
Expand Down
19 changes: 1 addition & 18 deletions src/JsonRpc/JsonRpcServerServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using MediatR;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;

namespace OmniSharp.Extensions.JsonRpc
Expand Down Expand Up @@ -99,23 +98,7 @@ internal static IContainer AddJsonRpcServerCore<T>(this IContainer container, Js

internal static IContainer AddJsonRpcMediatR(this IContainer container)
{
var mediatRAssembly = typeof(IMediator).Assembly;
var licenseAccessorType = mediatRAssembly.GetType("MediatR.Licensing.LicenseAccessor", throwOnError: true)!;
var licenseValidatorType = mediatRAssembly.GetType("MediatR.Licensing.LicenseValidator", throwOnError: true)!;

container.RegisterMany(new[] { mediatRAssembly }, Registrator.Interfaces, Reuse.ScopedOrSingleton);
container.RegisterDelegate(
licenseAccessorType,
typeof(ILoggerFactory),
loggerFactory => Activator.CreateInstance(licenseAccessorType, loggerFactory)!,
Reuse.Singleton
);
container.RegisterDelegate(
licenseValidatorType,
typeof(ILoggerFactory),
loggerFactory => Activator.CreateInstance(licenseValidatorType, loggerFactory)!,
Reuse.Singleton
);
container.RegisterMany(new[] { typeof(IMediator).GetAssembly() }, Registrator.Interfaces, Reuse.ScopedOrSingleton);
container.RegisterMany<RequestContext>(Reuse.Scoped);
// Select the desired constructor
container.Register<IMediator, Mediator>(made: Made.Of(() => new Mediator(Arg.Of<IServiceProvider>())));
Expand Down
2 changes: 1 addition & 1 deletion src/Server/Pipelines/ResolveCommandPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public ResolveCommandPipeline(IRequestContext context, ILogger<ResolveCommandPip

public async Task<TResponse> Handle(TRequest request, RequestHandlerDelegate<TResponse> next, CancellationToken cancellationToken)
{
var response = await next(cancellationToken).ConfigureAwait(false);
var response = await next().ConfigureAwait(false);
cancellationToken.ThrowIfCancellationRequested();

// Only pin the handler type, if we know the source handler (codelens) is also the resolver.
Expand Down
6 changes: 3 additions & 3 deletions src/Server/Pipelines/SemanticTokensDeltaPipeline.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ internal class SemanticTokensDeltaPipeline<TRequest, TResponse> : IPipelineBehav
{
if (request is SemanticTokensParams semanticTokensParams)
{
var response = await next(cancellationToken).ConfigureAwait(false);
var response = await next().ConfigureAwait(false);
if (GetResponse(semanticTokensParams, response, out var result) && string.IsNullOrEmpty(result.ResultId))
{
result = result with { ResultId = Guid.NewGuid().ToString() };
Expand All @@ -25,7 +25,7 @@ internal class SemanticTokensDeltaPipeline<TRequest, TResponse> : IPipelineBehav

if (request is SemanticTokensDeltaParams semanticTokensDeltaParams)
{
var response = await next(cancellationToken).ConfigureAwait(false);
var response = await next().ConfigureAwait(false);
if (GetResponse(semanticTokensDeltaParams, response, out var result))
{
if (result is { IsFull: true, Full: { ResultId: null or { Length: 0 } } })
Expand All @@ -41,7 +41,7 @@ internal class SemanticTokensDeltaPipeline<TRequest, TResponse> : IPipelineBehav
return result is TResponse r ? r : response;
}

return await next(cancellationToken).ConfigureAwait(false);
return await next().ConfigureAwait(false);
}

// ReSharper disable once UnusedParameter.Local
Expand Down
8 changes: 4 additions & 4 deletions test/Lsp.Tests/Matchers/ResolveCommandMatcherTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public async Task Should_Not_Throw_Given_Another_Descriptor()
);

// When
Func<Task> a = async () => await handlerMatcher.Handle(new CodeLensParams(), _ => Task.FromResult(new CodeLensContainer()), CancellationToken.None);
Func<Task> a = async () => await handlerMatcher.Handle(new CodeLensParams(), () => Task.FromResult(new CodeLensContainer()), CancellationToken.None);
await a.Should().NotThrowAsync();
}

Expand Down Expand Up @@ -272,7 +272,7 @@ public async Task Should_Update_CompletionItems_With_HandlerType()
( list is IEnumerable<ICanBeResolved> ).Should().BeTrue();

// When
var response = await handlerMatcher.Handle(new CompletionParams(), _ => Task.FromResult(list), CancellationToken.None);
var response = await handlerMatcher.Handle(new CompletionParams(), () => Task.FromResult(list), CancellationToken.None);

// Then
response.Should().BeEquivalentTo(list, x => x.UsingStructuralRecordEquality());
Expand Down Expand Up @@ -323,7 +323,7 @@ public async Task Should_Update_CodeLensContainer_With_HandlerType()
( list is IEnumerable<ICanBeResolved> ).Should().BeTrue();

// When
var response = await handlerMatcher.Handle(new CodeLensParams(), _ => Task.FromResult(list), CancellationToken.None);
var response = await handlerMatcher.Handle(new CodeLensParams(), () => Task.FromResult(list), CancellationToken.None);

// Then
response.Should().BeEquivalentTo(list, x => x.UsingStructuralRecordEquality());
Expand Down Expand Up @@ -370,7 +370,7 @@ public async Task Should_Update_CodeLens_Removing_HandlerType()
};

// When
var response = await handlerMatcher.Handle(item, _ => Task.FromResult(item), CancellationToken.None);
var response = await handlerMatcher.Handle(item, () => Task.FromResult(item), CancellationToken.None);

// Then
response.Should().BeEquivalentTo(item, x => x.UsingStructuralRecordEquality());
Expand Down
8 changes: 4 additions & 4 deletions vscode-testextension/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vscode-testextension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@types/mocha": "^10.0.2",
"@types/node": "^24.0.0",
"@types/vscode": "^1.82.0",
"@vscode/test-electron": "^3.0.0",
"@vscode/test-electron": "^3.1.0",
"glob": "^13.0.0",
"mocha": "^11.0.0",
"source-map-support": "^0.5.21",
Expand Down
Loading