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

Update LanguageServerHost to use NamedPipeServerStream #69918

Merged
merged 3 commits into from
Sep 13, 2023

Conversation

beccamc
Copy link
Contributor

@beccamc beccamc commented Sep 12, 2023

Current communication between client and the Rolsyn language server is writing to STDOUT. This makes the connection vulnerable to any code in the process writing to stdout stream and corrupting the data.

We have seen at least one bug with this problem: microsoft/vscode-dotnettools#333

The fix it to use a named pipe to communicate.

  • Client (e.g. VS Code) will kick off this server process
  • Create the NamedPipeServerStream. Specify CurrentUserOnly flag , which indicates that the pipe can only be connected to a client created by the same user.
  • Pass the name of the pipe back to the client, who will connect
  • When the client connects, send the stream objects to Json-RPC

A note about names...

  • Unix-type systems use a file name to create the connection.
  • Windows systems use a pipe name. The format for the name is different in .NET code and Nodejs code.

This has been tested on both windows and mac.

Copy link
Member

@dibarbet dibarbet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly looks good! a couple of hopefully simple comments

@beccamc beccamc merged commit 54a85bc into dotnet:main Sep 13, 2023
24 checks passed
@ghost ghost added this to the Next milestone Sep 13, 2023
@Cosifne Cosifne modified the milestones: Next, 17.8 P3 Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants