Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move named pipe support #11206

Merged
merged 6 commits into from
Nov 13, 2024

Conversation

DustinCampbell
Copy link
Member

@DustinCampbell DustinCampbell commented Nov 13, 2024

Since the named pipe support is intended to only be used by RZLS, this change moves the support types into MS.ANC.Razor.LanguageServer and organizes them in a MS.ANC.Razor.LanguageServer.Hosting.NamedPipes namespace. In addition, I've moved a couple of IServiceCollection extension methods into the MS.ANC.Razor.LanguageServer.Hosting namespace to avoid opening up internals visible to access to the entire MS.ANC.Razor.LanguageServer.Extension namespace, even if it's just to RZLS. The goal of having RestrictedInternalsVisibleTo for the MS.ANC.Razor.LanguageServer.Hosting namespace is to control the exposed surface area of the language server. If something is needed by VS or RZLS, strongly consider whether it should just be added to the Hosting namespace to avoid unintentionally dependencies that might need to be detangled later.

Note: Once this is merged, I'll submit a PR to update the code pointer comment at https://github.com/dotnet/vscode-csharp/blob/eb38986a52a8be7221d0e466f7a25c98dcbd7825/src/razor/src/razorLanguageServerClient.ts#L228.

Since INamesPipeProjectInfoDriver is a contract between MS.ANC.Razor.LanguageServer and RZLS, it doesn't need to live in Razor.Workspaces. Instead, it should live in the language server's Hosting namespace.
I noticed a logging message that seemed to indicate an error rather than an informational message.
Since this is only used within the language server for named pipe support, it can live in the language server rather than Razor.Workspaces.
This change moves the necessary extension methods to the MS.ANC.Razor.LanguageServer.Hosting namespace to avoid needing to expose a larger namespace outside of the language server. RestrictedInternalsVisibleTo is a tool for controlling the implicit surface area of the language server, and we should add to that surface area judiciously.
This switches an incorrect usage of NotImplementedException to InvalidOperationException
@DustinCampbell DustinCampbell requested a review from a team as a code owner November 13, 2024 18:00
@DustinCampbell
Copy link
Member Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants