Skip to content

Commit

Permalink
Prevent warnings from new IVTs from Roslyn (dotnet#11504)
Browse files Browse the repository at this point in the history
Response to dotnet/roslyn#74597 to pave the way
for dotnet#10682 once Web Tools inserts.

The break from the Roslyn change is not binary breaking, so no need for
dual insertion, and since this change doesn't break anything, we can get
this in now, and whenever we happen to bump Roslyn next, there should be
no build issues.
  • Loading branch information
davidwengier authored Feb 18, 2025
2 parents ae1fbc0 + 125102c commit 67db339
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="$(MicrosoftCodeAnalysisWorkspacesCommonPackageVersion)" />
<PackageVersion Include="Microsoft.CodeAnalysis.Workspaces.MSBuild" Version="$(MicrosoftCodeAnalysisWorkspacesMSBuildPackageVersion)" />
<PackageVersion Include="Microsoft.CommonLanguageServerProtocol.Framework" Version="$(MicrosoftCommonLanguageServerProtocolFrameworkPackageVersion)" PrivateAssets="all" />
<PackageVersion Include="Microsoft.CodeAnalysis.LanguageServer.Protocol" Version="$(MicrosoftCodeAnalysisExternalAccessRazorPackageVersion)" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.Css.Parser" Version="1.0.0-20230414.1" />
<PackageVersion Include="Microsoft.DiaSymReader" Version="2.0.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
<PackageReference Include="Microsoft.DiaSymReader" />

<PackageReference Include="Microsoft.CodeAnalysis.LanguageServer.Protocol" Aliases="RLSP" />
</ItemGroup>

<Import Project="..\..\..\Shared\Microsoft.AspNetCore.Razor.Serialization.Json\Microsoft.AspNetCore.Razor.Serialization.Json.projitems" Label="Shared" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@
Now we aren't sure why this exposes a "flaky" issue; however, to workaround the break we pin the following packages to workaround the issue.
-->
<PackageReference Include="Microsoft.VisualStudio.RpcContracts" />

<!--
Razor and Roslyn both use CLaSP as the basis for their language servers, but CLaSP is a source package
which means when we reference Roslyn's server to get the LSP protocol types (which we have a restricted
IVT to) we get ambiguous type errors for everything in CLaSP. To fix this we reference Roslyn with an
alias, and then have a global using for the LSP protocol types only.
-->
<PackageReference Include="Microsoft.CodeAnalysis.LanguageServer.Protocol" Aliases="RLSP" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,14 @@
<EmbeddedResource Include="Semantic\TestFiles\**\*" />
</ItemGroup>

<ItemGroup>
<!--
Razor and Roslyn both use CLaSP as the basis for their language servers, but CLaSP is a source package
which means when we reference Roslyn's server to get the LSP protocol types (which we have a restricted
IVT to) we get ambiguous type errors for everything in CLaSP. To fix this we reference Roslyn with an
alias, and then have a global using for the LSP protocol types only.
-->
<PackageReference Include="Microsoft.CodeAnalysis.LanguageServer.Protocol" Aliases="RLSP" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@
<PackageReference Include="xunit.extensibility.execution" />
<PackageReference Include="Xunit.Combinatorial" />
<PackageReference Include="Xunit.StaFact" />

<PackageReference Include="Microsoft.CodeAnalysis.LanguageServer.Protocol" Aliases="RLSP" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == '$(DefaultNetFxTargetFramework)'">
Expand Down

0 comments on commit 67db339

Please sign in to comment.