You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MIcrosoft.VisualStudio.LanguageServerClient.Razor has a dependency on MIcrosoft.AspNetCore.Razor.LanguageServer. This needs to be removed, which will require refactoring code to push it into the shared Workspaces layer.
Find or create analyzer to only allow hosting types in MS.ANC.Razor.LanguageServer to be referenced externally.
Fixes#10096
`Microsoft.VisualStudio.Razor.LanguageServerClient` has a reference to
`Microsoft.AspNetCore.Razor.LanguageServer` along with
`InternalsVisibleTo` access. This is unavoidable because we currently
run the LanguageServer in-proc in VS when the LSP editor is active.
However, over time `LanguageServerClient` has relied on more and more
code in `LanguageServer`, which can cause `MS.ANC.Razor.LanguageServer`
to be loaded in VS when it shouldn't be. This change addresses this
issue by limiting the types that `LanguageServerClient` has access to.
Access is restricted using the `RestrictedInternalsVisibleToAttribute`,
which is already supported by
`Microsoft.CodeAnalysis.CSharp.BannedApiAnalyzers`. Other than adding
our own copy of this attribute and updating the `AssemblyInfo.cs` for
`MS.ANC.Razor.LanguageServer`, this change is entirely mechanical.
Essentially, I've just moved types around, and those types fall into two
categories:
1. Types that are needed to host the language server. These have been
moved to a `Microsoft.AspNetCore.Razor.LanguageServer.Hosting`
namespace, and IVT is restricted to that namespace.
2. Protocol types that are needed by both the client and server. These
have been moved to `MS.CA.Razor.Workspaces` and organized in a
`Protocol` folder.
MIcrosoft.VisualStudio.LanguageServerClient.Razor
has a dependency onMIcrosoft.AspNetCore.Razor.LanguageServer
. This needs to be removed, which will require refactoring code to push it into the sharedWorkspaces
layer.MS.ANC.Razor.LanguageServer
to be referenced externally.The text was updated successfully, but these errors were encountered: