Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'priority' concept to our code actions, and code refactoring/fix providers. #68511

Merged
merged 59 commits into from
Jul 17, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
7b9dab4
Rename type
CyrusNajmabadi Jun 9, 2023
8b175b0
Rename type
CyrusNajmabadi Jun 9, 2023
72795ac
Add public api
CyrusNajmabadi Jun 9, 2023
be0075a
Rename properties
CyrusNajmabadi Jun 9, 2023
f00a244
Rename methods
CyrusNajmabadi Jun 9, 2023
38a8d57
Expose public entrypoints for setting priorities on providers
CyrusNajmabadi Jun 9, 2023
0ac048a
Add code action priority
CyrusNajmabadi Jun 9, 2023
8906650
Add priority property to code action
CyrusNajmabadi Jun 9, 2023
1a6240e
Switch to using new priority system
CyrusNajmabadi Jun 9, 2023
657bf1f
Move to using normal priority enum
CyrusNajmabadi Jun 9, 2023
5342a43
Move to using normal priority enum
CyrusNajmabadi Jun 9, 2023
ff293b1
delete unused member
CyrusNajmabadi Jun 9, 2023
b92df55
Renames
CyrusNajmabadi Jun 9, 2023
ff2b894
Move to normal priority system
CyrusNajmabadi Jun 9, 2023
cb2ae1b
Remove unnecessary action
CyrusNajmabadi Jun 9, 2023
741e7ad
Add default back in
CyrusNajmabadi Jun 9, 2023
81a4645
Add default back in
CyrusNajmabadi Jun 9, 2023
704b40e
Extract enum
CyrusNajmabadi Jun 9, 2023
8b8f3cc
Delete dead code
CyrusNajmabadi Jun 9, 2023
38e021c
No need for priority here
CyrusNajmabadi Jun 9, 2023
aff8526
Merge remote-tracking branch 'upstream/main' into codeActionPri
CyrusNajmabadi Jun 10, 2023
939e28b
Add equivalence key
CyrusNajmabadi Jun 10, 2023
7398b34
Use single enum
CyrusNajmabadi Jul 13, 2023
b33d117
Downstream impact
CyrusNajmabadi Jul 13, 2023
1ca450b
Add custom tag back
CyrusNajmabadi Jul 13, 2023
4e24505
in progress
CyrusNajmabadi Jul 14, 2023
3ac6bc1
Unify
CyrusNajmabadi Jul 14, 2023
974cf63
Unify
CyrusNajmabadi Jul 14, 2023
ce1286b
AnalyzeR
CyrusNajmabadi Jul 14, 2023
9abc31e
High pri
CyrusNajmabadi Jul 14, 2023
9334477
remove usingS
CyrusNajmabadi Jul 14, 2023
0624db5
F#
CyrusNajmabadi Jul 14, 2023
bdecd94
Delete
CyrusNajmabadi Jul 14, 2023
685ed9d
Delete
CyrusNajmabadi Jul 14, 2023
37a2b3f
Docs
CyrusNajmabadi Jul 14, 2023
178a730
Delete
CyrusNajmabadi Jul 14, 2023
e2a04c7
Remove none value
CyrusNajmabadi Jul 14, 2023
bdbf75e
IMplement
CyrusNajmabadi Jul 14, 2023
82a9e30
Merge remote-tracking branch 'upstream/main' into codeActionPri
CyrusNajmabadi Jul 14, 2023
11d72c1
Renames
CyrusNajmabadi Jul 14, 2023
0d59cca
Fixes
CyrusNajmabadi Jul 14, 2023
d95498b
Update src/Analyzers/Core/CodeFixes/UpgradeProject/AbstractUpgradePro…
CyrusNajmabadi Jul 14, 2023
39ed273
Preserve priority
CyrusNajmabadi Jul 14, 2023
923eac7
Simplify
CyrusNajmabadi Jul 14, 2023
b9cb2ab
Merge branch 'codeActionPri' of https://github.com/CyrusNajmabadi/ros…
CyrusNajmabadi Jul 14, 2023
7da1751
Simplify
CyrusNajmabadi Jul 14, 2023
71b1862
Simplify
CyrusNajmabadi Jul 14, 2023
c7f16db
API
CyrusNajmabadi Jul 14, 2023
dcb6052
API
CyrusNajmabadi Jul 14, 2023
138d3a3
Delete unneeded type
CyrusNajmabadi Jul 14, 2023
81458d9
revert
CyrusNajmabadi Jul 14, 2023
6d5c41b
revert
CyrusNajmabadi Jul 14, 2023
605ee29
revert
CyrusNajmabadi Jul 14, 2023
773e21c
revert
CyrusNajmabadi Jul 14, 2023
76e235b
revert
CyrusNajmabadi Jul 14, 2023
024a103
revert
CyrusNajmabadi Jul 14, 2023
8ced823
revert
CyrusNajmabadi Jul 14, 2023
72f86df
Simplify
CyrusNajmabadi Jul 14, 2023
ff02e51
Merge branch 'main' into codeActionPri
CyrusNajmabadi Jul 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public override Task RegisterCodeFixesAsync(CodeFixContext context)
// helpful, but shouldn't interfere with anything else the uesr is doing.
var priority = IsSubsequentSection(diagnostic)
? CodeActionPriority.Low
: CodeActionPriority.Medium;
: CodeActionPriority.Default;
Copy link
Member Author

