From c12ffa71ebfb0aab998f49564067446b1e95d853 Mon Sep 17 00:00:00 2001 From: tmat Date: Sun, 25 Feb 2024 10:52:42 -0800 Subject: [PATCH] Find usage message severity --- .../VSTypeScript/VSTypeScriptFindUsagesContext.cs | 2 +- .../VSTypeScript/VSTypeScriptFindUsagesService.cs | 2 +- .../Core/FindUsages/BufferedFindUsagesContext.cs | 13 +++++++------ .../GoToDefinition/AbstractGoToCommandHandler`2.cs | 5 +++-- ...ctFindUsagesService.DefinitionTrackingContext.cs | 9 +++++---- ...AbstractFindUsagesService_FindImplementations.cs | 4 ++-- .../AbstractFindUsagesService_FindReferences.cs | 2 +- .../Core/Portable/FindUsages/FindUsagesContext.cs | 5 +++-- .../Core/Portable/FindUsages/IFindUsagesContext.cs | 11 +++++------ .../Portable/FindUsages/IRemoteFindUsagesService.cs | 5 +++-- .../Portable/GoToBase/AbstractGoToBaseService.cs | 4 ++-- .../Features/FindUsages/SimpleFindUsagesContext.cs | 5 ++--- .../Editor/FindUsages/FSharpFindUsagesContext.cs | 2 +- .../AbstractTableDataSourceFindUsagesContext.cs | 7 ++++--- .../FindReferences/StreamingFindUsagesPresenter.cs | 11 +++++++++-- .../Services/FindUsages/RemoteFindUsagesService.cs | 5 +++-- 16 files changed, 52 insertions(+), 40 deletions(-) diff --git a/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptFindUsagesContext.cs b/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptFindUsagesContext.cs index 79d31c6465f03..fb303bfacba06 100644 --- a/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptFindUsagesContext.cs +++ b/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptFindUsagesContext.cs @@ -17,7 +17,7 @@ public IVSTypeScriptStreamingProgressTracker ProgressTracker => new VSTypeScriptStreamingProgressTracker(UnderlyingObject.ProgressTracker); public ValueTask ReportMessageAsync(string message, CancellationToken cancellationToken) - => UnderlyingObject.ReportMessageAsync(message, cancellationToken); + => UnderlyingObject.ReportNoResultsAsync(message, cancellationToken); public ValueTask SetSearchTitleAsync(string title, CancellationToken cancellationToken) => UnderlyingObject.SetSearchTitleAsync(title, cancellationToken); diff --git a/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptFindUsagesService.cs b/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptFindUsagesService.cs index fe962a92eed50..aa1ebbf355ccb 100644 --- a/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptFindUsagesService.cs +++ b/src/EditorFeatures/Core/ExternalAccess/VSTypeScript/VSTypeScriptFindUsagesService.cs @@ -37,7 +37,7 @@ public IVSTypeScriptStreamingProgressTracker ProgressTracker => new ProgressTracker(_context.ProgressTracker); public ValueTask ReportMessageAsync(string message, CancellationToken cancellationToken) - => _context.ReportMessageAsync(message, cancellationToken); + => _context.ReportNoResultsAsync(message, cancellationToken); public ValueTask SetSearchTitleAsync(string title, CancellationToken cancellationToken) => _context.SetSearchTitleAsync(title, cancellationToken); diff --git a/src/EditorFeatures/Core/FindUsages/BufferedFindUsagesContext.cs b/src/EditorFeatures/Core/FindUsages/BufferedFindUsagesContext.cs index f0523e4c971b7..16f60a8fca065 100644 --- a/src/EditorFeatures/Core/FindUsages/BufferedFindUsagesContext.cs +++ b/src/EditorFeatures/Core/FindUsages/BufferedFindUsagesContext.cs @@ -8,6 +8,7 @@ using System.Threading.Tasks; using Microsoft.CodeAnalysis.Classification; using Microsoft.CodeAnalysis.Host; +using Microsoft.CodeAnalysis.Notification; using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.Shared.Utilities; using Roslyn.Utilities; @@ -101,10 +102,10 @@ public async Task AttachToStreamingPresenterAsync(IFindUsagesContext presenterCo await presenterContext.SetSearchTitleAsync(_state.SearchTitle, cancellationToken).ConfigureAwait(false); if (_state.Message != null) - await presenterContext.ReportMessageAsync(_state.Message, cancellationToken).ConfigureAwait(false); + await presenterContext.ReportNoResultsAsync(_state.Message, cancellationToken).ConfigureAwait(false); if (_state.InformationalMessage != null) - await presenterContext.ReportInformationalMessageAsync(_state.InformationalMessage, cancellationToken).ConfigureAwait(false); + await presenterContext.ReportMessageAsync(_state.InformationalMessage, NotificationSeverity.Information, cancellationToken).ConfigureAwait(false); foreach (var definition in _state.Definitions) await presenterContext.OnDefinitionFoundAsync(definition, cancellationToken).ConfigureAwait(false); @@ -148,12 +149,12 @@ async ValueTask IStreamingProgressTracker.ItemsCompletedAsync(int count, Cancell #region IFindUsagesContext - async ValueTask IFindUsagesContext.ReportMessageAsync(string message, CancellationToken cancellationToken) + async ValueTask IFindUsagesContext.ReportNoResultsAsync(string message, CancellationToken cancellationToken) { using var _ = await _gate.DisposableWaitAsync(cancellationToken).ConfigureAwait(false); if (IsSwapped) { - await _streamingPresenterContext.ReportMessageAsync(message, cancellationToken).ConfigureAwait(false); + await _streamingPresenterContext.ReportNoResultsAsync(message, cancellationToken).ConfigureAwait(false); } else { @@ -161,12 +162,12 @@ async ValueTask IFindUsagesContext.ReportMessageAsync(string message, Cancellati } } - async ValueTask IFindUsagesContext.ReportInformationalMessageAsync(string message, CancellationToken cancellationToken) + async ValueTask IFindUsagesContext.ReportMessageAsync(string message, NotificationSeverity severity, CancellationToken cancellationToken) { using var _ = await _gate.DisposableWaitAsync(cancellationToken).ConfigureAwait(false); if (IsSwapped) { - await _streamingPresenterContext.ReportInformationalMessageAsync(message, cancellationToken).ConfigureAwait(false); + await _streamingPresenterContext.ReportMessageAsync(message, severity, cancellationToken).ConfigureAwait(false); } else { diff --git a/src/EditorFeatures/Core/GoToDefinition/AbstractGoToCommandHandler`2.cs b/src/EditorFeatures/Core/GoToDefinition/AbstractGoToCommandHandler`2.cs index 5ecb0de0b743c..cb494fe0f8b18 100644 --- a/src/EditorFeatures/Core/GoToDefinition/AbstractGoToCommandHandler`2.cs +++ b/src/EditorFeatures/Core/GoToDefinition/AbstractGoToCommandHandler`2.cs @@ -16,6 +16,7 @@ using Microsoft.CodeAnalysis.FindUsages; using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Internal.Log; +using Microsoft.CodeAnalysis.Notification; using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Shared.TestHooks; @@ -262,8 +263,8 @@ private async Task FindResultsAsync( var isFullyLoaded = await service.IsFullyLoadedAsync(cancellationToken).ConfigureAwait(false); if (!isFullyLoaded) { - await findContext.ReportInformationalMessageAsync( - EditorFeaturesResources.The_results_may_be_incomplete_due_to_the_solution_still_loading_projects, cancellationToken).ConfigureAwait(false); + await findContext.ReportMessageAsync( + EditorFeaturesResources.The_results_may_be_incomplete_due_to_the_solution_still_loading_projects, NotificationSeverity.Information, cancellationToken).ConfigureAwait(false); } // We were able to find the doc prior to loading the workspace (or else we would not have the service). diff --git a/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService.DefinitionTrackingContext.cs b/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService.DefinitionTrackingContext.cs index 005796c8630e3..b5c8b72f60d31 100644 --- a/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService.DefinitionTrackingContext.cs +++ b/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService.DefinitionTrackingContext.cs @@ -9,6 +9,7 @@ using Microsoft.CodeAnalysis.Classification; using Microsoft.CodeAnalysis.FindUsages; using Microsoft.CodeAnalysis.Host; +using Microsoft.CodeAnalysis.Notification; using Microsoft.CodeAnalysis.Shared.Utilities; namespace Microsoft.CodeAnalysis.FindUsages; @@ -32,11 +33,11 @@ private sealed class DefinitionTrackingContext(IFindUsagesContext underlyingCont public IStreamingProgressTracker ProgressTracker => _underlyingContext.ProgressTracker; - public ValueTask ReportMessageAsync(string message, CancellationToken cancellationToken) - => _underlyingContext.ReportMessageAsync(message, cancellationToken); + public ValueTask ReportNoResultsAsync(string message, CancellationToken cancellationToken) + => _underlyingContext.ReportNoResultsAsync(message, cancellationToken); - public ValueTask ReportInformationalMessageAsync(string message, CancellationToken cancellationToken) - => _underlyingContext.ReportInformationalMessageAsync(message, cancellationToken); + public ValueTask ReportMessageAsync(string message, NotificationSeverity severity, CancellationToken cancellationToken) + => _underlyingContext.ReportMessageAsync(message, severity, cancellationToken); public ValueTask SetSearchTitleAsync(string title, CancellationToken cancellationToken) => _underlyingContext.SetSearchTitleAsync(title, cancellationToken); diff --git a/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindImplementations.cs b/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindImplementations.cs index 48dcd430b3cdb..18ef1f1dd5451 100644 --- a/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindImplementations.cs +++ b/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindImplementations.cs @@ -28,7 +28,7 @@ public async Task FindImplementationsAsync( document, position, cancellationToken).ConfigureAwait(false); if (symbolAndProjectOpt == null) { - await context.ReportMessageAsync( + await context.ReportNoResultsAsync( FeaturesResources.Cannot_navigate_to_the_symbol_under_the_caret, cancellationToken).ConfigureAwait(false); return; } @@ -78,7 +78,7 @@ await context.SetSearchTitleAsync( if (implementations.IsEmpty) { - await context.ReportMessageAsync(FeaturesResources.The_symbol_has_no_implementations, cancellationToken).ConfigureAwait(false); + await context.ReportNoResultsAsync(FeaturesResources.The_symbol_has_no_implementations, cancellationToken).ConfigureAwait(false); return; } diff --git a/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs b/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs index 9de1b33563660..89d32557d8d87 100644 --- a/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs +++ b/src/Features/Core/Portable/FindUsages/AbstractFindUsagesService_FindReferences.cs @@ -94,7 +94,7 @@ private static async Task FindSymbolReferencesAsync( document, position, cancellationToken).ConfigureAwait(false); if (symbolAndProject == null) { - await context.ReportMessageAsync(FeaturesResources.Find_All_References_not_invoked_on_applicable_symbol, cancellationToken).ConfigureAwait(false); + await context.ReportNoResultsAsync(FeaturesResources.Find_All_References_not_invoked_on_applicable_symbol, cancellationToken).ConfigureAwait(false); return; } diff --git a/src/Features/Core/Portable/FindUsages/FindUsagesContext.cs b/src/Features/Core/Portable/FindUsages/FindUsagesContext.cs index 7c0f46bce0cbf..e6e7096bc20b6 100644 --- a/src/Features/Core/Portable/FindUsages/FindUsagesContext.cs +++ b/src/Features/Core/Portable/FindUsages/FindUsagesContext.cs @@ -4,6 +4,7 @@ using System.Threading; using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Notification; using Microsoft.CodeAnalysis.Shared.Utilities; namespace Microsoft.CodeAnalysis.FindUsages; @@ -17,9 +18,9 @@ protected FindUsagesContext() ProgressTracker = new StreamingProgressTracker(ReportProgressAsync); } - public virtual ValueTask ReportMessageAsync(string message, CancellationToken cancellationToken) => default; + public virtual ValueTask ReportNoResultsAsync(string message, CancellationToken cancellationToken) => default; - public virtual ValueTask ReportInformationalMessageAsync(string message, CancellationToken cancellationToken) => default; + public virtual ValueTask ReportMessageAsync(string message, NotificationSeverity severity, CancellationToken cancellationToken) => default; public virtual ValueTask SetSearchTitleAsync(string title, CancellationToken cancellationToken) => default; diff --git a/src/Features/Core/Portable/FindUsages/IFindUsagesContext.cs b/src/Features/Core/Portable/FindUsages/IFindUsagesContext.cs index 27e4989e1c709..03b0c880ecc80 100644 --- a/src/Features/Core/Portable/FindUsages/IFindUsagesContext.cs +++ b/src/Features/Core/Portable/FindUsages/IFindUsagesContext.cs @@ -5,7 +5,7 @@ using System; using System.Threading; using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Classification; +using Microsoft.CodeAnalysis.Notification; using Microsoft.CodeAnalysis.Shared.Utilities; namespace Microsoft.CodeAnalysis.FindUsages; @@ -19,16 +19,15 @@ internal interface IFindUsagesContext IStreamingProgressTracker ProgressTracker { get; } /// - /// Report a failure message to be displayed to the user. This will be reported if the find operation returns - /// no results. + /// Report a message that the find operation returned no results. /// - ValueTask ReportMessageAsync(string message, CancellationToken cancellationToken); + ValueTask ReportNoResultsAsync(string message, CancellationToken cancellationToken); /// - /// Report a informational message to be displayed to the user. This may appear to the user in the results + /// Report a message to be displayed to the user. This may appear to the user in the results /// UI in some fashion (for example: in an info-bar). /// - ValueTask ReportInformationalMessageAsync(string message, CancellationToken cancellationToken); + ValueTask ReportMessageAsync(string message, NotificationSeverity severity, CancellationToken cancellationToken); /// /// Set the title of the window that results are displayed in. diff --git a/src/Features/Core/Portable/FindUsages/IRemoteFindUsagesService.cs b/src/Features/Core/Portable/FindUsages/IRemoteFindUsagesService.cs index 497c4915b7832..77db552392e32 100644 --- a/src/Features/Core/Portable/FindUsages/IRemoteFindUsagesService.cs +++ b/src/Features/Core/Portable/FindUsages/IRemoteFindUsagesService.cs @@ -13,6 +13,7 @@ using Microsoft.CodeAnalysis.ErrorReporting; using Microsoft.CodeAnalysis.FindSymbols; using Microsoft.CodeAnalysis.Host.Mef; +using Microsoft.CodeAnalysis.Notification; using Microsoft.CodeAnalysis.Remote; using Microsoft.CodeAnalysis.Text; using Roslyn.Utilities; @@ -100,10 +101,10 @@ public ValueTask ItemsCompletedAsync(int count, CancellationToken cancellationTo => _context.ProgressTracker.ItemsCompletedAsync(count, cancellationToken); public ValueTask ReportMessageAsync(string message, CancellationToken cancellationToken) - => _context.ReportMessageAsync(message, cancellationToken); + => _context.ReportNoResultsAsync(message, cancellationToken); public ValueTask ReportInformationalMessageAsync(string message, CancellationToken cancellationToken) - => _context.ReportInformationalMessageAsync(message, cancellationToken); + => _context.ReportMessageAsync(message, NotificationSeverity.Information, cancellationToken); public ValueTask SetSearchTitleAsync(string title, CancellationToken cancellationToken) => _context.SetSearchTitleAsync(title, cancellationToken); diff --git a/src/Features/Core/Portable/GoToBase/AbstractGoToBaseService.cs b/src/Features/Core/Portable/GoToBase/AbstractGoToBaseService.cs index e9dfae2efd95a..28ced7c05cc82 100644 --- a/src/Features/Core/Portable/GoToBase/AbstractGoToBaseService.cs +++ b/src/Features/Core/Portable/GoToBase/AbstractGoToBaseService.cs @@ -36,7 +36,7 @@ public async Task FindBasesAsync(IFindUsagesContext context, Document document, if (symbolAndProjectOpt == null) { - await context.ReportMessageAsync( + await context.ReportNoResultsAsync( FeaturesResources.Cannot_navigate_to_the_symbol_under_the_caret, cancellationToken).ConfigureAwait(false); return; } @@ -85,7 +85,7 @@ await context.SetSearchTitleAsync( if (!found) { - await context.ReportMessageAsync(FeaturesResources.The_symbol_has_no_base, cancellationToken).ConfigureAwait(false); + await context.ReportNoResultsAsync(FeaturesResources.The_symbol_has_no_base, cancellationToken).ConfigureAwait(false); } } } diff --git a/src/Features/LanguageServer/Protocol/Features/FindUsages/SimpleFindUsagesContext.cs b/src/Features/LanguageServer/Protocol/Features/FindUsages/SimpleFindUsagesContext.cs index cfadbfe86b98d..9a607836aa66c 100644 --- a/src/Features/LanguageServer/Protocol/Features/FindUsages/SimpleFindUsagesContext.cs +++ b/src/Features/LanguageServer/Protocol/Features/FindUsages/SimpleFindUsagesContext.cs @@ -7,8 +7,7 @@ using System.Collections.Immutable; using System.Threading; using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Options; -using Roslyn.Utilities; +using Microsoft.CodeAnalysis.Notification; namespace Microsoft.CodeAnalysis.FindUsages { @@ -29,7 +28,7 @@ internal sealed class SimpleFindUsagesContext : FindUsagesContext public string Message { get; private set; } public string SearchTitle { get; private set; } - public override ValueTask ReportMessageAsync(string message, CancellationToken cancellationToken) + public override ValueTask ReportNoResultsAsync(string message, CancellationToken cancellationToken) { Message = message; return default; diff --git a/src/Tools/ExternalAccess/FSharp/Internal/Editor/FindUsages/FSharpFindUsagesContext.cs b/src/Tools/ExternalAccess/FSharp/Internal/Editor/FindUsages/FSharpFindUsagesContext.cs index e8bf8c1cb9041..679890068ab2d 100644 --- a/src/Tools/ExternalAccess/FSharp/Internal/Editor/FindUsages/FSharpFindUsagesContext.cs +++ b/src/Tools/ExternalAccess/FSharp/Internal/Editor/FindUsages/FSharpFindUsagesContext.cs @@ -34,7 +34,7 @@ public Task OnReferenceFoundAsync(FSharp.FindUsages.FSharpSourceReferenceItem re public Task ReportMessageAsync(string message) { - return _context.ReportMessageAsync(message, _cancellationToken).AsTask(); + return _context.ReportNoResultsAsync(message, _cancellationToken).AsTask(); } public Task ReportProgressAsync(int current, int maximum) diff --git a/src/VisualStudio/Core/Def/FindReferences/Contexts/AbstractTableDataSourceFindUsagesContext.cs b/src/VisualStudio/Core/Def/FindReferences/Contexts/AbstractTableDataSourceFindUsagesContext.cs index 91ae04aee7527..e0b9f8ea40b6b 100644 --- a/src/VisualStudio/Core/Def/FindReferences/Contexts/AbstractTableDataSourceFindUsagesContext.cs +++ b/src/VisualStudio/Core/Def/FindReferences/Contexts/AbstractTableDataSourceFindUsagesContext.cs @@ -19,6 +19,7 @@ using Microsoft.CodeAnalysis.FindSymbols.Finders; using Microsoft.CodeAnalysis.FindUsages; using Microsoft.CodeAnalysis.Host; +using Microsoft.CodeAnalysis.Notification; using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Shared.Extensions; @@ -489,7 +490,7 @@ protected RoslynDefinitionBucket GetOrCreateDefinitionBucket(DefinitionItem defi } } - public sealed override ValueTask ReportMessageAsync(string message, CancellationToken cancellationToken) + public sealed override ValueTask ReportNoResultsAsync(string message, CancellationToken cancellationToken) { lock (Gate) { @@ -499,9 +500,9 @@ public sealed override ValueTask ReportMessageAsync(string message, Cancellation return ValueTaskFactory.CompletedTask; } - public sealed override async ValueTask ReportInformationalMessageAsync(string message, CancellationToken cancellationToken) + public sealed override async ValueTask ReportMessageAsync(string message, NotificationSeverity severity, CancellationToken cancellationToken) { - await this.Presenter.ReportInformationalMessageAsync(message, cancellationToken).ConfigureAwait(false); + await this.Presenter.ReportMessageAsync(message, severity, cancellationToken).ConfigureAwait(false); } protected sealed override ValueTask ReportProgressAsync(int current, int maximum, CancellationToken cancellationToken) diff --git a/src/VisualStudio/Core/Def/FindReferences/StreamingFindUsagesPresenter.cs b/src/VisualStudio/Core/Def/FindReferences/StreamingFindUsagesPresenter.cs index 7365f101ca2c6..d843b5fcbeb00 100644 --- a/src/VisualStudio/Core/Def/FindReferences/StreamingFindUsagesPresenter.cs +++ b/src/VisualStudio/Core/Def/FindReferences/StreamingFindUsagesPresenter.cs @@ -17,6 +17,7 @@ using Microsoft.CodeAnalysis.Editor.Shared.Utilities; using Microsoft.CodeAnalysis.FindUsages; using Microsoft.CodeAnalysis.Host.Mef; +using Microsoft.CodeAnalysis.Notification; using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Shared.TestHooks; @@ -326,7 +327,7 @@ private void RemoveExistingInfoBar() return infoBarHost; } - private async Task ReportInformationalMessageAsync(string message, CancellationToken cancellationToken) + private async Task ReportMessageAsync(string message, NotificationSeverity severity, CancellationToken cancellationToken) { await this.ThreadingContext.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken); RemoveExistingInfoBar(); @@ -340,7 +341,13 @@ private async Task ReportInformationalMessageAsync(string message, CancellationT _infoBar = factory.CreateInfoBar(new InfoBarModel( message, - KnownMonikers.StatusInformation, + severity switch + { + NotificationSeverity.Information => KnownMonikers.StatusInformation, + NotificationSeverity.Error => KnownMonikers.StatusError, + NotificationSeverity.Warning => KnownMonikers.StatusWarning, + _ => throw ExceptionUtilities.UnexpectedValue(severity), + }, isCloseButtonVisible: false)); infoBarHost.AddInfoBar(_infoBar); diff --git a/src/Workspaces/Remote/ServiceHub/Services/FindUsages/RemoteFindUsagesService.cs b/src/Workspaces/Remote/ServiceHub/Services/FindUsages/RemoteFindUsagesService.cs index b72eeddaa7b7c..c2a04d3b53ff6 100644 --- a/src/Workspaces/Remote/ServiceHub/Services/FindUsages/RemoteFindUsagesService.cs +++ b/src/Workspaces/Remote/ServiceHub/Services/FindUsages/RemoteFindUsagesService.cs @@ -8,6 +8,7 @@ using Microsoft.CodeAnalysis.Classification; using Microsoft.CodeAnalysis.FindSymbols; using Microsoft.CodeAnalysis.FindUsages; +using Microsoft.CodeAnalysis.Notification; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Shared.Utilities; @@ -96,10 +97,10 @@ public ValueTask ItemsCompletedAsync(int count, CancellationToken cancellationTo public IStreamingProgressTracker ProgressTracker => this; - public ValueTask ReportMessageAsync(string message, CancellationToken cancellationToken) + public ValueTask ReportNoResultsAsync(string message, CancellationToken cancellationToken) => _callback.InvokeAsync((callback, cancellationToken) => callback.ReportMessageAsync(_callbackId, message, cancellationToken), cancellationToken); - public ValueTask ReportInformationalMessageAsync(string message, CancellationToken cancellationToken) + public ValueTask ReportMessageAsync(string message, NotificationSeverity severity, CancellationToken cancellationToken) => _callback.InvokeAsync((callback, cancellationToken) => callback.ReportInformationalMessageAsync(_callbackId, message, cancellationToken), cancellationToken); public ValueTask SetSearchTitleAsync(string title, CancellationToken cancellationToken)