Skip to content

Commit 599c637

Browse files
authored
Simply cohosting generated document Uri code (#11583)
Part of #10693 Clean up from a previous PR that was waiting for a Roslyn insertion
2 parents c48a1b0 + 398c55e commit 599c637

File tree

6 files changed

+74
-72
lines changed

6 files changed

+74
-72
lines changed

Directory.Packages.props

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
-->
77
<PropertyGroup>
88
<_MicrosoftWebToolsPackageVersion>17.11.11-preview-0001</_MicrosoftWebToolsPackageVersion>
9-
<_MicrosoftVisualStudioShellPackagesVersion>17.12.39557-preview.2.1</_MicrosoftVisualStudioShellPackagesVersion>
10-
<_MicrosoftVisualStudioPackagesVersion>17.12.145-preview</_MicrosoftVisualStudioPackagesVersion>
9+
<_MicrosoftVisualStudioShellPackagesVersion>17.13.40008</_MicrosoftVisualStudioShellPackagesVersion>
10+
<_MicrosoftVisualStudioPackagesVersion>17.13.226</_MicrosoftVisualStudioPackagesVersion>
1111
<_VisualStudioLanguageServerProtocolVersion>17.12.1-preview</_VisualStudioLanguageServerProtocolVersion>
1212
<_MicrosoftExtensionsPackageVersion>8.0.0</_MicrosoftExtensionsPackageVersion>
1313
<_BasicReferenceAssembliesVersion>1.7.2</_BasicReferenceAssembliesVersion>
@@ -17,7 +17,7 @@
1717
<_RoslynDiagnosticAnalyzersPackageVersion>3.11.0-beta1.24508.2</_RoslynDiagnosticAnalyzersPackageVersion>
1818
<_MicrosoftVisualStudioLanguageServicesPackageVersion>$(MicrosoftVisualStudioLanguageServicesPackageVersion)</_MicrosoftVisualStudioLanguageServicesPackageVersion>
1919
<_XunitPackageVersion>2.9.2</_XunitPackageVersion>
20-
<_MicrosoftBuildPackageVersion>17.12.0-preview-24426-07</_MicrosoftBuildPackageVersion>
20+
<_MicrosoftBuildPackageVersion>17.13.9</_MicrosoftBuildPackageVersion>
2121
</PropertyGroup>
2222

2323
<ItemGroup>
@@ -27,7 +27,7 @@
2727
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="$(_BenchmarkDotNetPackageVersion)" />
2828
<PackageVersion Include="DiffPlex" Version="1.7.2" />
2929
<PackageVersion Include="FluentAssertions" Version="6.7.0" />
30-
<PackageVersion Include="MessagePack" Version="2.5.187" />
30+
<PackageVersion Include="MessagePack" Version="2.5.192" />
3131
<PackageVersion Include="Microsoft.AspNetCore.App.Runtime.$(NetCoreSDKRuntimeIdentifier)" Version="8.0.2" />
3232
<PackageVersion Include="Microsoft.Build.Framework" Version="$(_MicrosoftBuildPackageVersion)" />
3333
<PackageVersion Include="Microsoft.Build.Locator" Version="1.4.1" />
@@ -84,14 +84,14 @@
8484
<PackageVersion Include="Microsoft.VisualStudio.LanguageServices.Implementation.Symbols" Version="$(_MicrosoftVisualStudioLanguageServicesPackageVersion)" />
8585
<PackageVersion Include="Microsoft.VisualStudio.LiveShare" Version="0.3.1074" />
8686
<PackageVersion Include="Microsoft.VisualStudio.ProjectSystem.SDK" Version="17.7.294-pre" />
87-
<PackageVersion Include="Microsoft.VisualStudio.RpcContracts" Version="17.12.11-preview" />
87+
<PackageVersion Include="Microsoft.VisualStudio.RpcContracts" Version="17.13.7" />
8888
<PackageVersion Include="Microsoft.VisualStudio.Shell.Framework" Version="$(_MicrosoftVisualStudioShellPackagesVersion)" />
8989
<PackageVersion Include="Microsoft.VisualStudio.Shell.15.0" Version="$(_MicrosoftVisualStudioShellPackagesVersion)" />
9090
<PackageVersion Include="Microsoft.VisualStudio.Telemetry" Version="17.14.2" />
9191
<PackageVersion Include="Microsoft.VisualStudio.Text.Data" Version="$(_MicrosoftVisualStudioPackagesVersion)" />
9292
<PackageVersion Include="Microsoft.VisualStudio.Text.Implementation" Version="$(_MicrosoftVisualStudioPackagesVersion)" NoWarn="NU1701" />
9393
<PackageVersion Include="Microsoft.VisualStudio.Text.Logic" Version="$(_MicrosoftVisualStudioPackagesVersion)" />
94-
<PackageVersion Include="Microsoft.VisualStudio.Threading" Version="17.12.13-preview" />
94+
<PackageVersion Include="Microsoft.VisualStudio.Threading" Version="17.13.2" />
9595
<PackageVersion Include="Microsoft.VisualStudio.Validation" Version="17.8.8" />
9696
<PackageVersion Include="Microsoft.VisualStudio.Web" Version="16.10.0-preview-1-31008-014" />
9797
<PackageVersion Include="Microsoft.WebTools.Languages.Html" Version="$(_MicrosoftWebToolsPackageVersion)" />

eng/Version.Details.xml

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,82 +11,82 @@
1111
<Sha>9c8e3885e783e984a48ed3585ff51d86b020d7ce</Sha>
1212
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
1313
</Dependency>
14-
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.14.0-1.25071.1">
14+
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.14.0-3.25128.2">
1515
<Uri>https://github.com/dotnet/roslyn</Uri>
16-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
16+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
1717
</Dependency>
18-
<Dependency Name="Microsoft.CommonLanguageServerProtocol.Framework" Version="4.14.0-1.25071.1">
18+
<Dependency Name="Microsoft.CommonLanguageServerProtocol.Framework" Version="4.14.0-3.25128.2">
1919
<Uri>https://github.com/dotnet/roslyn</Uri>
20-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
20+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
2121
</Dependency>
22-
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor" Version="4.14.0-1.25071.1">
22+
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor" Version="4.14.0-3.25128.2">
2323
<Uri>https://github.com/dotnet/roslyn</Uri>
24-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
24+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
2525
</Dependency>
26-
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="4.14.0-1.25071.1">
26+
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="4.14.0-3.25128.2">
2727
<Uri>https://github.com/dotnet/roslyn</Uri>
28-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
28+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
2929
</Dependency>
30-
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.14.0-1.25071.1">
30+
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.14.0-3.25128.2">
3131
<Uri>https://github.com/dotnet/roslyn</Uri>
32-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
32+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
3333
</Dependency>
34-
<Dependency Name="Microsoft.CodeAnalysis.CSharp.EditorFeatures" Version="4.14.0-1.25071.1">
34+
<Dependency Name="Microsoft.CodeAnalysis.CSharp.EditorFeatures" Version="4.14.0-3.25128.2">
3535
<Uri>https://github.com/dotnet/roslyn</Uri>
36-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
36+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
3737
</Dependency>
38-
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Features" Version="4.14.0-1.25071.1">
38+
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Features" Version="4.14.0-3.25128.2">
3939
<Uri>https://github.com/dotnet/roslyn</Uri>
40-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
40+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
4141
</Dependency>
42-
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0-1.25071.1">
42+
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.14.0-3.25128.2">
4343
<Uri>https://github.com/dotnet/roslyn</Uri>
44-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
44+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
4545
</Dependency>
46-
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures" Version="4.14.0-1.25071.1">
46+
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures" Version="4.14.0-3.25128.2">
4747
<Uri>https://github.com/dotnet/roslyn</Uri>
48-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
48+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
4949
</Dependency>
50-
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Common" Version="4.14.0-1.25071.1">
50+
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Common" Version="4.14.0-3.25128.2">
5151
<Uri>https://github.com/dotnet/roslyn</Uri>
52-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
52+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
5353
</Dependency>
54-
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="4.14.0-1.25071.1">
54+
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="4.14.0-3.25128.2">
5555
<Uri>https://github.com/dotnet/roslyn</Uri>
56-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
56+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
5757
</Dependency>
58-
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Wpf" Version="4.14.0-1.25071.1">
58+
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Wpf" Version="4.14.0-3.25128.2">
5959
<Uri>https://github.com/dotnet/roslyn</Uri>
60-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
60+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
6161
</Dependency>
62-
<Dependency Name="Microsoft.CodeAnalysis.Remote.ServiceHub" Version="4.14.0-1.25071.1">
62+
<Dependency Name="Microsoft.CodeAnalysis.Remote.ServiceHub" Version="4.14.0-3.25128.2">
6363
<Uri>https://github.com/dotnet/roslyn</Uri>
64-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
64+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
6565
</Dependency>
66-
<Dependency Name="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="4.14.0-1.25071.1">
66+
<Dependency Name="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="4.14.0-3.25128.2">
6767
<Uri>https://github.com/dotnet/roslyn</Uri>
68-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
68+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
6969
</Dependency>
70-
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.14.0-1.25071.1">
70+
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.14.0-3.25128.2">
7171
<Uri>https://github.com/dotnet/roslyn</Uri>
72-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
72+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
7373
</Dependency>
74-
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.14.0-1.25071.1">
74+
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.14.0-3.25128.2">
7575
<Uri>https://github.com/dotnet/roslyn</Uri>
76-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
76+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
7777
</Dependency>
78-
<Dependency Name="Microsoft.VisualStudio.LanguageServices" Version="4.14.0-1.25071.1">
78+
<Dependency Name="Microsoft.VisualStudio.LanguageServices" Version="4.14.0-3.25128.2">
7979
<Uri>https://github.com/dotnet/roslyn</Uri>
80-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
80+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
8181
</Dependency>
82-
<Dependency Name="Microsoft.CodeAnalysis.Test.Utilities" Version="4.14.0-1.25071.1">
82+
<Dependency Name="Microsoft.CodeAnalysis.Test.Utilities" Version="4.14.0-3.25128.2">
8383
<Uri>https://github.com/dotnet/roslyn</Uri>
84-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
84+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
8585
</Dependency>
8686
<!-- Intermediate is necessary for source build. -->
87-
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.14.0-1.25071.1">
87+
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.14.0-3.25128.2">
8888
<Uri>https://github.com/dotnet/roslyn</Uri>
89-
<Sha>5970c1a8588cc6bac346d9ad3eebb41321713ab0</Sha>
89+
<Sha>b531abfbc6e526397562a8d906087e1577f796a1</Sha>
9090
<SourceBuild RepoName="roslyn" ManagedOnly="true" />
9191
</Dependency>
9292
</ProductDependencies>

eng/Versions.props

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,25 @@
5353
<MicrosoftSourceBuildIntermediatearcadePackageVersion>9.0.0-beta.25111.5</MicrosoftSourceBuildIntermediatearcadePackageVersion>
5454
<MicrosoftDotNetXliffTasksPackageVersion>1.0.0-beta.23475.1</MicrosoftDotNetXliffTasksPackageVersion>
5555
<MicrosoftSourceBuildIntermediatexlifftasksPackageVersion>1.0.0-beta.23475.1</MicrosoftSourceBuildIntermediatexlifftasksPackageVersion>
56-
<MicrosoftNetCompilersToolsetPackageVersion>4.14.0-1.25071.1</MicrosoftNetCompilersToolsetPackageVersion>
57-
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>4.14.0-1.25071.1</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
58-
<MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>4.14.0-1.25071.1</MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>
59-
<MicrosoftCodeAnalysisCommonPackageVersion>4.14.0-1.25071.1</MicrosoftCodeAnalysisCommonPackageVersion>
60-
<MicrosoftCodeAnalysisCSharpPackageVersion>4.14.0-1.25071.1</MicrosoftCodeAnalysisCSharpPackageVersion>
61-
<MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>4.14.0-1.25071.1</MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>
62-
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>4.14.0-1.25071.1</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
63-
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>4.14.0-1.25071.1</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
64-
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>4.14.0-1.25071.1</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
65-
<MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>4.14.0-1.25071.1</MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>
66-
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>4.14.0-1.25071.1</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
67-
<MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>4.14.0-1.25071.1</MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>
68-
<MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>4.14.0-1.25071.1</MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>
69-
<MicrosoftCodeAnalysisTestUtilitiesPackageVersion>4.14.0-1.25071.1</MicrosoftCodeAnalysisTestUtilitiesPackageVersion>
70-
<MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>4.14.0-1.25071.1</MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>
71-
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>4.14.0-1.25071.1</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
72-
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>4.14.0-1.25071.1</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
73-
<MicrosoftSourceBuildIntermediateroslynPackageVersion>4.14.0-1.25071.1</MicrosoftSourceBuildIntermediateroslynPackageVersion>
74-
<MicrosoftVisualStudioLanguageServicesPackageVersion>4.14.0-1.25071.1</MicrosoftVisualStudioLanguageServicesPackageVersion>
56+
<MicrosoftNetCompilersToolsetPackageVersion>4.14.0-3.25128.2</MicrosoftNetCompilersToolsetPackageVersion>
57+
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>4.14.0-3.25128.2</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
58+
<MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>
59+
<MicrosoftCodeAnalysisCommonPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisCommonPackageVersion>
60+
<MicrosoftCodeAnalysisCSharpPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisCSharpPackageVersion>
61+
<MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>
62+
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
63+
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
64+
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
65+
<MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>
66+
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
67+
<MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>
68+
<MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>
69+
<MicrosoftCodeAnalysisTestUtilitiesPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisTestUtilitiesPackageVersion>
70+
<MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>
71+
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
72+
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>4.14.0-3.25128.2</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
73+
<MicrosoftSourceBuildIntermediateroslynPackageVersion>4.14.0-3.25128.2</MicrosoftSourceBuildIntermediateroslynPackageVersion>
74+
<MicrosoftVisualStudioLanguageServicesPackageVersion>4.14.0-3.25128.2</MicrosoftVisualStudioLanguageServicesPackageVersion>
7575
<!--
7676
Exception - Microsoft.Extensions.ObjectPool and System.Collections.Immutable packages are not updated by automation,
7777
but are present in Version.Details.xml for source-build PVP flow. See the comment in Version.Details.xml for more information.

src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Extensions/ProjectExtensions.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,15 @@ public static bool TryGetCSharpDocument(this Project project, Uri csharpDocument
5656
/// <summary>
5757
/// Finds source generated documents by iterating through all of them. In OOP there are better options!
5858
/// </summary>
59-
public static async Task<string?> TryGetHintNameFromGeneratedDocumentUriAsync(this Project project, Uri generatedDocumentUri, CancellationToken cancellationToken)
59+
public static bool TryGetHintNameFromGeneratedDocumentUri(this Project project, Uri generatedDocumentUri, [NotNullWhen(true)] out string? hintName)
6060
{
61-
// TODO: Call SourceGeneratedDocumentUri.DeserializeIdentity: https://github.com/dotnet/razor/issues/11557
61+
if (!RazorUri.IsGeneratedDocumentUri(generatedDocumentUri))
62+
{
63+
hintName = null;
64+
return false;
65+
}
6266

63-
var generatedDocuments = await project.GetSourceGeneratedDocumentsAsync(cancellationToken).ConfigureAwait(false);
64-
var document = generatedDocuments.SingleOrDefault(d => generatedDocumentUri.Equals(d.CreateUri()));
65-
return document?.HintName;
67+
hintName = RazorUri.GetHintNameFromGeneratedDocumentUri(project.Solution, generatedDocumentUri);
68+
return true;
6669
}
6770
}

src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/ProjectSystem/RemoteProjectSnapshot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public bool TryGetDocument(string filePath, [NotNullWhen(true)] out IDocumentSna
186186

187187
public async Task<RazorCodeDocument?> TryGetCodeDocumentFromGeneratedDocumentUriAsync(Uri generatedDocumentUri, CancellationToken cancellationToken)
188188
{
189-
if (await _project.TryGetHintNameFromGeneratedDocumentUriAsync(generatedDocumentUri, cancellationToken).ConfigureAwait(false) is not { } hintName)
189+
if (!_project.TryGetHintNameFromGeneratedDocumentUri(generatedDocumentUri, out var hintName))
190190
{
191191
return null;
192192
}

src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor/RemoteFilePathService.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System;
55
using System.Composition;
6+
using Microsoft.CodeAnalysis.ExternalAccess.Razor;
67
using Microsoft.CodeAnalysis.Razor.Workspaces;
78

89
namespace Microsoft.CodeAnalysis.Remote.Razor;
@@ -22,7 +23,5 @@ public override Uri GetRazorDocumentUri(Uri virtualDocumentUri)
2223
}
2324

2425
public override bool IsVirtualCSharpFile(Uri uri)
25-
{
26-
return uri.Scheme == "roslyn-source-generated";
27-
}
26+
=> RazorUri.IsGeneratedDocumentUri(uri);
2827
}

0 commit comments

Comments
 (0)