-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C#: Add compilation errors to the debug log in BMN. #20849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C#: Add compilation errors to the debug log in BMN. #20849
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds compilation errors to the debug log when extracting in build-mode none (BMN), making it easier to diagnose issues causing bad database quality. The changes refactor common diagnostic filtering logic into a shared base class method.
- Refactored diagnostic filtering logic from
TracingAnalyserinto a new protected method in the baseAnalyserclass - Added diagnostic logging to
StandaloneAnalyserusing debug-level logging - Moved the
errorsToIgnoreHashSet fromTracingAnalyserto the baseAnalyserclass for reuse
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| csharp/ql/lib/change-notes/2025-11-17-compiler-error-debug.md | Documents the new feature in the change notes |
| csharp/extractor/Semmle.Extraction.CSharp/Extractor/Analyser.cs | Adds GetFilteredDiagnostics() method and errorsToIgnore HashSet to the base class |
| csharp/extractor/Semmle.Extraction.CSharp/Extractor/TracingAnalyser.cs | Refactors to use the new base class method instead of inline diagnostic filtering |
| csharp/extractor/Semmle.Extraction.CSharp/Extractor/StandaloneAnalyser.cs | Adds LogDiagnostics() method to log compilation errors at debug level for BMN |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| protected List<Diagnostic> GetFilteredDiagnostics() => | ||
| compilation is not null | ||
| ? compilation.GetDiagnostics() | ||
| .Where(e => e.Severity >= DiagnosticSeverity.Error && !errorsToIgnore.Contains(e.Id)) | ||
| .ToList() | ||
| : []; |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent indentation: line 375 has an extra leading space that doesn't align with the expression pattern formatting on subsequent lines. The condition check should align with line 376.
d423367 to
9f69ff2
Compare
In this PR we add compilation errors to the Debug log when extracting in BMN. This could make it easier to diagnose issues causing bad database quality (without having a copy of the database).