diff --git a/src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/HtmlCSharp/CompletionResolveHandler.cs b/src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/HtmlCSharp/CompletionResolveHandler.cs index 85e8d5ccc9..17e6e2a801 100644 --- a/src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/HtmlCSharp/CompletionResolveHandler.cs +++ b/src/Razor/src/Microsoft.VisualStudio.LanguageServerClient.Razor/HtmlCSharp/CompletionResolveHandler.cs @@ -57,7 +57,7 @@ namespace Microsoft.VisualStudio.LanguageServerClient.Razor.HtmlCSharp Methods.TextDocumentCompletionResolveName, resolveData.LanguageServerKind, request, - cancellationToken); + cancellationToken).ConfigureAwait(false); return result; } diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServerClient.Razor.Test/HtmlCSharp/CompletionResolveHandlerTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServerClient.Razor.Test/HtmlCSharp/CompletionResolveHandlerTest.cs index c8de7090bc..ddbe5442f9 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServerClient.Razor.Test/HtmlCSharp/CompletionResolveHandlerTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServerClient.Razor.Test/HtmlCSharp/CompletionResolveHandlerTest.cs @@ -44,7 +44,7 @@ namespace Microsoft.VisualStudio.LanguageServerClient.Razor.HtmlCSharp var handler = new CompletionResolveHandler(requestInvoker.Object); // Act - var result = await handler.HandleRequestAsync(request, new ClientCapabilities(), CancellationToken.None); + var result = await handler.HandleRequestAsync(request, new ClientCapabilities(), CancellationToken.None).ConfigureAwait(false); // Assert Assert.True(called); @@ -67,7 +67,7 @@ namespace Microsoft.VisualStudio.LanguageServerClient.Razor.HtmlCSharp var handler = new CompletionResolveHandler(requestInvoker.Object); // Act - var result = await handler.HandleRequestAsync(request, new ClientCapabilities(), CancellationToken.None); + var result = await handler.HandleRequestAsync(request, new ClientCapabilities(), CancellationToken.None).ConfigureAwait(false); // Assert (Does not throw with MockBehavior.Strict) Assert.Equal("div", result.InsertText); diff --git a/src/Razor/test/Microsoft.VisualStudio.LanguageServerClient.Razor.Test/HtmlCSharp/DefaultLSPRequestInvokerTest.cs b/src/Razor/test/Microsoft.VisualStudio.LanguageServerClient.Razor.Test/HtmlCSharp/DefaultLSPRequestInvokerTest.cs index 4e074783e1..f795cfda67 100644 --- a/src/Razor/test/Microsoft.VisualStudio.LanguageServerClient.Razor.Test/HtmlCSharp/DefaultLSPRequestInvokerTest.cs +++ b/src/Razor/test/Microsoft.VisualStudio.LanguageServerClient.Razor.Test/HtmlCSharp/DefaultLSPRequestInvokerTest.cs @@ -88,6 +88,23 @@ namespace Microsoft.VisualStudio.LanguageServerClient.Razor.HtmlCSharp { throw new NotImplementedException(); } + +#pragma warning disable CA1801 // Parameter is never used + public Task<(ILanguageClient, JToken)> RequestAsync( + string[] contentTypes, + Func capabilitiesFilter, + string method, + JToken parameters, + CancellationToken cancellationToken) + { + // We except it to be called with only one content type. + var contentType = Assert.Single(contentTypes); + + _callback?.Invoke(contentType, method); + + return Task.FromResult<(ILanguageClient, JToken)>((null, null)); + } +#pragma warning restore CA1801 // Parameter is never used } } }