@@ -153,9 +153,9 @@ public async Task StartDebuggingSession_CapturingDocuments(bool captureAllDocume
153
153
EnterBreakState( debuggingSession ) ;
154
154
155
155
var ( updates , emitDiagnostics ) = await EmitSolutionUpdateAsync( debuggingSession , solution ) ;
156
- Assert. Equal ( ModuleUpdateStatus . None , updates . Status ) ;
156
+ Assert. Equal ( ModuleUpdateStatus . Blocked , updates . Status ) ;
157
157
Assert. Empty ( updates . Updates ) ;
158
- AssertEx. Equal ( [ $ "P.csproj: (0,0)-(0,0): Warning ENC1005: { string . Format ( FeaturesResources . DocumentIsOutOfSyncWithDebuggee , sourceFileB . Path ) } "] , InspectDiagnostics ( emitDiagnostics ) ) ;
158
+ AssertEx. Equal ( [ $ "P.csproj: (0,0)-(0,0): Error ENC1005: { string . Format ( FeaturesResources . DocumentIsOutOfSyncWithDebuggee , sourceFileB . Path ) } "] , InspectDiagnostics ( emitDiagnostics ) ) ;
159
159
160
160
EndDebuggingSession( debuggingSession ) ;
161
161
}
@@ -595,9 +595,9 @@ public async Task ErrorReadingPdbFile()
595
595
596
596
// an error occurred so we need to call update to determine whether we have changes to apply or not:
597
597
var ( updates , emitDiagnostics ) = await EmitSolutionUpdateAsync( debuggingSession , solution ) ;
598
- Assert. Equal ( ModuleUpdateStatus . None , updates . Status ) ;
598
+ Assert. Equal ( ModuleUpdateStatus . Blocked , updates . Status ) ;
599
599
Assert. Empty ( updates . Updates ) ;
600
- AssertEx. Equal ( [ $ "proj.csproj: (0,0)-(0,0): Warning ENC1006: { string . Format ( FeaturesResources . UnableToReadSourceFileOrPdb , sourceFile . Path ) } "] , InspectDiagnostics ( emitDiagnostics ) ) ;
600
+ AssertEx. Equal ( [ $ "proj.csproj: (0,0)-(0,0): Error ENC1006: { string . Format ( FeaturesResources . UnableToReadSourceFileOrPdb , sourceFile . Path ) } "] , InspectDiagnostics ( emitDiagnostics ) ) ;
601
601
602
602
EndDebuggingSession( debuggingSession ) ;
603
603
@@ -642,9 +642,9 @@ public async Task ErrorReadingSourceFile()
642
642
643
643
// an error occurred so we need to call update to determine whether we have changes to apply or not:
644
644
var ( updates , emitDiagnostics ) = await EmitSolutionUpdateAsync ( debuggingSession , solution ) ;
645
- Assert. Equal ( ModuleUpdateStatus . None , updates . Status ) ;
645
+ Assert. Equal ( ModuleUpdateStatus . Blocked , updates . Status ) ;
646
646
Assert. Empty ( updates . Updates ) ;
647
- AssertEx. Equal ( [ $ "test.csproj: (0,0)-(0,0): Warning ENC1006: { string . Format ( FeaturesResources . UnableToReadSourceFileOrPdb , sourceFile . Path ) } "] , InspectDiagnostics ( emitDiagnostics ) ) ;
647
+ AssertEx. Equal ( [ $ "test.csproj: (0,0)-(0,0): Error ENC1006: { string . Format ( FeaturesResources . UnableToReadSourceFileOrPdb , sourceFile . Path ) } "] , InspectDiagnostics ( emitDiagnostics ) ) ;
648
648
649
649
fileLock. Dispose ( ) ;
650
650
@@ -1168,9 +1168,9 @@ public async Task RudeEdits_DocumentOutOfSync(bool breakMode)
1168
1168
1169
1169
// since the document is out-of-sync we need to call update to determine whether we have changes to apply or not:
1170
1170
var ( updates, emitDiagnostics) = await EmitSolutionUpdateAsync( debuggingSession, solution) ;
1171
- Assert. Equal( ModuleUpdateStatus. None , updates. Status) ;
1171
+ Assert. Equal( ModuleUpdateStatus. Blocked , updates. Status) ;
1172
1172
Assert. Empty( updates. Updates) ;
1173
- AssertEx. Equal( [ $"proj.csproj: (0,0)-(0,0): Warning ENC1005: {string.Format(FeaturesResources.DocumentIsOutOfSyncWithDebuggee, sourceFile.Path)}" ] , InspectDiagnostics ( emitDiagnostics ) ) ;
1173
+ AssertEx. Equal( [ $"proj.csproj: (0,0)-(0,0): Error ENC1005: {string.Format(FeaturesResources.DocumentIsOutOfSyncWithDebuggee, sourceFile.Path)}" ] , InspectDiagnostics ( emitDiagnostics ) ) ;
1174
1174
1175
1175
// update the file to match the build:
1176
1176
sourceFile. WriteAllText( source0, Encoding . UTF8 ) ;
@@ -2312,8 +2312,8 @@ public async Task ValidSignificantChange_FileUpdateNotObservedBeforeDebuggingSes
2312
2312
2313
2313
// since the document is out-of-sync we need to call update to determine whether we have changes to apply or not:
2314
2314
var ( updates , emitDiagnostics ) = await EmitSolutionUpdateAsync ( debuggingSession , solution ) ;
2315
- Assert . Equal ( ModuleUpdateStatus . None , updates . Status ) ;
2316
- AssertEx . Equal ( [ $ "test.csproj: (0,0)-(0,0): Warning ENC1005: { string . Format ( FeaturesResources . DocumentIsOutOfSyncWithDebuggee , sourceFile . Path ) } "] , InspectDiagnostics ( emitDiagnostics ) ) ;
2315
+ Assert . Equal ( ModuleUpdateStatus . Blocked , updates . Status ) ;
2316
+ AssertEx . Equal ( [ $ "test.csproj: (0,0)-(0,0): Error ENC1005: { string . Format ( FeaturesResources . DocumentIsOutOfSyncWithDebuggee , sourceFile . Path ) } "] , InspectDiagnostics ( emitDiagnostics ) ) ;
2317
2317
2318
2318
// undo:
2319
2319
solution = solution . WithDocumentText ( documentId , CreateText ( source1 ) ) ;
@@ -3111,6 +3111,44 @@ public async Task ValidSignificantChange_SourceGenerators_DocumentRemove()
3111
3111
EndDebuggingSession( debuggingSession ) ;
3112
3112
}
3113
3113
3114
+ [ Fact ]
3115
+ public async Task ValidInsignificantChange( )
3116
+ {
3117
+ var sourceV1 = "class C1 { void M( ) { /* System.Console.WriteLine(1); */ } } ";
3118
+ var sourceV2 = "class C1 { void M() { /* System.Console.WriteLine(2); */ } }" ;
3119
+
3120
+ using var _ = CreateWorkspace( out var solution , out var service ) ;
3121
+ ( solution , var document1 ) = AddDefaultTestProject ( solution , sourceV1 ) ;
3122
+
3123
+ var moduleId = EmitAndLoadLibraryToDebuggee ( sourceV1 ) ;
3124
+
3125
+ var debuggingSession = await StartDebuggingSessionAsync ( service , solution ) ;
3126
+
3127
+ // change the source (valid edit):
3128
+ solution = solution . WithDocumentText ( document1 . Id , CreateText ( sourceV2 ) ) ;
3129
+ var document2 = solution . GetDocument ( document1 . Id ) ;
3130
+
3131
+ var diagnostics1 = await service . GetDocumentDiagnosticsAsync ( document2 , s_noActiveSpans , CancellationToken . None ) ;
3132
+ AssertEx . Empty ( diagnostics1 ) ;
3133
+
3134
+ // validate solution update status and emit:
3135
+ var ( updates , emitDiagnostics ) = await EmitSolutionUpdateAsync ( debuggingSession , solution ) ;
3136
+ Assert . Empty ( emitDiagnostics ) ;
3137
+ Assert . Equal ( ModuleUpdateStatus . None , updates . Status ) ;
3138
+
3139
+ // solution has been updated:
3140
+ var text = await debuggingSession . LastCommittedSolution . GetRequiredProject ( document1 . Project . Id ) . GetDocument ( document1 . Id ) . GetTextAsync ( ) ;
3141
+ Assert . Equal ( sourceV2 , text . ToString ( ) ) ;
3142
+
3143
+ EndDebuggingSession ( debuggingSession ) ;
3144
+
3145
+ AssertEx . SequenceEqual (
3146
+ [
3147
+ "Debugging_EncSession: SolutionSessionId={00000000-AAAA-AAAA-AAAA-000000000000}|SessionId=1|SessionCount=0|EmptySessionCount=0|HotReloadSessionCount=1|EmptyHotReloadSessionCount=0" ,
3148
+ "Debugging_EncSession_EditSession: SessionId=1|EditSessionId=2|HadCompilationErrors=False|HadRudeEdits=False|HadValidChanges=False|HadValidInsignificantChanges=True|RudeEditsCount=0|EmitDeltaErrorIdCount=0|InBreakState=False|Capabilities=0|ProjectIdsWithAppliedChanges=|ProjectIdsWithUpdatedBaselines="
3149
+ ] , _telemetryLog ) ;
3150
+ }
3151
+
3114
3152
[ Fact ]
3115
3153
public async Task RudeEdit ( )
3116
3154
{
0 commit comments