Choose a reason for hiding this comment

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

Lowest/Low/Default/High/Highest matches editor naming for this sort of thing (including the lightbulb priority class namign. so i aligned on that for our public API).

Copy link
Member Author

Choose a reason for hiding this comment

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

i also preferred 'Default' (versus 'Normal' or 'Medium') as it prevented the need to have a duplicate 'Default' member, or to explain what the 'Default' value for these enums was. By just naming it that way, it all simplified (though it does impact the diff here).


RegisterCodeFix(context, CSharpCodeFixesResources.Remove_unreachable_code, nameof(CSharpCodeFixesResources.Remove_unreachable_code), priority);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public sealed override Task RegisterCodeFixesAsync(CodeFixContext context)

var priority = diagnostic.Severity == DiagnosticSeverity.Hidden
? CodeActionPriority.Low
: CodeActionPriority.Medium;
: CodeActionPriority.Default;

var title = diagnostic.GetMessage();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected AbstractBuiltInCodeStyleDiagnosticAnalyzer(ImmutableArray<DiagnosticDe
Debug.Assert(!supportedDiagnostics.Any(descriptor => descriptor.CustomTags.Any(t => t == WellKnownDiagnosticTags.Unnecessary)) || this is AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer);
}

public virtual CodeActionRequestPriority RequestPriority => CodeActionRequestPriority.Normal;
public virtual CodeActionRequestPriorityInternal RequestPriority => CodeActionRequestPriorityInternal.Normal;
Copy link
Member Author

Choose a reason for hiding this comment

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

we could consider makign the diagnostic-analyzer priority part available as well.

Copy link
Member

Choose a reason for hiding this comment

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

❓ Can we keep the type of this property CodeActionRequestPriority, and just leave CodeActionRequestPriorityInternal as an internal static class providing extra constants?

public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; }

protected static DiagnosticDescriptor CreateDescriptorWithId(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected AbstractCodeQualityDiagnosticAnalyzer(
_generatedCodeAnalysisFlags = generatedCodeAnalysisFlags;
}

public CodeActionRequestPriority RequestPriority => CodeActionRequestPriority.Normal;
public CodeActionRequestPriorityInternal RequestPriority => CodeActionRequestPriorityInternal.Normal;
public sealed override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; }

