зеркало из https://github.com/dotnet/razor.git
PR Feedback
This commit is contained in:
Родитель
d37da8b3de
Коммит
b69b08cbe3
|
@ -165,7 +165,6 @@ internal static class IServiceCollectionExtensions
|
|||
services.AddHandler<WorkspaceSpellCheckEndpoint>();
|
||||
}
|
||||
|
||||
|
||||
services.AddHandlerWithCapabilities<DocumentDidChangeEndpoint>();
|
||||
services.AddHandler<DocumentDidCloseEndpoint>();
|
||||
services.AddHandler<DocumentDidOpenEndpoint>();
|
||||
|
|
|
@ -39,12 +39,15 @@ internal sealed class LspCSharpSpellCheckRangeProvider(
|
|||
delegatedParams,
|
||||
cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (delegatedResponse is null)
|
||||
if (delegatedResponse is not [_, ..] response)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
using var ranges = new PooledArrayBuilder<SpellCheckRange>();
|
||||
// Most common case is we'll get one report back from Roslyn, so we'll use that as the initial capacity.
|
||||
var initialCapacity = response[0].Ranges?.Length ?? 4;
|
||||
|
||||
using var ranges = new PooledArrayBuilder<SpellCheckRange>(initialCapacity);
|
||||
foreach (var report in delegatedResponse)
|
||||
{
|
||||
if (report.Ranges is not { } csharpRanges)
|
||||
|
@ -69,6 +72,6 @@ internal sealed class LspCSharpSpellCheckRangeProvider(
|
|||
}
|
||||
}
|
||||
|
||||
return ranges.ToImmutable();
|
||||
return ranges.DrainToImmutable();
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче