From 03407bc9eee254969e4a2123de7aed2a58a97ee0 Mon Sep 17 00:00:00 2001 From: David Barbet Date: Mon, 14 Aug 2023 11:54:46 -0700 Subject: [PATCH] Only show toast when project load fails --- .../HostWorkspace/LanguageServerProjectSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectSystem.cs b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectSystem.cs index 92958777721ba..5bfa4cea7bdc6 100644 --- a/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectSystem.cs +++ b/src/Features/LanguageServer/Microsoft.CodeAnalysis.LanguageServer/HostWorkspace/LanguageServerProjectSystem.cs @@ -179,7 +179,7 @@ private async ValueTask LoadOrReloadProjectsAsync(ImmutableSegmentedList tasks.Add(Task.Run(async () => { var errorKind = await LoadOrReloadProjectAsync(projectPathToLoadOrReload, projectBuildManager, cancellationToken); - if (errorKind is not null) + if (errorKind is LSP.MessageType.Error) { // We should display a toast when the value of displayedToast is 0. This will also update the value to 1 meaning we won't send any more toasts. var shouldShowToast = Interlocked.CompareExchange(ref displayedToast, value: 1, comparand: 0) == 0;