File tree Expand file tree Collapse file tree 2 files changed +25
-7
lines changed
EditorFeatures/Core.Wpf/Suggestions
VisualStudio/IntegrationTest/IntegrationTests/CSharp Expand file tree Collapse file tree 2 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,8 @@ private async Task GetSuggestedActionsWorkerAsync(
9797 // items should be pushed higher up, and less important items shouldn't take up that much space.
9898 var currentActionCount = 0 ;
9999
100+ using var _ = ArrayBuilder < SuggestedActionSet > . GetInstance ( out var lowPrioritySets ) ;
101+
100102 // Collectors are in priority order. So just walk them from highest to lowest.
101103 foreach ( var collector in collectors )
102104 {
@@ -122,8 +124,27 @@ private async Task GetSuggestedActionsWorkerAsync(
122124
123125 await foreach ( var set in allSets )
124126 {
125- currentActionCount += set . Actions . Count ( ) ;
126- collector . Add ( set ) ;
127+ if ( priority == CodeActionRequestPriority . High && set . Priority == SuggestedActionSetPriority . Low )
128+ {
129+ // if we're processing the high pri bucket, but we get action sets for lower pri
130+ // groups, then keep track of them and add them in later when we get to that group.
131+ lowPrioritySets . Add ( set ) ;
132+ }
133+ else
134+ {
135+ currentActionCount += set . Actions . Count ( ) ;
136+ collector . Add ( set ) ;
137+ }
138+ }
139+
140+ if ( priority == CodeActionRequestPriority . Normal )
141+ {
142+ // now, add any low pri items we've been waiting on to the final group.
143+ foreach ( var set in lowPrioritySets )
144+ {
145+ currentActionCount += set . Actions . Count ( ) ;
146+ collector . Add ( set ) ;
147+ }
127148 }
128149 }
129150
Original file line number Diff line number Diff line change 44
55#nullable disable
66
7- using System ;
8- using System . Collections . Generic ;
97using System . Collections . Immutable ;
108using System . Linq ;
119using System . Threading ;
1917using Microsoft . VisualStudio . IntegrationTest . Utilities . Input ;
2018using Roslyn . Test . Utilities ;
2119using Xunit ;
22- using Xunit . Abstractions ;
2320using ProjectUtils = Microsoft . VisualStudio . IntegrationTest . Utilities . Common . ProjectUtils ;
2421
2522namespace Roslyn . VisualStudio . IntegrationTests . CSharp
@@ -486,7 +483,7 @@ public class P2 { }");
486483 }
487484
488485 [ WpfFact , Trait ( Traits . Feature , Traits . Features . CodeActionsGenerateType ) ]
489- public void GFUFuzzyMatchAfterRenameTracking ( )
486+ public void GFUFuzzyMatchAfterRenameTrackingAndAfterGenerateType ( )
490487 {
491488 SetUpEditor ( @"
492489namespace N
@@ -511,12 +508,12 @@ static void Main(string[] args)
511508 var expectedItems = new [ ]
512509 {
513510 "Rename 'P2' to 'Foober'" ,
514- "Goober - using N;" ,
515511 "Generate type 'Foober'" ,
516512 "Generate class 'Foober' in new file" ,
517513 "Generate class 'Foober'" ,
518514 "Generate nested class 'Foober'" ,
519515 "Generate new type..." ,
516+ "Goober - using N;" ,
520517 "Suppress or Configure issues" ,
521518 "Suppress CS0168" ,
522519 "in Source" ,
You can’t perform that action at this time.
0 commit comments