Skip to content

Commit c309bce

Browse files
authored
Merge pull request #1551 from microsoft/copilot/sub-pr-1550
Add explanatory comments for CodeFixTestBehaviors.SkipLocalDiagnosticCheck usages
1 parent e601e0e commit c309bce

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

test/Microsoft.VisualStudio.Threading.Analyzers.Tests/VSTHRD010MainThreadUsageAnalyzerTests.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ static void VerifyOnUIThread() {
285285
ExpectedDiagnostics = { expected },
286286
FixedCode = fix1,
287287
CodeActionIndex = CodeFixIndex.VerifyOnUIThread,
288+
289+
// SkipLocalDiagnosticCheck is required because this diagnostic is reported at compilation-end
290+
// (as a transitive/indirect diagnostic), not as a local one. See https://github.com/microsoft/vs-threading/issues/1364.
288291
CodeFixTestBehaviors = CodeFixTestBehaviors.SkipLocalDiagnosticCheck,
289292
}.RunAsync();
290293

@@ -294,6 +297,9 @@ static void VerifyOnUIThread() {
294297
ExpectedDiagnostics = { expected },
295298
FixedCode = fix2,
296299
CodeActionIndex = CodeFixIndex.ThrowIfNotOnUIThreadIndex1,
300+
301+
// SkipLocalDiagnosticCheck is required because this diagnostic is reported at compilation-end
302+
// (as a transitive/indirect diagnostic), not as a local one. See https://github.com/microsoft/vs-threading/issues/1364.
297303
CodeFixTestBehaviors = CodeFixTestBehaviors.SkipLocalDiagnosticCheck,
298304
}.RunAsync();
299305
}
@@ -589,6 +595,9 @@ static void VerifyOnUIThread() { }
589595
},
590596
FixedCode = fix,
591597
CodeActionIndex = CodeFixIndex.VerifyOnUIThread,
598+
599+
// SkipLocalDiagnosticCheck is required because this diagnostic is reported at compilation-end
600+
// (as a transitive/indirect diagnostic), not as a local one. See https://github.com/microsoft/vs-threading/issues/1364.
592601
CodeFixTestBehaviors = CodeFixTestBehaviors.SkipLocalDiagnosticCheck,
593602
}.RunAsync();
594603
}

0 commit comments

Comments
 (0)