@@ -632,8 +632,9 @@ public class Person
632632 Assert . Empty ( result . Diagnostics ) ;
633633 Assert . Equal ( 2 , result . GeneratedSources . Length ) ;
634634
635- // When a C# type changes, only TagHelpersFromCompilation should re-run
636- result . VerifyIncrementalSteps ( "TagHelpersFromCompilation" , IncrementalStepRunReason . Modified ) ;
635+ // When a C# type changes, TagHelpersFromCompilation re-runs but the output is unchanged
636+ // because Person is not a component and doesn't affect tag helpers
637+ result . VerifyIncrementalSteps ( "TagHelpersFromCompilation" , IncrementalStepRunReason . Unchanged ) ;
637638 }
638639
639640 [ Fact ]
@@ -3334,7 +3335,7 @@ public async Task RazorClassLibrary_Change_Updates_DependentProject_WhenReferenc
33343335 mainProject = mainProject . AddMetadataReference ( rclReference ) ;
33353336
33363337 var mainCompilation = await mainProject . GetCompilationAsync ( ) ;
3337- var ( mainDriver , mainAdditionalTexts ) = await GetDriverWithAdditionalTextAsync ( mainProject ) ;
3338+ var ( mainDriver , mainAdditionalTexts , _ ) = await GetDriverWithAdditionalTextAndProviderAsync ( mainProject , trackSteps : true ) ;
33383339 var mainRun = RunGenerator ( mainCompilation ! , ref mainDriver ) ;
33393340 Assert . Empty ( mainRun . Diagnostics ) ;
33403341 Assert . Single ( mainRun . GeneratedSources ) ;
@@ -3374,19 +3375,15 @@ public async Task RazorClassLibrary_Change_Updates_DependentProject_WhenReferenc
33743375 Assert . Empty ( mainRun . Diagnostics ) ;
33753376 Assert . Single ( mainRun . GeneratedSources ) ;
33763377
3377- // Update the compilation, which will cause us to re-run with tracking enabled
3378- var ( mainDriverWithTracking , _, _) = await GetDriverWithAdditionalTextAndProviderAsync ( mainProject , trackSteps : true ) ;
3379- mainDriverWithTracking = mainDriverWithTracking . ReplaceAdditionalText (
3380- mainAdditionalTexts . First ( t => t . Path . EndsWith ( "Index.razor" , StringComparison . OrdinalIgnoreCase ) ) ,
3381- updatedIndex ) ;
3382-
3378+ // Update the compilation, which will cause us to re-run
33833379 mainCompilation = mainCompilation ! . WithOptions ( mainCompilation . Options . WithModuleName ( "newMain" ) ) ;
3384- mainRun = RunGenerator ( mainCompilation ! , ref mainDriverWithTracking ) ;
3380+ mainRun = RunGenerator ( mainCompilation ! , ref mainDriver ) ;
33853381 Assert . Empty ( mainRun . Diagnostics ) ;
33863382 Assert . Single ( mainRun . GeneratedSources ) ;
33873383
33883384 // Confirm that the tag helpers from metadata refs _didn't_ re-run
3389- mainRun . VerifyIncrementalSteps ( "TagHelpersFromCompilation" , IncrementalStepRunReason . Modified ) ;
3385+ // TagHelpersFromCompilation re-runs when compilation changes but output is unchanged
3386+ mainRun . VerifyIncrementalSteps ( "TagHelpersFromCompilation" , IncrementalStepRunReason . Unchanged ) ;
33903387 }
33913388 }
33923389}
0 commit comments