提交 fe47a8ac 编写于 作者: D David Wengier

Nullability

上级 afcdaa53
......@@ -16,7 +16,7 @@ internal interface IRequestHandlerMetadata
/// <summary>
/// Name of the language for LSP method to handle (optional).
/// </summary>
string LanguageName { get; }
string? LanguageName { get; }
/// <summary>
/// Whether or not handling this method results in changes to the current solution state
......
......@@ -16,10 +16,10 @@ internal partial class RequestExecutionQueue
{
public Func<RequestContext, Task<bool>> Callback { get; }
public bool MutatesSolutionState { get; }
public string ClientName { get; }
public string? ClientName { get; }
public ClientCapabilities ClientCapabilities { get; }
public QueueItem(bool mutatesSolutionState, ClientCapabilities clientCapabilities, string clientName, Func<RequestContext, Task<bool>> callback)
public QueueItem(bool mutatesSolutionState, ClientCapabilities clientCapabilities, string? clientName, Func<RequestContext, Task<bool>> callback)
{
MutatesSolutionState = mutatesSolutionState;
ClientCapabilities = clientCapabilities;
......
......@@ -31,7 +31,7 @@ public RequestExecutionQueue(ILspSolutionProvider solutionProvider)
}
public Task<TResponseType> ExecuteAsync<TRequestType, TResponseType>(bool mutatesSolutionState, IRequestHandler<TRequestType, TResponseType> handler, TRequestType request,
ClientCapabilities clientCapabilities, string clientName, CancellationToken cancellationToken) where TRequestType : class
ClientCapabilities clientCapabilities, string? clientName, CancellationToken cancellationToken) where TRequestType : class
{
var completion = new TaskCompletionSource<TResponseType>();
......@@ -83,6 +83,8 @@ private async Task ProcessQueueAsync()
// Mutating requests block other requests from starting to ensure an up to date snapshot is used.
var ranToCompletion = await work.Callback(context).ConfigureAwait(false);
// If the handling of the request failed, the exception will bubble back up to the caller, but we
// still need to react to it here by throwing away solution updates
if (ranToCompletion)
{
_lastMutatedSolution = mutatedSolution ?? _lastMutatedSolution;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册