Repository navigation
Enable element order code fix provider - #4312
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟢 Approval recommended
The narrowly scoped export change has targeted regression coverage and no unresolved findings; tests were not run during this review.
0 open findings
What changed in this PR
Enables Roslyn discovery of the existing element-order code fix provider, addressing #1869 without changing ordering logic.
Changes:
- Replaces the disabling attribute with a C# code-fix export.
- Adds a regression test confirming the provider remains exported and enabled.
| File | Description |
|---|---|
| test/StyleCop.Analyzers.Test/ExportCodeFixProviderAttributeNameTest.cs | Adds export regression assertions. |
| src/StyleCop.Analyzers.CodeFixes/OrderingRules/ElementOrderCodeFixProvider.cs | Enables discovery of the ordering fixes. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4312 +/- ##
==========================================
- Coverage 97.63% 97.63% -0.01%
==========================================
Files 1308 1308
Lines 142748 142753 +5
Branches 4756 4756
==========================================
+ Hits 139377 139378 +1
- Misses 2146 2149 +3
- Partials 1225 1226 +1 🚀 New features to boost your workflow:
|
This was referenced Nov 11, 2026
Bump StyleCop.Analyzers from 1.2.0-beta.556 to 1.3.180
microsoftgraph/aspnetcore-webhooks-sample#436
Open
Closed
This was referenced Nov 23, 2026
Open
[DPDBT] Bump Microsoft.CodeAnalysis.Analyzers and 6 others
sergey-rybalkin/CommandLine.Generators#63
Open
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.
The element-order code fix was disabled as "Disabled until stable," leaving the ordering diagnostics without their implemented fixes. Enable the provider for Roslyn discovery and add a regression assertion that it remains exported.
Existing tests cover SA1201, SA1202, SA1203, SA1204, and SA1214, including Fix All, comments/trivia, directives and regions, nested and namespace members, and field dependencies. The ordering suites pass on both the base compiler and C# 15 (234 and 249 tests respectively). The analyzer is unchanged, so there is no analyzer performance impact.
Fixes #1869