public sealed override void Initialize(AnalysisContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected sealed override void InitializeWorker(AnalysisContext context)
/// them acting on an error reported in code, and can be computed fast as it only uses syntax not semantics.
/// It's also the 8th most common fix that people use, and is picked almost all the times it is shown.
/// </summary>
public override CodeActionRequestPriority RequestPriority => CodeActionRequestPriority.High;
public override CodeActionRequestPriorityInternal RequestPriority => CodeActionRequestPriorityInternal.High;

private void AnalyzeSyntaxTree(SyntaxTreeAnalysisContext context)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public sealed override Task RegisterCodeFixesAsync(CodeFixContext context)

var priority = diagnostic.Severity == DiagnosticSeverity.Hidden
? CodeActionPriority.Low
: CodeActionPriority.Medium;
: CodeActionPriority.Default;

var (title, key) = diagnostic.Properties.ContainsKey(AddAccessibilityModifiersConstants.ModifiersAdded)
? (AnalyzersResources.Add_accessibility_modifiers, nameof(AnalyzersResources.Add_accessibility_modifiers))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ protected AbstractResolveConflictMarkerCodeFixProvider(
/// them if they bring up the lightbulb on a <c>&lt;&lt;&lt;&lt;&lt;&lt;&lt;</c> line, it should run ahead of
/// normal fix providers else so the user can quickly fix the conflict and move onto the next conflict.
/// </summary>
private protected override CodeActionRequestPriority ComputeRequestPriority()
=> CodeActionRequestPriority.High;
private protected override CodeActionRequestPriorityInternal ComputeRequestPriorityInternal()
=> CodeActionRequestPriorityInternal.High;
Copy link
Member Author

Choose a reason for hiding this comment

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

features that return 'high' use the 'internal' priority system. For now, only we allow a blessed set to be high pri. That set is exactly:

  1. Add using.
  2. Rename
  3. Fix formatting
  4. Fix git merge-conflicts


#endif
Copy link
Member Author

Choose a reason for hiding this comment

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

providing priority is no longer something CODE_STYLE cannot do.


Expand Down Expand Up @@ -301,7 +301,7 @@ static CodeAction CreateCodeAction(string title, Func<CancellationToken, Task<Do
#if CODE_STYLE
return CodeAction.Create(title, action, equivalenceKey);
#else
return CodeAction.DocumentChangeAction.Create(title, action, equivalenceKey, CodeActionPriority.High);
return CodeAction.DocumentChangeAction.Create(title, action, equivalenceKey, CodeActionPriorityInternal.High);
#endif
Copy link
Member Author

Choose a reason for hiding this comment

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

however, because it is high pri, the feature has to use this backdoor for that to be ok. it will be clamped otherwise.

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public sealed override ImmutableArray<string> FixableDiagnosticIds
/// them acting on an error reported in code, and can be computed fast as it only uses syntax not semantics.
/// It's also the 8th most common fix that people use, and is picked almost all the times it is shown.
/// </summary>
private protected override CodeActionRequestPriority ComputeRequestPriority()
=> CodeActionRequestPriority.High;
private protected override CodeActionRequestPriorityInternal ComputeRequestPriorityInternal()
Copy link
Contributor

Choose a reason for hiding this comment

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

So, this API/override is still not available in the code style layer. This means the formatting analyzer/fixer when executed from the CodeStyle NuGet package would still be clamped down to normal priority. I am wondering if there is some way we can incorporate that support in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

I am wondering if the following implementation could work here:

  1. Do not add the parallel XXXInternal APIs that are being added in this PR, instead just have the public ones, also exposing the High field from these enums
  2. Have our IDE code fixers/refactorings add a special custom tag to indicate these are first party ones:
    // Add the provider name to the parent CodeAction's CustomTags.
    // Always add a name even in cases of 3rd party fixers/refactorings that do not export
    // name metadata.
    var tag = providerMetadata?.Name ?? provider.GetTypeDisplayName();
    CustomTags = CustomTags.Add(tag);
  3. Clamp the High priority values down to Normal priority for providers and actions that don't have these special custom tag.

Agreed that this opens a small backdoor for third party providers to now add this special custom tag themselves and trick us into thinking it's a first party provider, but I think such providers will be rare, if any. On the positive side though, we avoid all this overengineering with parallel Internal and Public APIs, and can finally have our first party providers shipping in CodeStyle NuGet package to also be able to run at high priority when appropriate.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good. I'll do that!

Copy link
Member Author

Choose a reason for hiding this comment

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

Slightly confused though. If this is not available, why would this Compile

Copy link
Member Author

Choose a reason for hiding this comment

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

Ignore that. I see the ifdef :-)

=> CodeActionRequestPriorityInternal.High;

#endif

Expand All @@ -52,7 +52,7 @@ public sealed override Task RegisterCodeFixesAsync(CodeFixContext context)
AnalyzersResources.Fix_formatting,
c => FixOneAsync(context, diagnostic, c),
nameof(AbstractFormattingCodeFixProvider),
CodeActionPriority.High),
CodeActionPriorityInternal.High),
diagnostic);
#endif
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private static void AccessSupportedDiagnostics(DiagnosticAnalyzer analyzer)

private class ThrowingDoNotCatchDiagnosticAnalyzer<TLanguageKindEnum> : ThrowingDiagnosticAnalyzer<TLanguageKindEnum>, IBuiltInAnalyzer where TLanguageKindEnum : struct
{
public CodeActionRequestPriority RequestPriority => CodeActionRequestPriority.Normal;
public CodeActionRequestPriorityInternal RequestPriority => CodeActionRequestPriorityInternal.Normal;

public bool OpenFileOnly(SimplifierOptions? options) => false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ internal sealed class SuggestedActionPriorityProvider : ICodeActionRequestPriori
/// </summary>
private readonly ConcurrentSet<DiagnosticAnalyzer> _lowPriorityAnalyzers;

public SuggestedActionPriorityProvider(CodeActionRequestPriority priority, ConcurrentSet<DiagnosticAnalyzer> lowPriorityAnalyzers)
public SuggestedActionPriorityProvider(CodeActionRequestPriorityInternal priority, ConcurrentSet<DiagnosticAnalyzer> lowPriorityAnalyzers)
{
Priority = priority;
_lowPriorityAnalyzers = lowPriorityAnalyzers;
}

public CodeActionRequestPriority Priority { get; }
public CodeActionRequestPriorityInternal Priority { get; }

public void AddDeprioritizedAnalyzerWithLowPriority(DiagnosticAnalyzer analyzer)
=> _lowPriorityAnalyzers.Add(analyzer);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ internal SuggestedAction(
CodeAction = codeAction;
}

internal virtual CodeActionPriority Priority => CodeAction.Priority;
Copy link
Member Author

Choose a reason for hiding this comment

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

never used. removed.

internal virtual CodeActionPriorityInternal Priority => CodeAction.PriorityInternal;

public virtual bool TryGetTelemetryId(out Guid telemetryId)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ public SuggestedActionsSourceProvider(
_threadingContext, _globalOptions, this, textView, textBuffer, _suggestedActionCategoryRegistry, this.OperationListener);
}

