-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66970 from mavasani/SymbolStartAnalyzers
[Lightbulb Perf] Async lightbulb performance improvement
- Loading branch information
Showing
22 changed files
with
675 additions
and
132 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
src/EditorFeatures/Core.Wpf/Suggestions/SuggestedActionPriorityProvider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Microsoft.CodeAnalysis.CodeActions; | ||
using Microsoft.CodeAnalysis.Diagnostics; | ||
using Roslyn.Utilities; | ||
|
||
namespace Microsoft.CodeAnalysis.Editor.Implementation.Suggestions; | ||
|
||
internal sealed class SuggestedActionPriorityProvider : ICodeActionRequestPriorityProvider | ||
{ | ||
/// <summary> | ||
/// Set of de-prioritized analyzers that were moved down from 'Normal' to 'Low' | ||
/// priority bucket. | ||
/// Note that this set is owned by the <see cref="SuggestedActionsSourceProvider.SuggestedActionsSource"/> | ||
/// and shared across priority buckets. | ||
/// </summary> | ||
private readonly ConcurrentSet<DiagnosticAnalyzer> _lowPriorityAnalyzers; | ||
|
||
public SuggestedActionPriorityProvider(CodeActionRequestPriority priority, ConcurrentSet<DiagnosticAnalyzer> lowPriorityAnalyzers) | ||
{ | ||
Priority = priority; | ||
_lowPriorityAnalyzers = lowPriorityAnalyzers; | ||
} | ||
|
||
public CodeActionRequestPriority Priority { get; } | ||
|
||
public void AddDeprioritizedAnalyzerWithLowPriority(DiagnosticAnalyzer analyzer) | ||
=> _lowPriorityAnalyzers.Add(analyzer); | ||
|
||
public bool IsDeprioritizedAnalyzerWithLowPriority(DiagnosticAnalyzer analyzer) | ||
=> _lowPriorityAnalyzers.Contains(analyzer); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.