@@ -38,7 +38,7 @@ namespace Roslyn.VisualStudio.Next.UnitTests.Remote
38
38
{
39
39
[ UseExportProvider ]
40
40
[ Trait ( Traits . Feature , Traits . Features . RemoteHost ) ]
41
- public class ServiceHubServicesTests
41
+ public sealed class ServiceHubServicesTests
42
42
{
43
43
private static TestWorkspace CreateWorkspace ( Type [ ] additionalParts = null )
44
44
=> new ( composition : FeaturesTestCompositions . Features . WithTestHostParts ( TestHost . OutOfProcess ) . AddParts ( additionalParts ) ) ;
@@ -765,10 +765,10 @@ private static DocumentId AddSimpleDocument(TestWorkspace workspace, CallbackGen
765
765
return tempDoc . Id ;
766
766
}
767
767
768
- private static IAsynchronousOperationWaiter GetWorkspaceWaiter ( TestWorkspace workspace )
768
+ private static async Task WaitForSourceGeneratorsAsync ( TestWorkspace workspace )
769
769
{
770
770
var operations = workspace . ExportProvider . GetExportedValue < AsynchronousOperationListenerProvider > ( ) ;
771
- return operations . GetWaiter ( FeatureAttribute . Workspace ) ;
771
+ await operations . WaitAllAsync ( workspace , [ FeatureAttribute . Workspace , FeatureAttribute . SourceGenerators ] ) ;
772
772
}
773
773
774
774
[ Theory , CombinatorialData ]
@@ -810,7 +810,7 @@ internal async Task TestSourceGenerationExecution_MinorVersionChange_NoActualCha
810
810
Assert . Equal ( 1 , callCount ) ;
811
811
812
812
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : null , forceRegeneration : false ) ;
813
- await GetWorkspaceWaiter ( workspace ) . ExpeditedWaitAsync ( ) ;
813
+ await WaitForSourceGeneratorsAsync ( workspace ) ;
814
814
815
815
solution = workspace . CurrentSolution ;
816
816
project = solution . Projects . Single ( ) ;
@@ -866,7 +866,7 @@ internal async Task TestSourceGenerationExecution_MajorVersionChange_NoActualCha
866
866
867
867
// Because we're forcing regeneration, in both mode we should now see two calls to the generator.
868
868
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : null , forceRegeneration : true ) ;
869
- await GetWorkspaceWaiter ( workspace ) . ExpeditedWaitAsync ( ) ;
869
+ await WaitForSourceGeneratorsAsync ( workspace ) ;
870
870
871
871
solution = workspace . CurrentSolution ;
872
872
project = solution . Projects . Single ( ) ;
@@ -913,7 +913,7 @@ internal async Task TestSourceGenerationExecution_FullSolutionChange_Minor(Sourc
913
913
var initialSolution = workspace . CurrentSolution ;
914
914
915
915
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : null , forceRegeneration : false ) ;
916
- await GetWorkspaceWaiter ( workspace ) . ExpeditedWaitAsync ( ) ;
916
+ await WaitForSourceGeneratorsAsync ( workspace ) ;
917
917
918
918
var currentSolution = workspace . CurrentSolution ;
919
919
@@ -964,7 +964,7 @@ internal async Task TestSourceGenerationExecution_FullSolutionChange_Major(Sourc
964
964
var initialSolution = workspace . CurrentSolution ;
965
965
966
966
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : null , forceRegeneration : true ) ;
967
- await GetWorkspaceWaiter ( workspace ) . ExpeditedWaitAsync ( ) ;
967
+ await WaitForSourceGeneratorsAsync ( workspace ) ;
968
968
969
969
var currentSolution = workspace . CurrentSolution ;
970
970
@@ -1007,7 +1007,7 @@ internal async Task TestSourceGenerationExecution_FullSolutionChange_MajorAndMin
1007
1007
// forceRegeneration=true should take precedence.
1008
1008
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : null , forceRegeneration : false ) ;
1009
1009
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : null , forceRegeneration : true ) ;
1010
- await GetWorkspaceWaiter ( workspace ) . ExpeditedWaitAsync ( ) ;
1010
+ await WaitForSourceGeneratorsAsync ( workspace ) ;
1011
1011
1012
1012
var currentSolution = workspace . CurrentSolution ;
1013
1013
@@ -1049,7 +1049,7 @@ internal async Task TestSourceGenerationExecution_ProjectChange_Minor_1(SourceGe
1049
1049
1050
1050
// Updating project1 should only impact it.
1051
1051
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : projectId1 , forceRegeneration : false ) ;
1052
- await GetWorkspaceWaiter ( workspace ) . ExpeditedWaitAsync ( ) ;
1052
+ await WaitForSourceGeneratorsAsync ( workspace ) ;
1053
1053
1054
1054
var currentSolution = workspace . CurrentSolution ;
1055
1055
@@ -1102,7 +1102,7 @@ internal async Task TestSourceGenerationExecution_ProjectChange_Minor_2(SourceGe
1102
1102
1103
1103
// Updating project1 should regen both projects due to p2p reference.
1104
1104
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : projectId1 , forceRegeneration : false ) ;
1105
- await GetWorkspaceWaiter ( workspace ) . ExpeditedWaitAsync ( ) ;
1105
+ await WaitForSourceGeneratorsAsync ( workspace ) ;
1106
1106
1107
1107
var currentSolution = workspace . CurrentSolution ;
1108
1108
@@ -1155,7 +1155,7 @@ internal async Task TestSourceGenerationExecution_ProjectChange_Minor_3(SourceGe
1155
1155
1156
1156
// Updating project2 should regen only it due to project1 having no reference to it.
1157
1157
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : projectId2 , forceRegeneration : false ) ;
1158
- await GetWorkspaceWaiter ( workspace ) . ExpeditedWaitAsync ( ) ;
1158
+ await WaitForSourceGeneratorsAsync ( workspace ) ;
1159
1159
1160
1160
var currentSolution = workspace . CurrentSolution ;
1161
1161
@@ -1210,7 +1210,7 @@ internal async Task TestSourceGenerationExecution_ProjectChange_MinorAndMajor1(S
1210
1210
// for both as project2 has a ref on project1.
1211
1211
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : projectId1 , forceRegeneration : true ) ;
1212
1212
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : projectId2 , forceRegeneration : false ) ;
1213
- await GetWorkspaceWaiter ( workspace ) . ExpeditedWaitAsync ( ) ;
1213
+ await WaitForSourceGeneratorsAsync ( workspace ) ;
1214
1214
1215
1215
var currentSolution = workspace . CurrentSolution ;
1216
1216
@@ -1255,7 +1255,7 @@ internal async Task TestSourceGenerationExecution_ProjectChange_MinorAndMajor2(S
1255
1255
// only for project2 as project1 doesn't have a ref on it.
1256
1256
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : projectId1 , forceRegeneration : false ) ;
1257
1257
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : projectId2 , forceRegeneration : true ) ;
1258
- await GetWorkspaceWaiter ( workspace ) . ExpeditedWaitAsync ( ) ;
1258
+ await WaitForSourceGeneratorsAsync ( workspace ) ;
1259
1259
1260
1260
var currentSolution = workspace . CurrentSolution ;
1261
1261
@@ -1298,7 +1298,7 @@ internal async Task TestSourceGenerationExecution_SolutionAndProjectChange_1(Sou
1298
1298
// Project2 should have a minor update since we only have a solution-minor change.
1299
1299
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : null , forceRegeneration : false ) ;
1300
1300
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : projectId1 , forceRegeneration : true ) ;
1301
- await GetWorkspaceWaiter ( workspace ) . ExpeditedWaitAsync ( ) ;
1301
+ await WaitForSourceGeneratorsAsync ( workspace ) ;
1302
1302
1303
1303
var currentSolution = workspace . CurrentSolution ;
1304
1304
@@ -1341,7 +1341,7 @@ internal async Task TestSourceGenerationExecution_SolutionAndProjectChange_2(Sou
1341
1341
// Project1 and 2 should have a major update since we have a solution-majorchange.
1342
1342
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : null , forceRegeneration : true ) ;
1343
1343
workspace . EnqueueUpdateSourceGeneratorVersion ( projectId : projectId1 , forceRegeneration : false ) ;
1344
- await GetWorkspaceWaiter ( workspace ) . ExpeditedWaitAsync ( ) ;
1344
+ await WaitForSourceGeneratorsAsync ( workspace ) ;
1345
1345
1346
1346
var currentSolution = workspace . CurrentSolution ;
1347
1347
0 commit comments