[Mouse Jump] Fix CA2227 in layout builders - #50733
Closed
matthudson wants to merge 1 commit into
Closed
matthudson wants to merge 1 commit into
matthudson wants to merge 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
matthudson
marked this pull request as ready for review
September 23, 2026 06:43
matthudson
marked this pull request as draft
September 23, 2026 06:57
7 tasks
Contributor
Author
|
Superseded by #50741, which combines these small isolated CA2227 fixes into one focused and fully validated pull request. Closing this draft to keep the review queue clear. |
Yu Leng (moooyo)
pushed a commit
that referenced
this pull request
Sep 23, 2026
…#50741) ## Summary of the Pull Request Resolves isolated CA2227 collection-property warnings in Command Palette extension settings, Mouse Jump layout models, and Hosts File Editor. The changes prevent replacement of collection properties while preserving their existing mutable contents, serialization behavior, object-initializer construction, and UI binding behavior. ## PR Checklist - [ ] Closes: N/A — follow-up to #11646 and #50702 - [x] Communication: Continuation requested during review of #50702 - [x] Tests: Focused CmdPal, Mouse Jump, and Hosts builds and tests pass - [x] Localization: N/A — no user-facing strings changed - [x] Dev docs: N/A — no developer-facing behavior changed - [x] New binaries: N/A - [x] Documentation updated: N/A — internal analyzer cleanup only ## Detailed Description of the Pull Request / Additional comments ### Command Palette - Makes extension setting collection properties init-only. - Preserves collection mutability and existing object-initializer construction. - Adds coverage confirming ChoiceSetSetting retains and exposes the supplied choices. - This narrows a public extension API by preventing post-construction collection replacement. As discussed on the superseded #50729, the compatibility risk is considered low because collection contents remain mutable. ### Mouse Jump - Makes the nested layout-builder collection properties init-only. - Retains existing object-initializer construction and subsequent content mutation. - Does not change layout calculation or rendering behavior. ### Hosts File Editor - Makes the Entries collection setter private so callers cannot replace the collection directly. - Changes the associated ItemsSource binding from two-way to one-way. - Preserves collection replacement inside the view model and its existing PropertyChanged notification after reload. These were originally opened separately as #50729, #50733, and #50734. They are combined here because each is a small, isolated CA2227 correction with focused validation and no shared behavioral dependency. ## Visual evidence No visual change is intended. The Hosts File Editor below was launched from the exact combined PR commit after a successful x64 Release build; the affected entries view renders normally after the binding-mode change.  ## Validation Steps Performed - Built the Command Palette extension test project successfully. - Ran Command Palette tests: **706 passed, 1 skipped, 0 failed**. - Built the Mouse Jump test project successfully. - Ran Mouse Jump tests: **31 passed, 0 failed**. - Built the Hosts File Editor test project successfully. - Ran Hosts File Editor tests: **151 passed, 0 failed**. - Ran git diff --check origin/main...HEAD: clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Resolves the CA2227 warnings in Mouse Jump's layout-builder model by making its nested collection properties init-only.
Existing mutation paths and object-initializer construction remain unchanged.
PR Checklist
Detailed Description of the Pull Request / Additional comments
Validation Steps Performed
MouseJump.Common.UnitTestswithAnalysisMode=All; no targeted CA2227 warnings remain.git diff --check origin/main...HEAD: clean.