Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add support for partial properties for [ObservableProperty] - #966

#966
Merged
Sergio0694 merged 43 commits into
mainCommunityToolkit/dotnet:mainfrom
dev/partial-propertiesCommunityToolkit/dotnet:dev/partial-propertiesCopy head branch name to clipboard
Oct 27, 2024
Merged

Add support for partial properties for [ObservableProperty]#966
Sergio0694 merged 43 commits into
mainCommunityToolkit/dotnet:mainfrom
dev/partial-propertiesCommunityToolkit/dotnet:dev/partial-propertiesCopy head branch name to clipboard

Conversation

@Sergio0694

Copy link
Copy Markdown
Member

Closes #555

This PR updates the [ObservableProperty] generator to support partial properties as well.
It includes the following changes:

  • Update the target of all attribute types to support properties too
  • Update generator to handle partial properties
  • Update all diagnostic messages to also mention partial properties
  • Add a new analyzer to error if C# is not set to preview
  • Add a new analyzer to error if using a version of Roslyn that's too old
  • Add a new analyzer to error if a partial property declaration is invalid
  • Add a new analyzer to suggest converting to a partial property when possible
  • Add a new code fixer to automatically update all fields to partial properties
  • Add unit tests for all new features

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

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 feature 💡 A new feature being implemented mvvm-toolkit 🧰 Issues/PRs for the MVVM Toolkit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for [ObservableProperty] on partial properties

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.