Skip to content

Comments

Improve server initialization and error handling#8982

Merged
dibarbet merged 3 commits intodotnet:mainfrom
dibarbet:improve_lsp_server_initialization
Feb 18, 2026
Merged

Improve server initialization and error handling#8982
dibarbet merged 3 commits intodotnet:mainfrom
dibarbet:improve_lsp_server_initialization

Conversation

@dibarbet
Copy link
Member

@dibarbet dibarbet commented Feb 11, 2026

Paired with dotnet/roslyn#82376

This came up as part of the overall C#DK reliability effort. Currently the experience in the editor when the language server fails isn't great. A couple issues:

  1. If the language server crashes, depending on the kind of error we do not always display a notification to the user, and its only visible in logs.
  2. If the language server crashes, the user gets spammed with meaningless notifications that have no actionable items

This PR does a few things

  1. Switch to using the built-in support for LSP processes using named pipes. Previously we had our own support to handle a named pipe connection between the client and server. This required us to manage the process ourselves. However, VSCode LSP client has built in pipe support which we can easily utilize, and remove a bunch of our custom logic around pipe connections and process management. We can delegate all of that to VSCode, which knows how to handle process crashes, killing the process, etc etc.
  2. De-duplicated toasts on crash. The built in notifications created by the VSCode LSP client when things fail often overreport failures. For example, on a crash it reports errors due to the process going away, errors due to the stream closing, and errors for indivdual requests failing. The LSP client library however allows us to customize this so we can ensure we get a single notification instead of 3+.
  3. Added actions to the error toasts - they now have report issue buttons which open our issue reporter with logs pre-filled. Server crashes can trigger a restart of extensions (temporary, to be deleted once we do rehydrate support).
  4. Deleted intellicode support

@dibarbet dibarbet force-pushed the improve_lsp_server_initialization branch 2 times, most recently from b660f86 to 937e211 Compare February 11, 2026 22:30
@dibarbet dibarbet changed the title WIP. Improve server initialization and error handling Feb 11, 2026
@dibarbet dibarbet force-pushed the improve_lsp_server_initialization branch from 937e211 to 5d50a4c Compare February 12, 2026 00:17
return args;
}

private static async getCSharpDevkitIntelliCodeExportArgs(
Copy link
Member

Choose a reason for hiding this comment

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

love it

dibarbet added a commit to dotnet/roslyn that referenced this pull request Feb 17, 2026
…82376)

This has a few miscellaneous changes to improve process lifecycle stuff.

1. Update the support for named pipe as a process argument (LSP spec
details -
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#implementationConsiderations)
to work better with the VSCode client
2. Ensure service broker bridge cancels properly if we need to stop the
process on our side to prevent lingering processes
3. Ensure the process reports errors when we encounter an exception in
the LSP queue that takes down the server. Previously the process would
cleanly exit even if we decided to shutdown due to an issue in the LSP
queue loop.

Needs to be paired with
dotnet/vscode-csharp#8982
@dibarbet dibarbet force-pushed the improve_lsp_server_initialization branch from 5d50a4c to a70fe70 Compare February 18, 2026 01:07
@dibarbet dibarbet marked this pull request as ready for review February 18, 2026 04:27
@dibarbet dibarbet requested a review from a team as a code owner February 18, 2026 04:27
@dibarbet dibarbet enabled auto-merge February 18, 2026 17:50
@dibarbet dibarbet merged commit 4971243 into dotnet:main Feb 18, 2026
34 checks passed
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.

2 participants