Skip to content

Conversation

@michaelnebel
Copy link
Contributor

@michaelnebel michaelnebel commented Nov 17, 2025

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).

@michaelnebel michaelnebel marked this pull request as ready for review November 17, 2025 13:38
@michaelnebel michaelnebel requested a review from a team as a code owner November 17, 2025 13:38
Copilot AI review requested due to automatic review settings November 17, 2025 13:38
Copilot finished reviewing on behalf of michaelnebel November 17, 2025 13:41
Copy link
Contributor

Copilot AI left a 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 TracingAnalyser into a new protected method in the base Analyser class
  • Added diagnostic logging to StandaloneAnalyser using debug-level logging
  • Moved the errorsToIgnore HashSet from TracingAnalyser to the base Analyser class 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.

Comment on lines 374 to 379
protected List<Diagnostic> GetFilteredDiagnostics() =>
compilation is not null
? compilation.GetDiagnostics()
.Where(e => e.Severity >= DiagnosticSeverity.Error && !errorsToIgnore.Contains(e.Id))
.ToList()
: [];
Copy link

Copilot AI Nov 17, 2025

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.

Copilot uses AI. Check for mistakes.
@michaelnebel michaelnebel force-pushed the csharp/addcompilationerrorstodebuglogbmn branch from d423367 to 9f69ff2 Compare November 17, 2025 13:57
@michaelnebel michaelnebel merged commit 958d209 into github:main Nov 18, 2025
20 checks passed
@michaelnebel michaelnebel deleted the csharp/addcompilationerrorstodebuglogbmn branch November 18, 2025 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants