Skip to content

Commit

Permalink
Merge pull request #8078 from davidwengier/FixComment
Browse files Browse the repository at this point in the history
  • Loading branch information
davidwengier authored Jan 5, 2023
2 parents 803d776 + 787fb2a commit e0f8163
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1140,17 +1140,18 @@ public override Task<ImplementationResult> ImplementationAsync(DelegatedPosition
request,
cancellationToken).ConfigureAwait(false);

// Sometimes web tools will respond with a non-null response, of an array of diagnostics with a single element
// in it, but the actual diagnostics (and every other property) in that element are null. This confuses VS, and
// means we don't get squiggles for C# diagnostics, unless there are also Html diagnostics.
// This check ensures we catch that, and just return an empty result for Html diagnostics.
// If the delegated server wants to remove all diagnostics about a document, they will send back a response with an item, but that
// item will have null diagnostics (and every other property). We don't want to propagate that back out to the client, because
// it would make the client remove all diagnostics for the .razor file, including potentially any returned from other delegated
// servers.
if (response?.Response is null or [{ Diagnostics: null }, ..])
{
return null;
}

return response.Response;
}

private async Task<TResult?> DelegateTextDocumentPositionRequestAsync<TResult>(DelegatedPositionParams request, string methodName, CancellationToken cancellationToken)
{
var delegationDetails = await GetProjectedRequestDetailsAsync(request, cancellationToken).ConfigureAwait(false);
Expand Down

0 comments on commit e0f8163

Please sign in to comment.