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
8 changes: 4 additions & 4 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
-->
<PropertyGroup>
<_MicrosoftWebToolsPackageVersion>17.11.11-preview-0001</_MicrosoftWebToolsPackageVersion>
<_MicrosoftVisualStudioShellPackagesVersion>18.0.2101-preview.1</_MicrosoftVisualStudioShellPackagesVersion>
<_MicrosoftVisualStudioPackagesVersion>18.0.332-preview</_MicrosoftVisualStudioPackagesVersion>
<_MicrosoftVisualStudioShellPackagesVersion>18.0.2188-preview.1</_MicrosoftVisualStudioShellPackagesVersion>
<_MicrosoftVisualStudioPackagesVersion>18.0.404-preview</_MicrosoftVisualStudioPackagesVersion>
<_VisualStudioLanguageServerProtocolVersion>17.12.1-preview</_VisualStudioLanguageServerProtocolVersion>
<_MicrosoftExtensionsPackageVersion>9.0.0</_MicrosoftExtensionsPackageVersion>
<_BasicReferenceAssembliesVersion>1.7.2</_BasicReferenceAssembliesVersion>
<_BenchmarkDotNetPackageVersion>0.13.5.2136</_BenchmarkDotNetPackageVersion>
<_MicrosoftVisualStudioExtensibilityTestingVersion>0.1.800-beta</_MicrosoftVisualStudioExtensibilityTestingVersion>
<_MicrosoftVisualStudioLanguageServicesPackageVersion>$(MicrosoftVisualStudioLanguageServicesPackageVersion)</_MicrosoftVisualStudioLanguageServicesPackageVersion>
<_XunitPackageVersion>2.9.2</_XunitPackageVersion>
<_MicrosoftBuildPackageVersion>17.15.0-preview-25353-11</_MicrosoftBuildPackageVersion>
<_MicrosoftBuildPackageVersion>17.15.0-preview-25357-08</_MicrosoftBuildPackageVersion>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -86,7 +86,7 @@
<PackageVersion Include="Microsoft.VisualStudio.Text.Data" Version="$(_MicrosoftVisualStudioPackagesVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Text.Implementation" Version="$(_MicrosoftVisualStudioPackagesVersion)" NoWarn="NU1701" />
<PackageVersion Include="Microsoft.VisualStudio.Text.Logic" Version="$(_MicrosoftVisualStudioPackagesVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Threading" Version="17.15.20-alpha" />
<PackageVersion Include="Microsoft.VisualStudio.Threading" Version="17.15.22-alpha" />
<PackageVersion Include="Microsoft.VisualStudio.Validation" Version="17.8.8" />
<PackageVersion Include="Microsoft.VisualStudio.Web" Version="16.10.0-preview-1-31008-014" />
<PackageVersion Include="Microsoft.WebTools.Languages.Html" Version="$(_MicrosoftWebToolsPackageVersion)" />
Expand Down
44 changes: 22 additions & 22 deletions eng/Version.Details.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ This file should be imported by eng/Versions.props
<Project>
<PropertyGroup>
<!-- dotnet/roslyn dependencies -->
<MicrosoftCodeAnalysisAnalyzersPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisAnalyzersPackageVersion>
<MicrosoftCodeAnalysisCommonPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisCommonPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
<MicrosoftCodeAnalysisExternalAccessFSharpPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisExternalAccessFSharpPackageVersion>
<MicrosoftCodeAnalysisExternalAccessRazorEditorFeaturesPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisExternalAccessRazorEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisExternalAccessRazorFeaturesPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisExternalAccessRazorFeaturesPackageVersion>
<MicrosoftCodeAnalysisLanguageServerProtocolPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisLanguageServerProtocolPackageVersion>
<MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>
<MicrosoftCodeAnalysisTestUtilitiesPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisTestUtilitiesPackageVersion>
<MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>5.3.0-2.25601.4</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>5.3.0-2.25601.4</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
<MicrosoftNetCompilersToolsetPackageVersion>5.3.0-2.25601.4</MicrosoftNetCompilersToolsetPackageVersion>
<MicrosoftVisualStudioLanguageServicesPackageVersion>5.3.0-2.25601.4</MicrosoftVisualStudioLanguageServicesPackageVersion>
<RoslynDiagnosticsAnalyzersPackageVersion>5.3.0-2.25601.4</RoslynDiagnosticsAnalyzersPackageVersion>
<MicrosoftCodeAnalysisAnalyzersPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisAnalyzersPackageVersion>
<MicrosoftCodeAnalysisCommonPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisCommonPackageVersion>
<MicrosoftCodeAnalysisCSharpPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisCSharpPackageVersion>
<MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
<MicrosoftCodeAnalysisExternalAccessFSharpPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisExternalAccessFSharpPackageVersion>
<MicrosoftCodeAnalysisExternalAccessRazorEditorFeaturesPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisExternalAccessRazorEditorFeaturesPackageVersion>
<MicrosoftCodeAnalysisExternalAccessRazorFeaturesPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisExternalAccessRazorFeaturesPackageVersion>
<MicrosoftCodeAnalysisLanguageServerProtocolPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisLanguageServerProtocolPackageVersion>
<MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>
<MicrosoftCodeAnalysisTestUtilitiesPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisTestUtilitiesPackageVersion>
<MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>5.3.0-2.25630.5</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>5.3.0-2.25630.5</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
<MicrosoftNetCompilersToolsetPackageVersion>5.3.0-2.25630.5</MicrosoftNetCompilersToolsetPackageVersion>
<MicrosoftVisualStudioLanguageServicesPackageVersion>5.3.0-2.25630.5</MicrosoftVisualStudioLanguageServicesPackageVersion>
<RoslynDiagnosticsAnalyzersPackageVersion>5.3.0-2.25630.5</RoslynDiagnosticsAnalyzersPackageVersion>
<!-- dotnet/arcade dependencies -->
<MicrosoftDotNetArcadeSdkPackageVersion>10.0.0-beta.25626.5</MicrosoftDotNetArcadeSdkPackageVersion>
<!-- dotnet/aspnetcore dependencies -->
Expand Down
88 changes: 44 additions & 44 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,93 +2,93 @@
<Dependencies>
<Source Uri="https://github.com/dotnet/dotnet" Mapping="razor" Sha="5a69737e6f6447fe397d552503a3909ea49f6f34" BarId="293565" />
<ProductDependencies>
<Dependency Name="Roslyn.Diagnostics.Analyzers" Version="5.3.0-2.25601.4">
<Dependency Name="Roslyn.Diagnostics.Analyzers" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CommonLanguageServerProtocol.Framework" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CommonLanguageServerProtocol.Framework" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp.EditorFeatures" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.CSharp.EditorFeatures" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Features" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Features" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Common" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Common" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Remote.ServiceHub" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.Remote.ServiceHub" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.Common" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.Common" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.VisualStudio.LanguageServices" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.VisualStudio.LanguageServices" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Test.Utilities" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.Test.Utilities" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor.Features" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor.Features" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor.EditorFeatures" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor.EditorFeatures" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.LanguageServer.Protocol" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.LanguageServer.Protocol" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.FSharp" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.FSharp" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="5.3.0-2.25601.4">
<Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="5.3.0-2.25630.5">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>a618d6246ead857f8c7de055bfde0f3438aa136a</Sha>
<Sha>635d2b812121ef9fafe0de223b09be64e5a4a291</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Composition;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Razor;
using Microsoft.AspNetCore.Razor.PooledObjects;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.ExternalAccess.Razor.Cohost;
Expand Down Expand Up @@ -79,8 +80,7 @@ public ImmutableArray<Registration> GetRegistrations(VSInternalClientCapabilitie
cancellationToken).ConfigureAwait(false);
}

