File tree 2 files changed +8
-3
lines changed
src/BuiltInTools/dotnet-watch/HotReload
test/dotnet-watch.Tests/HotReload
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -416,11 +416,13 @@ void ReportRudeEdits()
416
416
// Rude edits in projects that caused restart of a project that can be restarted automatically
417
417
// will be reported only as verbose output.
418
418
var projectsRestartedDueToRudeEdits = updates . ProjectsToRestart
419
- . Where ( e => runningProjectInfos . TryGetValue ( e . Key , out var info ) && info . RestartWhenChangesHaveNoEffect )
419
+ . Where ( e => IsAutoRestartEnabled ( e . Key ) )
420
420
. SelectMany ( e => e . Value )
421
421
. ToHashSet ( ) ;
422
422
423
- var projectsRebuiltDueToRudeEdits = updates . ProjectsToRebuild . ToHashSet ( ) ;
423
+ var projectsRebuiltDueToRudeEdits = updates . ProjectsToRebuild
424
+ . Where ( IsAutoRestartEnabled )
425
+ . ToHashSet ( ) ;
424
426
425
427
foreach ( var ( projectId , diagnostics ) in updates . RudeEdits )
426
428
{
@@ -437,6 +439,9 @@ void ReportRudeEdits()
437
439
}
438
440
}
439
441
442
+ bool IsAutoRestartEnabled ( ProjectId id )
443
+ => runningProjectInfos . TryGetValue ( id , out var info ) && info . RestartWhenChangesHaveNoEffect ;
444
+
440
445
void ReportDiagnostic ( Diagnostic diagnostic , MessageDescriptor descriptor , string prefix = "" )
441
446
{
442
447
var display = CSharpDiagnosticFormatter . Instance . Format ( diagnostic ) ;
Original file line number Diff line number Diff line change @@ -760,7 +760,7 @@ public async Task Aspire()
760
760
await App . AssertOutputLineStartsWith ( " ❔ Do you want to restart these projects? Yes (y) / No (n) / Always (a) / Never (v)" ) ;
761
761
762
762
App . AssertOutputContains ( "dotnet watch ⌚ Restart is needed to apply the changes." ) ;
763
- App . AssertOutputContains ( " error ENC0020: Renaming record 'WeatherForecast' requires restarting the application.") ;
763
+ App . AssertOutputContains ( $ "dotnet watch ❌ { serviceSourcePath } (36,1): error ENC0020: Renaming record 'WeatherForecast' requires restarting the application.") ;
764
764
App . AssertOutputContains ( "dotnet watch ⌚ Affected projects:" ) ;
765
765
App . AssertOutputContains ( "dotnet watch ⌚ WatchAspire.ApiService" ) ;
766
766
App . Process . ClearOutput ( ) ;
You can’t perform that action at this time.
0 commit comments