Skip to content

Enable element order code fix provider - #4312

Merged
AArnott merged 1 commit into
masterfrom
aarnott-enable-element-order-fix
Oct 15, 2026
Merged

AArnott merged 1 commit into
masterfrom
aarnott-enable-element-order-fix

Conversation

@AArnott

@AArnott AArnott commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

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

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@AArnott
AArnott marked this pull request as ready for review October 15, 2026 23:42
Copilot AI balanced review requested due to automatic review settings October 15, 2026 23:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

codecov Bot commented Oct 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.63%. Comparing base (9869738) to head (b4ffdae).

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AArnott
AArnott merged commit a13340f into master Oct 15, 2026
30 checks passed
@AArnott
AArnott deleted the aarnott-enable-element-order-fix branch October 15, 2026 23:53
This was referenced Nov 11, 2026
This was referenced Nov 23, 2026
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.

Enable ElementOrderCodeFixProvider after 1.0

2 participants