Skip to content

Conversation

dibarbet
Copy link
Member

@dibarbet dibarbet commented Apr 4, 2025

came up in another discussion - currently the vscode lsp client displays a toast if server startup fails. In server startup we're awaiting devkit activation - so if devkit activation fails we get two overlapping toasts.

This change moves us to await devkit activation outside of the server startup path. If devkit fails, we rely on them to display an error.

@dibarbet dibarbet requested a review from a team as a code owner April 4, 2025 20:39
@dibarbet dibarbet force-pushed the dont_duplicate_toast branch from 1dbf02f to dfb6d65 Compare April 4, 2025 20:40
): Promise<RoslynLanguageServer> {
const devKit = getCSharpDevKit();
if (devKit) {
await devKit.activate();
Copy link
Contributor

Choose a reason for hiding this comment

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

Allowing the exception to propagate will still produce an error toast in VS Code. But I don't know... maybe it'll be smaller?

Copy link
Member Author

@dibarbet dibarbet Apr 4, 2025

Choose a reason for hiding this comment

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

This shouldn't show a toast as best as I can tell - this is in a promise that isn't awaited in activation and not part of a callback from vscode . We write an error, but with this change I haven't managed to get a toast to display in any of the editors - I only get a devkit toast. I did manage to get a toast from C# with the previous version however.

@dibarbet dibarbet merged commit 4f90194 into dotnet:main Apr 4, 2025
24 checks passed
@dibarbet
Copy link
Member Author

dibarbet commented Apr 4, 2025

/backport to prerelease

Copy link
Contributor

github-actions bot commented Apr 4, 2025

Started backporting to prerelease: https://github.com/dotnet/vscode-csharp/actions/runs/14274365309

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