Skip to content

Commit db3fecf

Browse files
authored
Support FAR in cohosting (#11238)
Fixes #11237 Needs dotnet/roslyn#76002 and a version bump Very simple one, though I was a little cheeky. There is basically no code that could be shared, except for code that removes `__o` and `k_BackingField` from the results, but those methods operate on VS LSP types. Given cohosting largely uses Roslyn LSP types, and will be exclusively FUSE, and FUSE doesn't have `__o`, I just skipped that bit. Confirmed in VS that having cohosting and FUSE on makes for nice looking results with no generated code artifacts. Side note: I don't think anything will ever have `k_BackingField` in the results, but there is zero test coverage so who knows! 😁
2 parents 5f32f26 + 973553f commit db3fecf

File tree

9 files changed

+520
-58
lines changed

9 files changed

+520
-58
lines changed

eng/Version.Details.xml

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,82 +11,82 @@
1111
<Sha>ef10a9fae360251bdd4b7552a4c90bf626977453</Sha>
1212
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
1313
</Dependency>
14-
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.13.0-2.24564.3">
14+
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.13.0-3.24576.11">
1515
<Uri>https://github.com/dotnet/roslyn</Uri>
16-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
16+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
1717
</Dependency>
18-
<Dependency Name="Microsoft.CommonLanguageServerProtocol.Framework" Version="4.13.0-2.24564.3">
18+
<Dependency Name="Microsoft.CommonLanguageServerProtocol.Framework" Version="4.13.0-3.24576.11">
1919
<Uri>https://github.com/dotnet/roslyn</Uri>
20-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
20+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
2121
</Dependency>
22-
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor" Version="4.13.0-2.24564.3">
22+
<Dependency Name="Microsoft.CodeAnalysis.ExternalAccess.Razor" Version="4.13.0-3.24576.11">
2323
<Uri>https://github.com/dotnet/roslyn</Uri>
24-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
24+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
2525
</Dependency>
26-
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="4.13.0-2.24564.3">
26+
<Dependency Name="Microsoft.CodeAnalysis.Common" Version="4.13.0-3.24576.11">
2727
<Uri>https://github.com/dotnet/roslyn</Uri>
28-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
28+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
2929
</Dependency>
30-
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.13.0-2.24564.3">
30+
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.13.0-3.24576.11">
3131
<Uri>https://github.com/dotnet/roslyn</Uri>
32-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
32+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
3333
</Dependency>
34-
<Dependency Name="Microsoft.CodeAnalysis.CSharp.EditorFeatures" Version="4.13.0-2.24564.3">
34+
<Dependency Name="Microsoft.CodeAnalysis.CSharp.EditorFeatures" Version="4.13.0-3.24576.11">
3535
<Uri>https://github.com/dotnet/roslyn</Uri>
36-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
36+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
3737
</Dependency>
38-
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Features" Version="4.13.0-2.24564.3">
38+
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Features" Version="4.13.0-3.24576.11">
3939
<Uri>https://github.com/dotnet/roslyn</Uri>
40-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
40+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
4141
</Dependency>
42-
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.13.0-2.24564.3">
42+
<Dependency Name="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.13.0-3.24576.11">
4343
<Uri>https://github.com/dotnet/roslyn</Uri>
44-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
44+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
4545
</Dependency>
46-
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures" Version="4.13.0-2.24564.3">
46+
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures" Version="4.13.0-3.24576.11">
4747
<Uri>https://github.com/dotnet/roslyn</Uri>
48-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
48+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
4949
</Dependency>
50-
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Common" Version="4.13.0-2.24564.3">
50+
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Common" Version="4.13.0-3.24576.11">
5151
<Uri>https://github.com/dotnet/roslyn</Uri>
52-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
52+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
5353
</Dependency>
54-
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="4.13.0-2.24564.3">
54+
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Text" Version="4.13.0-3.24576.11">
5555
<Uri>https://github.com/dotnet/roslyn</Uri>
56-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
56+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
5757
</Dependency>
58-
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Wpf" Version="4.13.0-2.24564.3">
58+
<Dependency Name="Microsoft.CodeAnalysis.EditorFeatures.Wpf" Version="4.13.0-3.24576.11">
5959
<Uri>https://github.com/dotnet/roslyn</Uri>
60-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
60+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
6161
</Dependency>
62-
<Dependency Name="Microsoft.CodeAnalysis.Remote.ServiceHub" Version="4.13.0-2.24564.3">
62+
<Dependency Name="Microsoft.CodeAnalysis.Remote.ServiceHub" Version="4.13.0-3.24576.11">
6363
<Uri>https://github.com/dotnet/roslyn</Uri>
64-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
64+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
6565
</Dependency>
66-
<Dependency Name="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="4.13.0-2.24564.3">
66+
<Dependency Name="Microsoft.CodeAnalysis.VisualBasic.Workspaces" Version="4.13.0-3.24576.11">
6767
<Uri>https://github.com/dotnet/roslyn</Uri>
68-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
68+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
6969
</Dependency>
70-
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.13.0-2.24564.3">
70+
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.Common" Version="4.13.0-3.24576.11">
7171
<Uri>https://github.com/dotnet/roslyn</Uri>
72-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
72+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
7373
</Dependency>
74-
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.13.0-2.24564.3">
74+
<Dependency Name="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="4.13.0-3.24576.11">
7575
<Uri>https://github.com/dotnet/roslyn</Uri>
76-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
76+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
7777
</Dependency>
78-
<Dependency Name="Microsoft.VisualStudio.LanguageServices" Version="4.13.0-2.24564.3">
78+
<Dependency Name="Microsoft.VisualStudio.LanguageServices" Version="4.13.0-3.24576.11">
7979
<Uri>https://github.com/dotnet/roslyn</Uri>
80-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
80+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
8181
</Dependency>
82-
<Dependency Name="Microsoft.CodeAnalysis.Test.Utilities" Version="4.13.0-2.24564.3">
82+
<Dependency Name="Microsoft.CodeAnalysis.Test.Utilities" Version="4.13.0-3.24576.11">
8383
<Uri>https://github.com/dotnet/roslyn</Uri>
84-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
84+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</Sha>
8585
</Dependency>
8686
<!-- Intermediate is necessary for source build. -->
87-
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.13.0-2.24564.3">
87+
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.13.0-3.24576.11">
8888
<Uri>https://github.com/dotnet/roslyn</Uri>
89-
<Sha>826b0db12582b6b645ed1cf5e1565f767af31e53</Sha>
89+
<Sha>6f2ed01d1af9429d874aca1eea60d3212167bc40</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.24572.2</MicrosoftSourceBuildIntermediatearcadePackageVersion>
5454
<MicrosoftDotNetXliffTasksPackageVersion>1.0.0-beta.23475.1</MicrosoftDotNetXliffTasksPackageVersion>
5555
<MicrosoftSourceBuildIntermediatexlifftasksPackageVersion>1.0.0-beta.23475.1</MicrosoftSourceBuildIntermediatexlifftasksPackageVersion>
56-
<MicrosoftNetCompilersToolsetPackageVersion>4.13.0-2.24564.3</MicrosoftNetCompilersToolsetPackageVersion>
57-
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>4.13.0-2.24564.3</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
58-
<MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>
59-
<MicrosoftCodeAnalysisCommonPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisCommonPackageVersion>
60-
<MicrosoftCodeAnalysisCSharpPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisCSharpPackageVersion>
61-
<MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>
62-
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
63-
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
64-
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
65-
<MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>
66-
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
67-
<MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>
68-
<MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>
69-
<MicrosoftCodeAnalysisTestUtilitiesPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisTestUtilitiesPackageVersion>
70-
<MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>
71-
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
72-
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>4.13.0-2.24564.3</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
73-
<MicrosoftSourceBuildIntermediateroslynPackageVersion>4.13.0-2.24564.3</MicrosoftSourceBuildIntermediateroslynPackageVersion>
74-
<MicrosoftVisualStudioLanguageServicesPackageVersion>4.13.0-2.24564.3</MicrosoftVisualStudioLanguageServicesPackageVersion>
56+
<MicrosoftNetCompilersToolsetPackageVersion>4.13.0-3.24576.11</MicrosoftNetCompilersToolsetPackageVersion>
57+
<MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>4.13.0-3.24576.11</MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion>
58+
<MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>4.13.0-3.24576.11</MicrosoftCodeAnalysisExternalAccessRazorPackageVersion>
59+
<MicrosoftCodeAnalysisCommonPackageVersion>4.13.0-3.24576.11</MicrosoftCodeAnalysisCommonPackageVersion>
60+
<MicrosoftCodeAnalysisCSharpPackageVersion>4.13.0-3.24576.11</MicrosoftCodeAnalysisCSharpPackageVersion>
61+
<MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>4.13.0-3.24576.11</MicrosoftCodeAnalysisCSharpEditorFeaturesPackageVersion>
62+
<MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>4.13.0-3.24576.11</MicrosoftCodeAnalysisCSharpFeaturesPackageVersion>
63+
<MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>4.13.0-3.24576.11</MicrosoftCodeAnalysisCSharpWorkspacesPackageVersion>
64+
<MicrosoftCodeAnalysisEditorFeaturesPackageVersion>4.13.0-3.24576.11</MicrosoftCodeAnalysisEditorFeaturesPackageVersion>
65+
<MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>4.13.0-3.24576.11</MicrosoftCodeAnalysisEditorFeaturesCommonPackageVersion>
66+
<MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>4.13.0-3.24576.11</MicrosoftCodeAnalysisEditorFeaturesTextPackageVersion>
67+
<MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>4.13.0-3.24576.11</MicrosoftCodeAnalysisEditorFeaturesWpfPackageVersion>
68+
<MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>4.13.0-3.24576.11</MicrosoftCodeAnalysisRemoteServiceHubPackageVersion>
69+
<MicrosoftCodeAnalysisTestUtilitiesPackageVersion>4.13.0-3.24576.11</MicrosoftCodeAnalysisTestUtilitiesPackageVersion>
70+
<MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>4.13.0-3.24576.11</MicrosoftCodeAnalysisVisualBasicWorkspacesPackageVersion>
71+
<MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>4.13.0-3.24576.11</MicrosoftCodeAnalysisWorkspacesCommonPackageVersion>
72+
<MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>4.13.0-3.24576.11</MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion>
73+
<MicrosoftSourceBuildIntermediateroslynPackageVersion>4.13.0-3.24576.11</MicrosoftSourceBuildIntermediateroslynPackageVersion>
74+
<MicrosoftVisualStudioLanguageServicesPackageVersion>4.13.0-3.24576.11</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.

eng/targets/Services.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@
3636
<ServiceHubService Include="Microsoft.VisualStudio.Razor.Hover" ClassName="Microsoft.CodeAnalysis.Remote.Razor.RemoteHoverService+Factory" />
3737
<ServiceHubService Include="Microsoft.VisualStudio.Razor.Completion" ClassName="Microsoft.CodeAnalysis.Remote.Razor.RemoteCompletionService+Factory" />
3838
<ServiceHubService Include="Microsoft.VisualStudio.Razor.CodeActions" ClassName="Microsoft.CodeAnalysis.Remote.Razor.RemoteCodeActionsService+Factory" />
39+
<ServiceHubService Include="Microsoft.VisualStudio.Razor.FindAllReferences" ClassName="Microsoft.CodeAnalysis.Remote.Razor.RemoteFindAllReferencesService+Factory" />
3940
</ItemGroup>
4041
</Project>

src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/RazorLanguageServer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,14 +212,15 @@ static void AddHandlers(IServiceCollection services, LanguageServerFeatureOption
212212
services.AddHandler<ColorPresentationEndpoint>();
213213

214214
services.AddHandlerWithCapabilities<ProjectContextsEndpoint>();
215+
216+
services.AddHandlerWithCapabilities<FindAllReferencesEndpoint>();
215217
}
216218

217219
services.AddHandler<WrapWithTagEndpoint>();
218220
services.AddHandler<RazorBreakpointSpanEndpoint>();
219221
services.AddHandler<RazorProximityExpressionsEndpoint>();
220222

221223
services.AddHandlerWithCapabilities<ValidateBreakpointRangeEndpoint>();
222-
services.AddHandlerWithCapabilities<FindAllReferencesEndpoint>();
223224
services.AddHandlerWithCapabilities<MapCodeEndpoint>();
224225
}
225226
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the MIT license. See License.txt in the project root for license information.
3+
4+
using System.Threading;
5+
using System.Threading.Tasks;
6+
using Microsoft.CodeAnalysis.ExternalAccess.Razor;
7+
using Roslyn.LanguageServer.Protocol;
8+
using LspLocation = Roslyn.LanguageServer.Protocol.Location;
9+
10+
namespace Microsoft.CodeAnalysis.Razor.Remote;
11+
12+
internal interface IRemoteFindAllReferencesService : IRemoteJsonService
13+
{
14+
ValueTask<RemoteResponse<SumType<VSInternalReferenceItem, LspLocation>[]?>> FindAllReferencesAsync(
15+
JsonSerializableRazorPinnedSolutionInfoWrapper solutionInfo,
16+
JsonSerializableDocumentId razorDocumentId,
17+
Position position,
18+
CancellationToken cancellationToken);
19+
}

src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Remote/RazorServices.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ internal static class RazorServices
3939
(typeof(IRemoteDiagnosticsService), null),
4040
(typeof(IRemoteCompletionService), null),
4141
(typeof(IRemoteCodeActionsService), null),
42+
(typeof(IRemoteFindAllReferencesService), null),
4243
];
4344

4445
private const string ComponentName = "Razor";

0 commit comments

Comments
 (0)