private static CodeActionRequestPriority? TryGetPriority(string priority)
private static CodeActionRequestPriorityInternal? TryGetPriority(string priority)
=> priority switch
{
DefaultOrderings.Highest => CodeActionRequestPriority.High,
DefaultOrderings.Default => CodeActionRequestPriority.Normal,
DefaultOrderings.Low => CodeActionRequestPriority.Low,
DefaultOrderings.Lowest => CodeActionRequestPriority.Lowest,
DefaultOrderings.Highest => CodeActionRequestPriorityInternal.High,
DefaultOrderings.Default => CodeActionRequestPriorityInternal.Normal,
DefaultOrderings.Low => CodeActionRequestPriorityInternal.Low,
DefaultOrderings.Lowest => CodeActionRequestPriorityInternal.Lowest,
_ => null,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private async Task GetSuggestedActionsWorkerAsync(
// items should be pushed higher up, and less important items shouldn't take up that much space.
var currentActionCount = 0;

var pendingActionSets = new MultiDictionary<CodeActionRequestPriority, SuggestedActionSet>();
var pendingActionSets = new MultiDictionary<CodeActionRequestPriorityInternal, SuggestedActionSet>();

// Keep track of the diagnostic analyzers that have been deprioritized across calls to the
// diagnostic engine. We'll run them once we get around to the low-priority bucket. We want to
Expand All @@ -113,7 +113,7 @@ private async Task GetSuggestedActionsWorkerAsync(
// Collectors are in priority order. So just walk them from highest to lowest.
foreach (var collector in collectors)
{
if (TryGetPriority(collector.Priority) is CodeActionRequestPriority priority)
if (TryGetPriority(collector.Priority) is CodeActionRequestPriorityInternal priority)
{
var allSets = GetCodeFixesAndRefactoringsAsync(
state, requestedActionCategories, document,
Expand All @@ -128,10 +128,10 @@ private async Task GetSuggestedActionsWorkerAsync(
// group the set says it wants to be in.
var actualSetPriority = set.Priority switch
{
SuggestedActionSetPriority.None => CodeActionRequestPriority.Lowest,
SuggestedActionSetPriority.Low => CodeActionRequestPriority.Low,
SuggestedActionSetPriority.Medium => CodeActionRequestPriority.Normal,
SuggestedActionSetPriority.High => CodeActionRequestPriority.High,
SuggestedActionSetPriority.None => CodeActionRequestPriorityInternal.Lowest,
SuggestedActionSetPriority.Low => CodeActionRequestPriorityInternal.Low,
SuggestedActionSetPriority.Medium => CodeActionRequestPriorityInternal.Normal,
SuggestedActionSetPriority.High => CodeActionRequestPriorityInternal.High,
_ => throw ExceptionUtilities.UnexpectedValue(set.Priority),
};

Expand Down Expand Up @@ -246,7 +246,7 @@ Task<ImmutableArray<UnifiedSuggestedActionSet>> GetRefactoringsAsync()

// 'CodeActionRequestPriority.Lowest' is reserved for suppression/configuration code fixes.
// No code refactoring should have this request priority.
if (priorityProvider.Priority == CodeActionRequestPriority.Lowest)
if (priorityProvider.Priority == CodeActionRequestPriorityInternal.Lowest)
return SpecializedTasks.EmptyImmutableArray<UnifiedSuggestedActionSet>();

// If we are computing refactorings outside the 'Refactoring' context, i.e. for example, from the lightbulb under a squiggle or selection,
Expand Down Expand Up @@ -299,13 +299,13 @@ ISuggestedAction ConvertToSuggestedAction(IUnifiedSuggestedAction unifiedSuggest
};
}

static SuggestedActionSetPriority ConvertToSuggestedActionSetPriority(CodeActionPriority priority)
static SuggestedActionSetPriority ConvertToSuggestedActionSetPriority(CodeActionPriorityInternal priority)
=> priority switch
{
CodeActionPriority.Lowest => SuggestedActionSetPriority.None,
CodeActionPriority.Low => SuggestedActionSetPriority.Low,
CodeActionPriority.Medium => SuggestedActionSetPriority.Medium,
CodeActionPriority.High => SuggestedActionSetPriority.High,
CodeActionPriorityInternal.Lowest => SuggestedActionSetPriority.None,
CodeActionPriorityInternal.Low => SuggestedActionSetPriority.Low,
CodeActionPriorityInternal.Medium => SuggestedActionSetPriority.Medium,
CodeActionPriorityInternal.High => SuggestedActionSetPriority.High,
_ => throw ExceptionUtilities.Unreachable(),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
public DiagnosticAnalyzerCategory GetAnalyzerCategory()
=> DiagnosticAnalyzerCategory.SemanticDocumentAnalysis;

public CodeActionRequestPriority RequestPriority => CodeActionRequestPriority.Normal;
public CodeActionRequestPriorityInternal RequestPriority => CodeActionRequestPriorityInternal.Normal;

public bool OpenFileOnly(SimplifierOptions? options)
=> false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public override Task ComputeRefactoringsAsync(CodeRefactoringContext context)
/// change the name of something and pop up the lightbulb without having to wait for the rest to
/// compute.
/// </summary>
private protected override CodeActionRequestPriority ComputeRequestPriority()
=> CodeActionRequestPriority.High;
private protected override CodeActionRequestPriorityInternal ComputeRequestPriorityInternal()
=> CodeActionRequestPriorityInternal.High;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public RenameTrackingCodeAction(
}

public override string Title => _title;
internal override CodeActionPriority Priority => CodeActionPriority.High;
internal override CodeActionPriorityInternal PriorityInternal => CodeActionPriorityInternal.High;

protected override Task<IEnumerable<CodeActionOperation>> ComputeOperationsAsync(CancellationToken cancellationToken)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public sealed class TestParameters
internal readonly ParseOptions parseOptions;
internal readonly CompilationOptions compilationOptions;
internal readonly int index;
internal readonly CodeActionPriority? priority;
internal readonly CodeActionPriorityInternal? priority;
internal readonly bool retainNonFixableDiagnostics;
internal readonly bool includeDiagnosticsOutsideSelection;
internal readonly bool includeNonLocalDocumentDiagnostics;
Expand All @@ -74,7 +74,7 @@ internal TestParameters(
OptionsCollection globalOptions = null,
object fixProviderData = null,
int index = 0,
CodeActionPriority? priority = null,
CodeActionPriorityInternal? priority = null,
bool retainNonFixableDiagnostics = false,
bool includeDiagnosticsOutsideSelection = false,
string title = null,
Expand Down Expand Up @@ -406,7 +406,7 @@ internal Task TestInRegularAndScriptAsync(
string initialMarkup,
string expectedMarkup,
int index = 0,
CodeActionPriority? priority = null,
CodeActionPriorityInternal? priority = null,
CompilationOptions compilationOptions = null,
OptionsCollection options = null,
OptionsCollection globalOptions = null,
Expand Down Expand Up @@ -452,7 +452,7 @@ internal Task TestAsync(
OptionsCollection options = null,
OptionsCollection globalOptions = null,
object fixProviderData = null,
CodeActionPriority? priority = null,
CodeActionPriorityInternal? priority = null,
TestHost testHost = TestHost.InProcess)
{
return TestAsync(
Expand Down Expand Up @@ -779,7 +779,7 @@ internal async Task<ImmutableArray<CodeActionOperation>> VerifyActionAndGetOpera

if (parameters.priority != null)
{
Assert.Equal(parameters.priority.Value, action.Priority);
Assert.Equal(parameters.priority.Value, action.PriorityInternal);
}

if (parameters.title != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ internal class Analyzer : DiagnosticAnalyzer, IBuiltInAnalyzer
private readonly DiagnosticDescriptor _descriptor =
new DiagnosticDescriptor("TestId", "Test", "Test", "Test", DiagnosticSeverity.Warning, isEnabledByDefault: true);

public CodeActionRequestPriority RequestPriority => CodeActionRequestPriority.Normal;
public CodeActionRequestPriorityInternal RequestPriority => CodeActionRequestPriorityInternal.Normal;

public bool OpenFileOnly(SimplifierOptions options) => false;

Expand Down
Loading