Skip to content

Conversation

@Sergio0694
Copy link
Member

This PR fixes the C# language checks when using partial properties, which need the new Roslyn version.

PR Checklist

  • Created a feature/dev branch in your fork (vs. submitting directly from a commit on main)
  • Based off latest main branch of toolkit
  • PR doesn't include merge commits (always rebase on top of our main, if needed)
  • Tested code with current supported SDKs
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes
  • Every new API (including internal ones) has full XML docs
  • Code follows all style conventions

Updated the ObservableProperty generator and diagnostics to allow usage with C# 14.0 or 'preview' language versions, not just 'preview'. Added a new helper method for language version comparison and updated diagnostic descriptors and analyzer logic to reflect the new minimum version requirement.
Created a new CommunityToolkit.Mvvm.SourceGenerators.Roslyn5000 project targeting netstandard2.0 and added it to the solution file.
Refactored the Roslyn 5000 project to import shared props and projitems files. Added support for the ROSLYN_5_0_0_OR_GREATER constant, updated NoWarn conditions for RS2003, and introduced a temporary workaround for Roslyn 5.0.0 versioning in the props file.
Revised the XML summary comment to clarify that the extension methods are for working with diagnostics from incremental generator pipelines, rather than specifically for GeneratorExecutionContext.
Added project references and packaging entries for Roslyn 5.0 source generators and code fixers to support analyzers for the latest Roslyn version.
Renamed RequiresCSharpLanguageVersionPreviewAnalyzer to RequiresCSharpLanguageVersion14OrPreviewAnalyzer and updated logic to check for C# 14.0 or preview language versions. Adjusted generator and unit tests to reference the new analyzer and updated version checks for compatibility with Roslyn 5.0.0 or greater.
@Sergio0694 Sergio0694 added mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit bugfix 🔧 PRs fixing a discovered bug analyzer 👓 A new analyzer being implemented or updated labels Nov 12, 2025
Introduces CommunityToolkit.Mvvm.Roslyn5000.UnitTests.csproj targeting net472, net8.0, and net9.0. Updates the solution file to include the new test project for Roslyn 5.0.0 compatibility testing.
Added CommunityToolkit.Mvvm.SourceGenerators.Roslyn5000.UnitTests project to the solution and corrected the project reference in CommunityToolkit.Mvvm.csproj to point to the correct Roslyn5000 source generator. This enables testing for Roslyn 5.0.0 support.
Introduces new unit tests for ObservableProperty with value types on partial properties using C# 14 and Roslyn 5.0.0 or greater. Also updates formatting in diagnostics tests for consistency and readability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

analyzer 👓 A new analyzer being implemented or updated bugfix 🔧 PRs fixing a discovered bug mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant