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 Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<PackageVersion Include="MessagePack" Version="2.5.198" />
<PackageVersion Include="Microsoft.AspNetCore.App.Runtime.$(NetCoreSDKRuntimeIdentifier)" Version="8.0.2" />
<PackageVersion Include="Microsoft.Build.Framework" Version="$(_MicrosoftBuildPackageVersion)" />
<PackageVersion Include="Microsoft.Build.Locator" Version="1.4.1" />
<PackageVersion Include="Microsoft.Build.Locator" Version="1.8.1" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="$(_MicrosoftBuildPackageVersion)" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="$(_MicrosoftBuildPackageVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzer.Testing" Version="1.1.3-beta1.24423.1" />
Expand Down
42 changes: 21 additions & 21 deletions eng/Version.Details.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,27 @@ This file should be imported by eng/Versions.props
<Project>
<PropertyGroup>
<!-- dotnet/roslyn dependencies -->
<MicrosoftCodeAnalysisAnalyzersPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisAnalyzersPackageVersion>
<MicrosoftCodeAnalysisCommonPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisCommonPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
<MicrosoftCodeAnalysisExternalAccessFSharpPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisExternalAccessFSharpPackageVersion>
<MicrosoftCodeAnalysisExternalAccessRazorEditorFeaturesPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisExternalAccessRazorEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisExternalAccessRazorFeaturesPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisExternalAccessRazorFeaturesPackageVersion>
<MicrosoftCodeAnalysisLanguageServerProtocolPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisLanguageServerProtocolPackageVersion>
<MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>
<MicrosoftCodeAnalysisTestUtilitiesPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisTestUtilitiesPackageVersion>
<MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>5.0.0-2.25421.11</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>5.0.0-2.25421.11</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
<MicrosoftNetCompilersToolsetPackageVersion>5.0.0-2.25421.11</MicrosoftNetCompilersToolsetPackageVersion>
<MicrosoftVisualStudioLanguageServicesPackageVersion>5.0.0-2.25421.11</MicrosoftVisualStudioLanguageServicesPackageVersion>
<MicrosoftCodeAnalysisAnalyzersPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisAnalyzersPackageVersion>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5.0.0-2.25452.2

Out of curiosity, why not have this defined in version.details.props?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume you meant "why not in Version.props", and the answer is this split came from arcade, so there was one version file for people, and one for automation. See dotnet/arcade-services#4998

The irony is of course, I've only ever manually updated this file, and its xml file twin.

<MicrosoftCodeAnalysisCommonPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisCommonPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
<MicrosoftCodeAnalysisExternalAccessFSharpPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisExternalAccessFSharpPackageVersion>
<MicrosoftCodeAnalysisExternalAccessRazorEditorFeaturesPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisExternalAccessRazorEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisExternalAccessRazorFeaturesPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisExternalAccessRazorFeaturesPackageVersion>
<MicrosoftCodeAnalysisLanguageServerProtocolPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisLanguageServerProtocolPackageVersion>
<MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>
<MicrosoftCodeAnalysisTestUtilitiesPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisTestUtilitiesPackageVersion>
<MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>5.0.0-2.25452.2</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>5.0.0-2.25452.2</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
<MicrosoftNetCompilersToolsetPackageVersion>5.0.0-2.25452.2</MicrosoftNetCompilersToolsetPackageVersion>
<MicrosoftVisualStudioLanguageServicesPackageVersion>5.0.0-2.25452.2</MicrosoftVisualStudioLanguageServicesPackageVersion>
<!-- dotnet/arcade dependencies -->
<MicrosoftDotNetArcadeSdkPackageVersion>9.0.0-beta.25428.3</MicrosoftDotNetArcadeSdkPackageVersion>
<!-- dotnet/aspnetcore dependencies -->
Expand Down
84 changes: 42 additions & 42 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,89 +2,89 @@
<Dependencies>
<Source Uri="https://github.com/dotnet/dotnet" Mapping="razor" Sha="adfea8e331724cfd46007dfefec405b5e5faad1d" BarId="279079" />
<ProductDependencies>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CommonLanguageServerProtocol.Framework" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CommonLanguageServerProtocol.Framework" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp.EditorFeatures" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.CSharp.EditorFeatures" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Features" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Features" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Common" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Common" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Remote.ServiceHub" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.Remote.ServiceHub" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.Common" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.Common" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.VisualStudio.LanguageServices" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.VisualStudio.LanguageServices" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Test.Utilities" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.Test.Utilities" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor.Features" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor.Features" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor.EditorFeatures" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor.EditorFeatures" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.LanguageServer.Protocol" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.LanguageServer.Protocol" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.FSharp" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.FSharp" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="5.0.0-2.25421.11">
<Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="5.0.0-2.25452.2">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>2a2f7bb1b54522b1af28e8cc7b61024612f0ce17</Sha>
<Sha>e5924c0044a45b9b10ccde820a447adbb636f8be</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor.Threading;
Expand Down Expand Up @@ -98,13 +96,23 @@ protected virtual TRequest CreateHtmlParams(Uri uri)
}

_logger.LogDebug($"Reporting {diagnostics.Length} diagnostics back to the client");
return diagnostics.ToArray();
return [.. diagnostics];
}

protected static Task<SourceGeneratedDocument?> TryGetGeneratedDocumentAsync(TextDocument razorDocument, CancellationToken cancellationToken)
{
if (!razorDocument.TryComputeHintNameFromRazorDocument(out var hintName))
{
return SpecializedTasks.Null<SourceGeneratedDocument>();
}

return razorDocument.Project.TryGetSourceGeneratedDocumentFromHintNameAsync(hintName, cancellationToken);
}

private async Task<LspDiagnostic[]> GetCSharpDiagnosticsAsync(TextDocument razorDocument, Guid correletionId, CancellationToken cancellationToken)
{
if (!razorDocument.TryComputeHintNameFromRazorDocument(out var hintName) ||
await razorDocument.Project.TryGetSourceGeneratedDocumentFromHintNameAsync(hintName, cancellationToken).ConfigureAwait(false) is not { } generatedDocument)
var generatedDocument = await TryGetGeneratedDocumentAsync(razorDocument, cancellationToken).ConfigureAwait(false);
if (generatedDocument is null)
{
return [];
}
Expand All @@ -114,7 +122,7 @@ await razorDocument.Project.TryGetSourceGeneratedDocumentFromHintNameAsync(hintN
using var _ = _telemetryReporter.TrackLspRequest(LspMethodName, "Razor.ExternalAccess", TelemetryThresholds.DiagnosticsSubLSPTelemetryThreshold, correletionId);
var supportsVisualStudioExtensions = _clientCapabilitiesService.ClientCapabilities.SupportsVisualStudioExtensions;
var diagnostics = await ExternalHandlers.Diagnostics.GetDocumentDiagnosticsAsync(generatedDocument, supportsVisualStudioExtensions, cancellationToken).ConfigureAwait(false);
return diagnostics.ToArray();
return [.. diagnostics];
}

private async Task<LspDiagnostic[]> GetHtmlDiagnosticsAsync(TextDocument razorDocument, Guid correletionId, CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private static LspDiagnostic[] FilterHTMLDiagnostics(
return filteredDiagnostics;
}

private LspDiagnostic[] MapDiagnostics(
internal LspDiagnostic[] MapDiagnostics(
RazorLanguageKind languageKind,
LspDiagnostic[] diagnostics,
IDocumentSnapshot documentSnapshot,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ ValueTask<ImmutableArray<LspDiagnostic>> GetTaskListDiagnosticsAsync(
JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo,
JsonSerializableDocumentId documentId,
ImmutableArray<string> taskListDescriptors,
LspDiagnostic[] csharpTaskItems,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LspDiagnostic[]

nit: Why not an ImmutableArray?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason, thats just what the diagnostic translate service takes, presumably because it works directly on a deserialized LSP response, and I carried it through. Is it worth changing, other than for consistency?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not worth changing, just consistency and a general appreciation for using ImmutableArrays when possible

CancellationToken cancellationToken);
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Collections.Immutable;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor.PooledObjects;
using Microsoft.CodeAnalysis.ExternalAccess.Razor;
using Microsoft.CodeAnalysis.Razor.Diagnostics;
using Microsoft.CodeAnalysis.Razor.Protocol;
Expand Down Expand Up @@ -56,20 +57,25 @@ public ValueTask<ImmutableArray<LspDiagnostic>> GetTaskListDiagnosticsAsync(
JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo,
JsonSerializableDocumentId documentId,
ImmutableArray<string> taskListDescriptors,
LspDiagnostic[] csharpTaskItems,
CancellationToken cancellationToken)
=> RunServiceAsync(
solutionInfo,
documentId,
context => GetTaskListDiagnosticsAsync(context, taskListDescriptors, cancellationToken),
context => GetTaskListDiagnosticsAsync(context, taskListDescriptors, csharpTaskItems, cancellationToken),
cancellationToken);

private static async ValueTask<ImmutableArray<LspDiagnostic>> GetTaskListDiagnosticsAsync(
private async ValueTask<ImmutableArray<LspDiagnostic>> GetTaskListDiagnosticsAsync(
RemoteDocumentContext context,
ImmutableArray<string> taskListDescriptors,
LspDiagnostic[] csharpTaskItems,
CancellationToken cancellationToken)
{
var codeDocument = await context.GetCodeDocumentAsync(cancellationToken).ConfigureAwait(false);

return TaskListDiagnosticProvider.GetTaskListDiagnostics(codeDocument, taskListDescriptors);
using var diagnostics = new PooledArrayBuilder<LspDiagnostic>();
diagnostics.AddRange(TaskListDiagnosticProvider.GetTaskListDiagnostics(codeDocument, taskListDescriptors));
diagnostics.AddRange(_translateDiagnosticsService.MapDiagnostics(RazorLanguageKind.CSharp, csharpTaskItems, context.Snapshot, codeDocument));
return diagnostics.ToImmutableAndClear();
}
}
Loading