var results = await GetDiagnosticsAsync(razorDocument, cancellationToken).ConfigureAwait(false);

var results = await GetVSDiagnosticsAsync(razorDocument, cancellationToken).ConfigureAwait(false);
if (results is null)
{
return null;
Expand All @@ -93,6 +93,37 @@ public ImmutableArray<Registration> GetRegistrations(VSInternalClientCapabilitie
}];
}

private async Task<LspDiagnostic[]?> GetVSDiagnosticsAsync(TextDocument razorDocument, CancellationToken cancellationToken)
{
var diagnostics = await GetDiagnosticsAsync(razorDocument, cancellationToken).ConfigureAwait(false);
if (diagnostics is null)
{
return null;
}

// We always use Roslyn's project understanding, and in VS the project Id is not necessarily the Id that is reported by Roslyn
// for diagnostics. Rather than try to replicate any of this behaviour directly, we just take Roslyn as the source of truth,
// and force the project information to match what it would produce, regardless of where it comes from or how we might have
// filtered or converted it.
var projectInfo = new[] { ExternalHandlers.Diagnostics.GetProjectInformation(razorDocument.Project) };

var results = new VSDiagnostic[diagnostics.Length];
for (var i = 0; i < diagnostics.Length; i++)
{
var vsDiagnostic = JsonHelpers.Convert<LspDiagnostic, VSDiagnostic>(diagnostics[i]).AssumeNotNull();
vsDiagnostic.Projects = projectInfo;

// Setting a unique identifier ensures that VS will show project info in the error list, and things like the "Current Project"
// filter will work. Putting the Razor file path in the identifier ensures that files in multiple projects get their diagnostics
// de-duped.
vsDiagnostic.Identifier = (vsDiagnostic.Code, razorDocument.FilePath, vsDiagnostic.Range, vsDiagnostic.Message).GetHashCode().ToString();

results[i] = vsDiagnostic;
}

return results;
}

protected override VSInternalDocumentDiagnosticsParams CreateHtmlParams(Uri uri)
{
return new VSInternalDocumentDiagnosticsParams
Expand Down Expand Up @@ -157,7 +188,7 @@ private async Task<LspDiagnostic[]> GetCSharpTaskListItemsAsync(TextDocument raz
internal readonly struct TestAccessor(CohostDocumentPullDiagnosticsEndpoint instance)
{
public Task<LspDiagnostic[]?> HandleRequestAsync(TextDocument razorDocument, CancellationToken cancellationToken)
=> instance.GetDiagnosticsAsync(razorDocument, cancellationToken);
=> instance.GetVSDiagnosticsAsync(razorDocument, cancellationToken);

public Task<VSInternalDiagnosticReport[]> HandleTaskListItemRequestAsync(TextDocument razorDocument, ImmutableArray<string> taskListDescriptors, CancellationToken cancellationToken)
=> instance.HandleTaskListItemRequestAsync(razorDocument, taskListDescriptors, cancellationToken);
Expand Down
Loading
Loading