Skip to content

Switch MetricsSourceGenerator to IIncrementalGenerator#817

Merged
einari merged 2 commits into7.4.0from
copilot/switch-to-iincremental-generator
Jan 2, 2026
Merged

Switch MetricsSourceGenerator to IIncrementalGenerator#817
einari merged 2 commits into7.4.0from
copilot/switch-to-iincremental-generator

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Dec 21, 2025

Changed

  • Migrated MetricsSourceGenerator from ISourceGenerator to IIncrementalGenerator to follow current Roslyn best practices and eliminate analyzer warnings RS1035 and RS1042
  • Replaced ISyntaxReceiver pattern with incremental pipeline using CreateSyntaxProvider for syntax filtering and RegisterSourceOutput for code generation
  • Changed diagnostic reporting to use SourceProductionContext instead of GeneratorExecutionContext

Removed

  • Removed MetricsSyntaxReceiver.cs - filtering logic now integrated directly into generator using static predicates
  • Removed dotnet_diagnostic.RS1035.severity = none and dotnet_diagnostic.RS1042.severity = none suppressions from .globalconfig
  • Removed static constructor with hardcoded Handlebars assembly path

Benefits: The incremental generator only re-runs on changed files rather than the entire compilation, improving build performance. The pipeline properly caches intermediate results and supports parallel execution.

Original prompt

This section details on the original issue you should resolve

<issue_title>Switch to using IIncrementalGenerator for MetricsSourceGenerator - as non-incremental source generators should not be used</issue_title>
<issue_description>Remember to remove the following lines from .globalconfig:

dotnet_diagnostic.RS1035.severity = none
dotnet_diagnostic.RS1042.severity = none
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…1035/RS1042 suppressions

Co-authored-by: einari <134365+einari@users.noreply.github.com>
Copilot AI changed the title [WIP] Switch to using IIncrementalGenerator for MetricsSourceGenerator Switch MetricsSourceGenerator to IIncrementalGenerator Dec 21, 2025
Copilot AI requested a review from einari December 21, 2025 11:24
@github-actions
Copy link
Copy Markdown
Contributor

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

@einari einari changed the base branch from main to 7.4.0 January 2, 2026 08:15
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 2, 2026

@einari einari marked this pull request as ready for review January 2, 2026 08:17
@einari einari merged commit c9fdde6 into 7.4.0 Jan 2, 2026
15 of 16 checks passed
@einari einari deleted the copilot/switch-to-iincremental-generator branch January 2, 2026 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch to using IIncrementalGenerator for MetricsSourceGenerator - as non-incremental source generators should not be used

2 participants